GS2-Mission SDK API Reference

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

Model

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSetting
Transaction Setting
Settings for distributed transactions used when granting mission completion rewards.
missionCompleteScriptScriptSettingScript to run when a mission is accomplished
Script Trigger Reference - missionComplete
counterIncrementScriptScriptSettingScript to run when the counter rises
Script Trigger Reference - counterIncrement
receiveRewardsScriptScriptSettingScript to run when a reward is received
Script Trigger Reference - receiveRewards
completeNotificationNotificationSetting
Push notifications when mission tasks are accomplished
Configures push notifications delivered via GS2-Gateway when a mission task’s completion conditions are met. This allows the game client to immediately reflect the accomplishment in the UI.
logSettingLogSettingLog Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for debugging counter increments, mission completions, and reward receipts.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

TransactionSetting

Transaction Setting

Transaction Setting controls how transactions are executed, including their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.

Details
TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunboolfalseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == truefalseWhether to commit the execution of transactions atomically
* Applicable only if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == truefalseWhether to execute transactions asynchronously
* Applicable only if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == truefalseWhether to execute the commit processing of the script result asynchronously
* Applicable only if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == truefalseWhether to use GS2-JobQueue to execute the acquire action
* Applicable only if enableAtomicCommit is true
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor Namespace GRN used to execute transactions
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsGS2-JobQueue Namespace GRN used to execute transactions

ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script’s execution results to halt API execution or control the API’s response content.

In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

Details
TypeConditionRequiredDefaultValue LimitsDescription
triggerScriptIdstring~ 1024 charsGS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetTypeString Enum
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none”How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Applicable only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason.
* Applicable only if doneTriggerTargetType is “gs2_script”

NotificationSetting

Push Notification Settings

This is a setting for sending push notifications when an event occurs in a GS2 microservice. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway’s push notifications can be used to forward notifications to mobile push notification services when the destination device is offline. By properly utilizing mobile push notifications, you can implement a flow in which players are notified even if they exit the game during matchmaking and later return to it.

Details
TypeConditionRequiredDefaultValue LimitsDescription
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024 charsGS2-Gateway namespace to use for push notifications
Specify the GS2-Gateway namespace ID in GRN format starting with “grn:gs2:”.
enableTransferMobileNotificationbool?falseWhether to forward the notification as a mobile push notification
When this notification is sent and the destination device is offline, specify whether to forward it as a mobile push notification.
soundstring{enableTransferMobileNotification} == true~ 1024 charsSound file name to be used for mobile push notifications
The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound.
* Applicable only if enableTransferMobileNotification is true
enableString Enum
enum {
  “Enabled”,
  “Disabled”
}
“Enabled”Whether to enable push notifications
DefinitionDescription
“Enabled”Enabled
“Disabled”Disabled

LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.

Details
TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setup to check out master data from GitHub

Details
TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API Key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

Complete

Mission Completion Status

Tracks a user’s mission completion and reward receipt status for a specific mission group. Maintains separate lists for accomplished task names and reward-received task names, distinguishing between tasks that have been completed and those whose rewards have actually been claimed.

Details
TypeConditionRequiredDefaultValue LimitsDescription
completeIdstring
*
~ 1024 charsCompletion Status GRN
* Set automatically by the server
userIdstring
~ 128 charsUser ID
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
completedMissionTaskNamesList<string>[]0 ~ 1000 itemsList of Completed Task Names
The names of mission tasks that the user has accomplished (completion conditions met). A task appears in this list when its counter reaches the target value or verify actions pass, regardless of whether the reward has been claimed.
receivedMissionTaskNamesList<string>[]0 ~ 1000 itemsList of Reward received Task Names
The names of mission tasks for which the user has already claimed the completion reward. A task must be in the completed list before its reward can be received.
nextResetAtlongNext reset timing
The timestamp at which this mission group’s completion status will be reset. Determined by the mission group’s reset type and timing settings. Null if the reset type is “notReset”.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

Counter

Counter

A counter is an entity that keeps track of mission progress for each game player. Counter values are aggregated by the duration of the associated task.

Therefore, one counter can have multiple values. For example, for a quest clear count counter, the number of times the quest was completed this month, this week, and today. For example, a quest clear count counter could have the following values.

Details
TypeConditionRequiredDefaultValue LimitsDescription
counterIdstring
*
~ 1024 charsCounter GRN
* Set automatically by the server
userIdstring
~ 128 charsUser ID
namestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
valuesList<ScopedValue>[]0 ~ 32 itemsValues
The list of scoped values for this counter. Each entry holds the counter value for a specific scope (reset timing or verify action condition), along with the next reset time. A single counter holds multiple values for different scopes simultaneously.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

CounterScopeModel

Counter Reset Timing Model

Defines a scope for a counter, which determines how and when the counter value is reset. A scope can be either a reset timing (daily, weekly, monthly, fixed-day interval, or never) or a verify action condition. Each counter can have multiple scopes to track values across different periods.

Details
TypeConditionRequiredDefaultValue LimitsDescription
scopeTypeString Enum
enum {
  “resetTiming”,
  “verifyAction”
}
“resetTiming”Scope type
Determines how the counter scope is defined. “resetTiming” uses a periodic reset schedule, while “verifyAction” uses a verify action to determine whether the counter value applies.
DefinitionDescription
“resetTiming”Reset timing
“verifyAction”Verify Action
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
“notReset”Reset timing
Determines when the counter value for this scope is reset. Choose from: not reset (permanent cumulative), daily, weekly, monthly, or every fixed number of days. Only used when scopeType is “resetTiming”.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
resetDayOfMonthint{resetType} == “monthly”
✓*
1 ~ 31Date to reset
The day of the month on which the counter value resets. If the specified value exceeds the number of days in the month, it is treated as the last day of that month. Only used when resetType is “monthly”.
* Required if resetType is “monthly”
resetDayOfWeekString Enum
enum {
  “sunday”,
  “monday”,
  “tuesday”,
  “wednesday”,
  “thursday”,
  “friday”,
  “saturday”
}
{resetType} == “weekly”
✓*
Day of the week to reset
The day of the week on which the counter value resets. Only used when resetType is “weekly”.
DefinitionDescription
“sunday”Sunday
“monday”Monday
“tuesday”Tuesday
“wednesday”Wednesday
“thursday”Thursday
“friday”Friday
“saturday”Saturday
* Required if resetType is “weekly”
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]
✓*
0 ~ 23Hour of Reset
The hour (0-23) at which the counter value resets. Used in combination with daily, weekly, or monthly reset types.
* Required if resetType is “monthly”,“weekly”,“daily”
conditionNamestring{scopeType} == “verifyAction”
✓*
~ 128 charsCondition Name
A unique name that identifies this verify action condition scope. Used to look up the corresponding scoped value in the counter. Only used when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
conditionVerifyAction{scopeType} == “verifyAction”
✓*
Condition
The verify action that determines whether the counter value for this scope is applicable. Only used when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
anchorTimestamplong{resetType} == “days”
✓*
Base date and time for counting elapsed days
Unix time, milliseconds
* Required if resetType is “days”
daysint{resetType} == “days”
✓*
1 ~ 2147483646Number of days to reset
The interval in days between counter value resets, counting from the anchor timestamp. Only used when resetType is “days”.
* Required if resetType is “days”

CounterModel

Counter Model

Counter Model is an entity that can be set as a condition for accomplishing mission tasks. Since counter values can be referenced by multiple mission groups, a single counter can be set as an accomplishment condition for multiple mission groups, such as weekly and daily missions.

Details
TypeConditionRequiredDefaultValue LimitsDescription
counterIdstring
*
~ 1024 charsCounter Model GRN
* Set automatically by the server
namestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
scopesList<CounterScopeModel>[]1 ~ 20 itemsList of Counter reset timing
Defines the scopes (reset timings or verify action conditions) for this counter. A single counter can have multiple scopes, allowing one counter to track values across different periods (e.g., daily, weekly, and cumulative totals simultaneously).
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated
Specifies the GS2-Schedule event that defines the time window during which this counter can be incremented or decremented. If not set, the counter can be operated at any time.

MissionGroupModel

Mission Group Model

A mission group is an entity that groups tasks by counter reset timing. For example, one group for daily missions. One group for Weekly Mission.

Details
TypeConditionRequiredDefaultValue LimitsDescription
missionGroupIdstring
*
~ 1024 charsMission Group GRN
* Set automatically by the server
namestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
tasksList<MissionTaskModel>[]0 ~ 1000 itemsList of Mission Task
The mission tasks belonging to this group. Each task defines a completion condition (counter threshold or verify actions) and the rewards granted upon accomplishment.
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
“notReset”Reset timing
Determines when the mission group’s completion status is reset. Choose from: not reset (permanent), daily, weekly, monthly, or every fixed number of days from an anchor timestamp.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
resetDayOfMonthint{resetType} == “monthly”
✓*
1 ~ 31Date to reset
The day of the month on which the mission group resets. If the specified value exceeds the number of days in the month, it is treated as the last day of that month. Only used when resetType is “monthly”.
* Required if resetType is “monthly”
resetDayOfWeekString Enum
enum {
  “sunday”,
  “monday”,
  “tuesday”,
  “wednesday”,
  “thursday”,
  “friday”,
  “saturday”
}
{resetType} == “weekly”
✓*
Day of the week to reset
The day of the week on which the mission group resets. Only used when resetType is “weekly”.
DefinitionDescription
“sunday”Sunday
“monday”Monday
“tuesday”Tuesday
“wednesday”Wednesday
“thursday”Thursday
“friday”Friday
“saturday”Saturday
* Required if resetType is “weekly”
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]
✓*
0 ~ 23Hour of Reset
The hour (0-23) at which the mission group resets. Used in combination with daily, weekly, or monthly reset types.
* Required if resetType is “monthly”,“weekly”,“daily”
completeNotificationNamespaceIdstring~ 1024 charsPush notifications when mission tasks are accomplished
The GS2-Gateway namespace GRN used to deliver push notifications when a mission task in this group is accomplished. Allows the game client to be notified in real-time.
anchorTimestamplong{resetType} == “days”
✓*
Base date and time for counting elapsed days
Unix time, milliseconds
* Required if resetType is “days”
daysint{resetType} == “days”
✓*
1 ~ 2147483646Number of days to reset
The interval in days between resets, counting from the anchor timestamp. Only used when resetType is “days”.
* Required if resetType is “days”

MissionTaskModel

Mission Task Model

A mission task is an entity that defines the conditions under which a reward will be given if the value of the associated counter exceeds a certain level.

Details
TypeConditionRequiredDefaultValue LimitsDescription
missionTaskIdstring
*
~ 1024 charsMission Task GRN
* Set automatically by the server
namestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
verifyCompleteTypeString Enum
enum {
  “counter”,
  “verifyActions”
}
“counter”Completion condition type
Specifies how mission task completion is determined. “counter” checks if the associated counter’s scoped value reaches the target threshold. “verifyActions” uses verify actions to check completion conditions.
DefinitionDescription
“counter”Counter
“verifyActions”Verify Actions
targetCounterTargetCounterModel{verifyCompleteType} == “counter”
✓*
Target Counter
Defines the counter, scope, and target value used to determine mission task completion. When the counter’s scoped value reaches or exceeds the specified target value, the task is considered accomplished.
* Required if verifyCompleteType is “counter”
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “verifyActions”[]0 ~ 10 itemsVerify Actions when task is accomplished
A list of verify actions used to determine if the mission task is completed. All verify actions must pass for the task to be considered accomplished. Only used when verifyCompleteType is “verifyActions”.
* Applicable only if verifyCompleteType is “verifyActions”
completeAcquireActionsList<AcquireAction>[]0 ~ 100 itemsRewards for mission accomplishment
The list of acquire actions executed as rewards when the player receives the mission completion reward.
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
Specifies the GS2-Schedule event that defines the time window during which the mission task rewards can be claimed. If not set, rewards can be received at any time after accomplishment.
premiseMissionTaskNamestring~ 128 charsName of the task that must be accomplished to attempt this task
Specifies a prerequisite mission task within the same group that must be completed before the player can receive the reward for this task. Used to create sequential mission chains.

TargetCounterModel

Target Counter

Information about the counter that serves as the achievement goal for the mission

Details
TypeConditionRequiredDefaultValue LimitsDescription
counterNamestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
scopeTypeString Enum
enum {
  “resetTiming”,
  “verifyAction”
}
“resetTiming”Scope type
Specifies which type of counter scope to use for the mission completion check. “resetTiming” evaluates the counter value for a specific reset period, while “verifyAction” evaluates the value for a named condition.
DefinitionDescription
“resetTiming”Reset timing
“verifyAction”Verify Action
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
{scopeType} == “resetTiming”Target Reset timing
Specifies which reset timing scope of the counter to check against the target value. For example, selecting “daily” means the task checks the daily counter value. If omitted, the mission group’s reset timing is used.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
* Applicable only if scopeType is “resetTiming”
conditionNamestring{scopeType} == “verifyAction”
✓*
~ 128 charsCondition Name
The name of the verify action condition scope to check against the target value. Must match a conditionName defined in the counter model’s scopes. Only used when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
valuelong
0 ~ 9223372036854775805Target value
The threshold value that the counter’s scoped value must reach or exceed for the mission task to be considered accomplished.

ScopedValue

Scoped Value

Represents a counter value within a specific scope. Each scoped value holds the accumulated count for a particular reset timing (e.g., daily, weekly, monthly) or verify action condition. When the reset timing arrives, the value is reset to zero. The counter value has an upper bound and will not exceed the maximum value even when incremented.

Details
TypeConditionRequiredDefaultValue LimitsDescription
scopeTypeString Enum
enum {
  “resetTiming”,
  “verifyAction”
}
“resetTiming”Scope type
Indicates whether this scoped value is based on a reset timing schedule or a verify action condition.
DefinitionDescription
“resetTiming”Reset timing
“verifyAction”Verify Action
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
{scopeType} == “resetTiming”
✓*
Reset timing
The reset timing for this scoped value. Determines the period over which the counter value is accumulated before being reset. Only applicable when scopeType is “resetTiming”.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
* Required if scopeType is “resetTiming”
conditionNamestring{scopeType} == “verifyAction”
✓*
~ 128 charsCondition Name
The name of the verify action condition that this scoped value corresponds to. Used to identify which condition scope this value belongs to. Only applicable when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
valuelong00 ~ 9223372036854775805Count value
The accumulated counter value for this scope. Increases when the counter is incremented and decreases when decremented. The value is capped at the maximum and will not go below zero.
nextResetAtlongNext reset timing
The timestamp at which this scoped value will be reset to zero. Calculated based on the reset type and timing settings. Null if the reset type is “notReset” or if the scope type is “verifyAction”.
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server

AcquireAction

Acquire Action

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Acquire Action
requeststring
~ 524288 charsJSON string of the request used when executing the action

ConsumeAction

Consume Action

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Consume Action
requeststring
~ 524288 charsJSON string of the request used when executing the action

VerifyAction

Verify Action

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Verify Action
requeststring
~ 524288 charsJSON string of the request used when executing the action

Config

Configuration

Set values to be applied to transaction variables

Details
TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 64 charsName
valuestring~ 51200 charsValue

VerifyActionResult

Verify Action execution result

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Verify Action
verifyRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
verifyResultstring~ 1048576 charsResult payload

ConsumeActionResult

Consume Action execution result

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Consume Action
consumeRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
consumeResultstring~ 1048576 charsResult payload

AcquireActionResult

Acquire Action execution result

Details
TypeConditionRequiredDefaultValue LimitsDescription
actionString 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 action to be executed in the Acquire Action
acquireRequeststring
~ 524288 charsJSON string of the request used when executing the action
statusCodeint0 ~ 999Status code
acquireResultstring~ 1048576 charsResult payload

TransactionResult

Transaction execution results

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

Details
TypeConditionRequiredDefaultValue LimitsDescription
transactionIdstring
36 ~ 36 charsTransaction ID
verifyResultsList<VerifyActionResult>0 ~ 10 itemsList of verify action execution results
consumeResultsList<ConsumeActionResult>[]0 ~ 10 itemsList of Consume Action execution results
acquireResultsList<AcquireActionResult>[]0 ~ 100 itemsList of Acquire Action execution results
hasErrorboolfalseWhether an error occurred during transaction execution

CurrentMissionMaster

Currently active Mission Model master data

This master data describes the definitions of Mission Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
settingsstring
~ 5242880 bytes (5MB)Master Data

CounterModelMaster

Counter Model Master

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

Counter Model is an entity that can be set as a condition for accomplishment of mission tasks. Since counter values can be referenced from multiple mission groups, a single counter can be set as an accomplishment condition for multiple mission groups, such as weekly and daily missions.

Details
TypeConditionRequiredDefaultValue LimitsDescription
counterIdstring
*
~ 1024 charsCounter Model Master GRN
* Set automatically by the server
namestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 20 itemsList of Counter reset timing
Defines the scopes (reset timings or verify action conditions) for this counter. A single counter can have multiple scopes, allowing one counter to track values across different periods (e.g., daily, weekly, and cumulative totals simultaneously).
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated
Specifies the GS2-Schedule event that defines the time window during which this counter can be incremented or decremented. If not set, the counter can be operated at any time.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

MissionGroupModelMaster

Mission Group Model Master

Mission Group Model Master is data used to edit and manage Mission Group 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 Mission Group Model actually referenced by the game.

A mission group is an entity that groups tasks by counter reset timing. For example, one group for daily missions. One group for Weekly Mission.

Details
TypeConditionRequiredDefaultValue LimitsDescription
missionGroupIdstring
*
~ 1024 charsMission Group Model Master GRN
* Set automatically by the server
namestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
“notReset”Reset timing
Determines when the mission group’s completion status is reset. Choose from: not reset (permanent), daily, weekly, monthly, or every fixed number of days from an anchor timestamp.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
resetDayOfMonthint{resetType} == “monthly”
✓*
1 ~ 31Date to reset
The day of the month on which the mission group resets. If the specified value exceeds the number of days in the month, it is treated as the last day of that month. Only used when resetType is “monthly”.
* Required if resetType is “monthly”
resetDayOfWeekString Enum
enum {
  “sunday”,
  “monday”,
  “tuesday”,
  “wednesday”,
  “thursday”,
  “friday”,
  “saturday”
}
{resetType} == “weekly”
✓*
Day of the week to reset
The day of the week on which the mission group resets. Only used when resetType is “weekly”.
DefinitionDescription
“sunday”Sunday
“monday”Monday
“tuesday”Tuesday
“wednesday”Wednesday
“thursday”Thursday
“friday”Friday
“saturday”Saturday
* Required if resetType is “weekly”
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]
✓*
0 ~ 23Hour of Reset
The hour (0-23) at which the mission group resets. Used in combination with daily, weekly, or monthly reset types.
* Required if resetType is “monthly”,“weekly”,“daily”
anchorTimestamplong{resetType} == “days”
✓*
Base date and time for counting elapsed days
Unix time, milliseconds
* Required if resetType is “days”
daysint{resetType} == “days”
✓*
1 ~ 2147483646Number of days to reset
The interval in days between resets, counting from the anchor timestamp. Only used when resetType is “days”.
* Required if resetType is “days”
completeNotificationNamespaceIdstring~ 1024 charsPush notifications when mission tasks are accomplished
The GS2-Gateway namespace GRN used to deliver push notifications when a mission task in this group is accomplished. Allows the game client to be notified in real-time.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

MissionTaskModelMaster

Mission Task Model Master

Mission Task Model Master is data used to edit and manage Mission Task 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 Mission Task Model actually referenced by the game.

A mission task is an entity that defines the conditions under which a reward will be given if the value of the associated counter exceeds a certain level.

Details
TypeConditionRequiredDefaultValue LimitsDescription
missionTaskIdstring
*
~ 1024 charsMission Task Model Master GRN
* Set automatically by the server
namestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
verifyCompleteTypeString Enum
enum {
  “counter”,
  “verifyActions”
}
“counter”Completion condition type
Specifies how mission task completion is determined. “counter” checks if the associated counter’s scoped value reaches the target threshold. “verifyActions” uses verify actions to check completion conditions.
DefinitionDescription
“counter”Counter
“verifyActions”Verify Actions
targetCounterTargetCounterModel{verifyCompleteType} == “counter”
✓*
Target Counter
Defines the counter, scope, and target value used to determine mission task completion. When the counter’s scoped value reaches or exceeds the specified target value, the task is considered accomplished.
* Required if verifyCompleteType is “counter”
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “verifyActions”0 ~ 10 itemsVerify Actions when task is accomplished
A list of verify actions used to determine if the mission task is completed. All verify actions must pass for the task to be considered accomplished. Only used when verifyCompleteType is “verifyActions”.
* Applicable only if verifyCompleteType is “verifyActions”
completeAcquireActionsList<AcquireAction>[]0 ~ 100 itemsRewards for mission accomplishment
The list of acquire actions executed as rewards when the player receives the mission completion reward.
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
Specifies the GS2-Schedule event that defines the time window during which the mission task rewards can be claimed. If not set, rewards can be received at any time after accomplishment.
premiseMissionTaskNamestring~ 128 charsName of the task that must be accomplished to attempt this task
Specifies a prerequisite mission task within the same group that must be completed before the player can receive the reward for this task. Used to create sequential mission chains.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

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

TypeConditionRequiredDefaultValue LimitsDescription
namePrefixstring~ 64 charsFilter by Namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Namespace>List of Namespaces
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeNamespacesRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSetting
Transaction Setting
Settings for distributed transactions used when granting mission completion rewards.
missionCompleteScriptScriptSettingScript to run when a mission is accomplished
Script Trigger Reference - missionComplete
counterIncrementScriptScriptSettingScript to run when the counter rises
Script Trigger Reference - counterIncrement
receiveRewardsScriptScriptSettingScript to run when a reward is received
Script Trigger Reference - receiveRewards
completeNotificationNotificationSetting
Push notifications when mission tasks are accomplished
Configures push notifications delivered via GS2-Gateway when a mission task’s completion conditions are met. This allows the game client to immediately reflect the accomplishment in the UI.
logSettingLogSettingLog Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for debugging counter increments, mission completions, and reward receipts.

Result

TypeDescription
itemNamespaceCreated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &mission.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: &mission.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
        },
        MissionCompleteScript: nil,
        CounterIncrementScript: nil,
        ReceiveRewardsScript: nil,
        CompleteNotification: nil,
        LogSetting: &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            ->withMissionCompleteScript(null)
            ->withCounterIncrementScript(null)
            ->withReceiveRewardsScript(null)
            ->withCompleteNotification(null)
            ->withLogSetting((new \Gs2\Mission\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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateNamespaceRequest;
import io.gs2.mission.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withMissionCompleteScript(null)
            .withCounterIncrementScript(null)
            .withReceiveRewardsScript(null)
            .withCompleteNotification(null)
            .withLogSetting(new io.gs2.mission.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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Mission.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
        .WithMissionCompleteScript(null)
        .WithCounterIncrementScript(null)
        .WithReceiveRewardsScript(null)
        .WithCompleteNotification(null)
        .WithLogSetting(new Gs2.Gs2Mission.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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.createNamespace(
        new Gs2Mission.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new Gs2Mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withMissionCompleteScript(null)
            .withCounterIncrementScript(null)
            .withReceiveRewardsScript(null)
            .withCompleteNotification(null)
            .withLogSetting(new Gs2Mission.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 mission

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

try:
    result = client.create_namespace(
        mission.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(
                mission.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001'))
            .with_mission_complete_script(None)
            .with_counter_increment_script(None)
            .with_receive_rewards_script(None)
            .with_complete_notification(None)
            .with_log_setting(
                mission.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('mission')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    missionCompleteScript=nil,
    counterIncrementScript=nil,
    receiveRewardsScript=nil,
    completeNotification=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('mission')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    missionCompleteScript=nil,
    counterIncrementScript=nil,
    receiveRewardsScript=nil,
    completeNotification=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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetNamespaceStatusRequest;

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

$session->open();

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

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

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

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

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

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

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

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

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetNamespaceRequest;

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

$session->open();

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

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

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

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

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

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

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

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

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

Update the settings of the specified namespace. You can change the description of the Namespace and specific settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSetting
Transaction Setting
Settings for distributed transactions used when granting mission completion rewards.
missionCompleteScriptScriptSettingScript to run when a mission is accomplished
Script Trigger Reference - missionComplete
counterIncrementScriptScriptSettingScript to run when the counter rises
Script Trigger Reference - counterIncrement
receiveRewardsScriptScriptSettingScript to run when a reward is received
Script Trigger Reference - receiveRewards
completeNotificationNotificationSetting
Push notifications when mission tasks are accomplished
Configures push notifications delivered via GS2-Gateway when a mission task’s completion conditions are met. This allows the game client to immediately reflect the accomplishment in the UI.
logSettingLogSettingLog Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for debugging counter increments, mission completions, and reward receipts.

Result

TypeDescription
itemNamespaceNamespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &mission.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: &mission.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
        },
        MissionCompleteScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
        },
        CounterIncrementScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
        },
        ReceiveRewardsScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"),
        },
        CompleteNotification: nil,
        LogSetting: &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            ->withMissionCompleteScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            ->withCounterIncrementScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            ->withReceiveRewardsScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            ->withCompleteNotification(null)
            ->withLogSetting((new \Gs2\Mission\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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateNamespaceRequest;
import io.gs2.mission.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            .withMissionCompleteScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withCounterIncrementScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withReceiveRewardsScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withCompleteNotification(null)
            .withLogSetting(new io.gs2.mission.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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Mission.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
        .WithMissionCompleteScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
        .WithCounterIncrementScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
        .WithReceiveRewardsScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
        .WithCompleteNotification(null)
        .WithLogSetting(new Gs2.Gs2Mission.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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateNamespace(
        new Gs2Mission.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            .withMissionCompleteScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withCounterIncrementScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withReceiveRewardsScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002"))
            .withCompleteNotification(null)
            .withLogSetting(new Gs2Mission.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 mission

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

try:
    result = client.update_namespace(
        mission.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(
                mission.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002'))
            .with_mission_complete_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002'))
            .with_counter_increment_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002'))
            .with_receive_rewards_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002'))
            .with_complete_notification(None)
            .with_log_setting(
                mission.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('mission')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
    },
    missionCompleteScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    counterIncrementScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    receiveRewardsScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    completeNotification=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('mission')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
    },
    missionCompleteScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    counterIncrementScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    receiveRewardsScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-0002",
    },
    completeNotification=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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceThe deleted Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteNamespaceRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeDescription
itemstringVersion

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetServiceVersionRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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 cleaning of the data associated with the specified user ID is complete

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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

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;

describeCompletes

Get a list of Completion Statuses

Retrieves a paginated list of mission completion statuses for the requesting user. Each completion status tracks which mission tasks within a mission group have been completed and which rewards have been received.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Complete>List of Completion Statuses
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCompletes(
    &mission.DescribeCompletesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCompletes(
        (new DescribeCompletesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesRequest;
import io.gs2.mission.result.DescribeCompletesResult;

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

try {
    DescribeCompletesResult result = client.describeCompletes(
        new DescribeCompletesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Complete> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesResult> asyncResult = null;
yield return client.DescribeCompletes(
    new Gs2.Gs2Mission.Request.DescribeCompletesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCompletes(
        new Gs2Mission.DescribeCompletesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_completes(
        mission.DescribeCompletesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_completes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_completes_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeCompletesByUserId

Get a list of Completion Statuses by specifying a user ID

Retrieves a paginated list of mission completion statuses for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Complete>List of Completion Statuses
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCompletesByUserId(
    &mission.DescribeCompletesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCompletesByUserId(
        (new DescribeCompletesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesByUserIdRequest;
import io.gs2.mission.result.DescribeCompletesByUserIdResult;

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

try {
    DescribeCompletesByUserIdResult result = client.describeCompletesByUserId(
        new DescribeCompletesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Complete> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesByUserIdResult> asyncResult = null;
yield return client.DescribeCompletesByUserId(
    new Gs2.Gs2Mission.Request.DescribeCompletesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCompletesByUserId(
        new Gs2Mission.DescribeCompletesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_completes_by_user_id(
        mission.DescribeCompletesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_completes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_completes_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

complete

Issue transactions to receive rewards for mission accomplishment

Verifies that the specified mission task is completed and issues a transaction containing the configured reward acquire actions. The task must be in a completed state (counter conditions met) and not yet received.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
missionTaskNamestring
~ 128 charsTask Name
Task-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
configList<Config>[]0 ~ 32 itemsSet values to be applied to transaction variables

Result

TypeDescription
transactionIdstringIssued transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Whether automatic transaction execution is enabled
atomicCommitbool?Whether to commit the transaction atomically
transactionstringIssued transaction
transactionResultTransactionResultTransaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.Complete(
    &mission.CompleteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->complete(
        (new CompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withAccessToken("accessToken-0001")
            ->withConfig(null)
    );
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteRequest;
import io.gs2.mission.result.CompleteResult;

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

try {
    CompleteResult result = client.complete(
        new CompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CompleteResult> asyncResult = null;
yield return client.Complete(
    new Gs2.Gs2Mission.Request.CompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithAccessToken("accessToken-0001")
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.complete(
        new Gs2Mission.CompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("accessToken-0001")
            .withConfig(null)
    );
    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 mission

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

try:
    result = client.complete(
        mission.CompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_access_token('accessToken-0001')
            .with_config(None)
    )
    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('mission')

api_result = client.complete({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    accessToken="accessToken-0001",
    config=nil,
})

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

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

api_result_handler = client.complete_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    accessToken="accessToken-0001",
    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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

completeByUserId

Issue transactions to receive rewards for mission accomplishment by specifying a user ID

Verifies that the specified mission task is completed and issues a transaction containing the configured reward acquire actions.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
missionTaskNamestring
~ 128 charsTask Name
Task-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
configList<Config>[]0 ~ 32 itemsSet values to be applied to transaction variables
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
transactionIdstringIssued transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Whether automatic transaction execution is enabled
atomicCommitbool?Whether to commit the transaction atomically
transactionstringIssued transaction
transactionResultTransactionResultTransaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CompleteByUserId(
    &mission.CompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->completeByUserId(
        (new CompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteByUserIdRequest;
import io.gs2.mission.result.CompleteByUserIdResult;

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

try {
    CompleteByUserIdResult result = client.completeByUserId(
        new CompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CompleteByUserIdResult> asyncResult = null;
yield return client.CompleteByUserId(
    new Gs2.Gs2Mission.Request.CompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.completeByUserId(
        new Gs2Mission.CompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    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 mission

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

try:
    result = client.complete_by_user_id(
        mission.CompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_config(None)
            .with_time_offset_token(None)
    )
    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('mission')

api_result = client.complete_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    config=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.complete_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    userId="user-0001",
    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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

batchComplete

Issue transactions to receive rewards for multiple mission tasks in bulk

Processes multiple mission task completions at once within the same mission group, issuing a combined transaction for all rewards. Each task must be in a completed state and not yet received.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
accessTokenstring
~ 128 charsAccess token
missionTaskNamesList<string>
1 ~ 100 itemsTask name list
configList<Config>[]0 ~ 32 itemsSet values to be applied to transaction variables

Result

TypeDescription
transactionIdstringIssued transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Whether automatic transaction execution is enabled
atomicCommitbool?Whether to commit the transaction atomically
transactionstringIssued transaction
transactionResultTransactionResultTransaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchComplete(
    &mission.BatchCompleteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-0002"),
        },
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchCompleteRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->batchComplete(
        (new BatchCompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken("accessToken-0001")
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            ->withConfig(null)
    );
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchCompleteRequest;
import io.gs2.mission.result.BatchCompleteResult;

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

try {
    BatchCompleteResult result = client.batchComplete(
        new BatchCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withConfig(null)
    );
    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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchCompleteResult> asyncResult = null;
yield return client.BatchComplete(
    new Gs2.Gs2Mission.Request.BatchCompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-0002",
        })
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.batchComplete(
        new Gs2Mission.BatchCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withConfig(null)
    );
    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 mission

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

try:
    result = client.batch_complete(
        mission.BatchCompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_access_token('accessToken-0001')
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_config(None)
    )
    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('mission')

api_result = client.batch_complete({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
})

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

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

api_result_handler = client.batch_complete_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

batchCompleteByUserId

Issue transactions to receive rewards for multiple mission tasks in bulk by specifying a user ID

Processes multiple mission task completions at once within the same mission group.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
userIdstring
~ 128 charsUser ID
missionTaskNamesList<string>
1 ~ 100 itemsTask name list
configList<Config>[]0 ~ 32 itemsSet values to be applied to transaction variables
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
transactionIdstringIssued transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Whether automatic transaction execution is enabled
atomicCommitbool?Whether to commit the transaction atomically
transactionstringIssued transaction
transactionResultTransactionResultTransaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchCompleteByUserId(
    &mission.BatchCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-0002"),
        },
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchCompleteByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->batchCompleteByUserId(
        (new BatchCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchCompleteByUserIdRequest;
import io.gs2.mission.result.BatchCompleteByUserIdResult;

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

try {
    BatchCompleteByUserIdResult result = client.batchCompleteByUserId(
        new BatchCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchCompleteByUserIdResult> asyncResult = null;
yield return client.BatchCompleteByUserId(
    new Gs2.Gs2Mission.Request.BatchCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-0002",
        })
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.batchCompleteByUserId(
        new Gs2Mission.BatchCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    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 mission

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

try:
    result = client.batch_complete_by_user_id(
        mission.BatchCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_config(None)
            .with_time_offset_token(None)
    )
    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('mission')

api_result = client.batch_complete_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    config=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.batch_complete_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-0002"
    },
    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
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

receiveByUserId

Receive rewards for mission accomplishment

Marks the specified mission task as received for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
missionTaskNamestring
~ 128 charsTask Name
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteReceived Completion Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ReceiveByUserId(
    &mission.ReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ReceiveByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->receiveByUserId(
        (new ReceiveByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByUserIdRequest;
import io.gs2.mission.result.ReceiveByUserIdResult;

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

try {
    ReceiveByUserIdResult result = client.receiveByUserId(
        new ReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ReceiveByUserIdResult> asyncResult = null;
yield return client.ReceiveByUserId(
    new Gs2.Gs2Mission.Request.ReceiveByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.receiveByUserId(
        new Gs2Mission.ReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.receive_by_user_id(
        mission.ReceiveByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.receive_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    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
item = result.item;
client = gs2('mission')

api_result_handler = client.receive_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    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
item = result.item;

batchReceiveByUserId

Receive rewards for multiple mission tasks in bulk

Marks multiple mission tasks as received at once within the same mission group.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
userIdstring
~ 128 charsUser ID
missionTaskNamesList<string>
1 ~ 100 itemsTask name list
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteReceived Completion Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.BatchReceiveByUserId(
    &mission.BatchReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        MissionTaskNames: []*string{
            pointy.String("mission-task-0001"),
            pointy.String("mission-task-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\BatchReceiveByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->batchReceiveByUserId(
        (new BatchReceiveByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withMissionTaskNames([
                "mission-task-0001",
                "mission-task-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.BatchReceiveByUserIdRequest;
import io.gs2.mission.result.BatchReceiveByUserIdResult;

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

try {
    BatchReceiveByUserIdResult result = client.batchReceiveByUserId(
        new BatchReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames(Arrays.asList(
                "mission-task-0001",
                "mission-task-0002"
            ))
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.BatchReceiveByUserIdResult> asyncResult = null;
yield return client.BatchReceiveByUserId(
    new Gs2.Gs2Mission.Request.BatchReceiveByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithMissionTaskNames(new string[] {
            "mission-task-0001",
            "mission-task-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.batchReceiveByUserId(
        new Gs2Mission.BatchReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withMissionTaskNames([
                "mission-task-0001",
                "mission-task-0002",
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.batch_receive_by_user_id(
        mission.BatchReceiveByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_mission_task_names([
                'mission-task-0001',
                'mission-task-0002',
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.batch_receive_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-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('mission')

api_result_handler = client.batch_receive_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    missionTaskNames={
        "mission-task-0001",
        "mission-task-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;

revertReceiveByUserId

Revert the status of mission accomplishment to unreceived

Reverts the received status of a mission task back to unreceived.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
missionTaskNamestring
~ 128 charsTask Name
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteReceived Completion Status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.RevertReceiveByUserId(
    &mission.RevertReceiveByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\RevertReceiveByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->revertReceiveByUserId(
        (new RevertReceiveByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.RevertReceiveByUserIdRequest;
import io.gs2.mission.result.RevertReceiveByUserIdResult;

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

try {
    RevertReceiveByUserIdResult result = client.revertReceiveByUserId(
        new RevertReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.RevertReceiveByUserIdResult> asyncResult = null;
yield return client.RevertReceiveByUserId(
    new Gs2.Gs2Mission.Request.RevertReceiveByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.revertReceiveByUserId(
        new Gs2Mission.RevertReceiveByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.revert_receive_by_user_id(
        mission.RevertReceiveByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.revert_receive_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    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
item = result.item;
client = gs2('mission')

api_result_handler = client.revert_receive_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    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
item = result.item;

getComplete

Get Completion Statuses

Retrieves the completion status for the specified mission group for the requesting user. The status includes lists of completed mission tasks and received mission tasks.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription
itemCompleteCompletion Statuses

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getComplete(
        (new GetCompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken("accessToken-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteRequest;
import io.gs2.mission.result.GetCompleteResult;

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

try {
    GetCompleteResult result = client.getComplete(
        new GetCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCompleteResult> asyncResult = null;
yield return client.GetComplete(
    new Gs2.Gs2Mission.Request.GetCompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getComplete(
        new Gs2Mission.GetCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_complete(
        mission.GetCompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_complete({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-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('mission')

api_result_handler = client.get_complete_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-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;

getCompleteByUserId

Get Completion Status by specifying a user ID

Retrieves the completion status for the specified mission group for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteCompletion Statuses

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCompleteByUserId(
        (new GetCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteByUserIdRequest;
import io.gs2.mission.result.GetCompleteByUserIdResult;

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

try {
    GetCompleteByUserIdResult result = client.getCompleteByUserId(
        new GetCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCompleteByUserIdResult> asyncResult = null;
yield return client.GetCompleteByUserId(
    new Gs2.Gs2Mission.Request.GetCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCompleteByUserId(
        new Gs2Mission.GetCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_complete_by_user_id(
        mission.GetCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_complete_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    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
item = result.item;
client = gs2('mission')

api_result_handler = client.get_complete_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    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
item = result.item;

evaluateComplete

Re-evaluate Completion Status

Re-evaluates all counter values against mission task conditions within the specified mission group. Use this when mission tasks are added or modified after counters have already been incremented, to determine newly completed tasks.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.

Result

TypeDescription
itemCompleteCompletion Status updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.EvaluateComplete(
    &mission.EvaluateCompleteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        MissionGroupName: pointy.String("mission-group-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\EvaluateCompleteRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->evaluateComplete(
        (new EvaluateCompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withMissionGroupName("mission-group-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.EvaluateCompleteRequest;
import io.gs2.mission.result.EvaluateCompleteResult;

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

try {
    EvaluateCompleteResult result = client.evaluateComplete(
        new EvaluateCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withMissionGroupName("mission-group-0001")
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.EvaluateCompleteResult> asyncResult = null;
yield return client.EvaluateComplete(
    new Gs2.Gs2Mission.Request.EvaluateCompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithMissionGroupName("mission-group-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.evaluateComplete(
        new Gs2Mission.EvaluateCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withMissionGroupName("mission-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.evaluate_complete(
        mission.EvaluateCompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.evaluate_complete({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    missionGroupName="mission-group-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('mission')

api_result_handler = client.evaluate_complete_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    missionGroupName="mission-group-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;

evaluateCompleteByUserId

Re-evaluate Completion Status by specifying a user ID

Re-evaluates all counter values against mission task conditions within the specified mission group. Use this when mission tasks are added or modified after counters have already been incremented.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteCompletion Status updated

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->evaluateCompleteByUserId(
        (new EvaluateCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.EvaluateCompleteByUserIdRequest;
import io.gs2.mission.result.EvaluateCompleteByUserIdResult;

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

try {
    EvaluateCompleteByUserIdResult result = client.evaluateCompleteByUserId(
        new EvaluateCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.EvaluateCompleteByUserIdResult> asyncResult = null;
yield return client.EvaluateCompleteByUserId(
    new Gs2.Gs2Mission.Request.EvaluateCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.evaluateCompleteByUserId(
        new Gs2Mission.EvaluateCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.evaluate_complete_by_user_id(
        mission.EvaluateCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_mission_group_name('mission-group-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.evaluate_complete_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.evaluate_complete_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteCompleteByUserId

Delete Completion Status

Deletes all completion status records for the specified mission group and user. This removes both completed and received status, effectively resetting the user’s progress for the mission group.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteCompletion Status deleted

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteCompleteByUserId(
        (new DeleteCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCompleteByUserIdRequest;
import io.gs2.mission.result.DeleteCompleteByUserIdResult;

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

try {
    DeleteCompleteByUserIdResult result = client.deleteCompleteByUserId(
        new DeleteCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteCompleteByUserIdResult> asyncResult = null;
yield return client.DeleteCompleteByUserId(
    new Gs2.Gs2Mission.Request.DeleteCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteCompleteByUserId(
        new Gs2Mission.DeleteCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withMissionGroupName("mission-group-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_complete_by_user_id(
        mission.DeleteCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_mission_group_name('mission-group-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_complete_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('mission')

api_result_handler = client.delete_complete_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    missionGroupName="mission-group-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

verifyComplete

Verify Completion Status

Verifies the completion or receipt status of a mission task. Supported verification types: ‘completed’ (task is completed), ’notCompleted’ (task is not completed), ‘received’ (reward received), ’notReceived’ (reward not received), ‘completedAndNotReceived’ (completed but reward not yet received).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
accessTokenstring
~ 128 charsAccess token
verifyTypeString Enum
enum {
  “completed”,
  “notCompleted”,
  “received”,
  “notReceived”,
  “completedAndNotReceived”
}
Type of verification
DefinitionDescription
“completed”Condition is achieved
“notCompleted”Condition is not achieved
“received”Reward has been received
“notReceived”Reward has not been received
“completedAndNotReceived”Condition is achieved and reward has not been received
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
multiplyValueSpecifyingQuantityboolfalseWhether to multiply the value used for verification when specifying the quantity

Result

TypeDescription
itemCompleteCompletion Status deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyComplete(
    &mission.VerifyCompleteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VerifyType: pointy.String("completed"),
        MissionTaskName: pointy.String("task-0001"),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCompleteRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->verifyComplete(
        (new VerifyCompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken("accessToken-0001")
            ->withVerifyType("completed")
            ->withMissionTaskName("task-0001")
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCompleteRequest;
import io.gs2.mission.result.VerifyCompleteResult;

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

try {
    VerifyCompleteResult result = client.verifyComplete(
        new VerifyCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCompleteResult> asyncResult = null;
yield return client.VerifyComplete(
    new Gs2.Gs2Mission.Request.VerifyCompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithAccessToken("accessToken-0001")
        .WithVerifyType("completed")
        .WithMissionTaskName("task-0001")
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.verifyComplete(
        new Gs2Mission.VerifyCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.verify_complete(
        mission.VerifyCompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_access_token('accessToken-0001')
            .with_verify_type('completed')
            .with_mission_task_name('task-0001')
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_complete({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    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('mission')

api_result_handler = client.verify_complete_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    accessToken="accessToken-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    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;

verifyCompleteByUserId

Verify Completion Status by specifying a user ID

Verifies the completion or receipt status of a mission task for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Name
The name of the mission group that this completion record belongs to. One Complete record exists per user per mission group.
userIdstring
~ 128 charsUser ID
verifyTypeString Enum
enum {
  “completed”,
  “notCompleted”,
  “received”,
  “notReceived”,
  “completedAndNotReceived”
}
Type of verification
DefinitionDescription
“completed”Condition is achieved
“notCompleted”Condition is not achieved
“received”Reward has been received
“notReceived”Reward has not been received
“completedAndNotReceived”Condition is achieved and reward has not been received
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
multiplyValueSpecifyingQuantityboolfalseWhether to multiply the value used for verification when specifying the quantity
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCompleteCompletion Status deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyCompleteByUserId(
    &mission.VerifyCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        UserId: pointy.String("user-0001"),
        VerifyType: pointy.String("completed"),
        MissionTaskName: pointy.String("task-0001"),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCompleteByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->verifyCompleteByUserId(
        (new VerifyCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withUserId("user-0001")
            ->withVerifyType("completed")
            ->withMissionTaskName("task-0001")
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCompleteByUserIdRequest;
import io.gs2.mission.result.VerifyCompleteByUserIdResult;

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

try {
    VerifyCompleteByUserIdResult result = client.verifyCompleteByUserId(
        new VerifyCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Complete 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCompleteByUserIdResult> asyncResult = null;
yield return client.VerifyCompleteByUserId(
    new Gs2.Gs2Mission.Request.VerifyCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithUserId("user-0001")
        .WithVerifyType("completed")
        .WithMissionTaskName("task-0001")
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.verifyCompleteByUserId(
        new Gs2Mission.VerifyCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withUserId("user-0001")
            .withVerifyType("completed")
            .withMissionTaskName("task-0001")
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.verify_complete_by_user_id(
        mission.VerifyCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_user_id('user-0001')
            .with_verify_type('completed')
            .with_mission_task_name('task-0001')
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_complete_by_user_id({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    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('mission')

api_result_handler = client.verify_complete_by_user_id_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    userId="user-0001",
    verifyType="completed",
    missionTaskName="task-0001",
    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;

describeCounters

Get a list of counters

Retrieves a paginated list of counters for the requesting user. Each counter contains scoped values that track progress toward mission task conditions, with values separated by reset period (daily, weekly, monthly, etc.).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Counter>List of Counter
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCounters(
    &mission.DescribeCountersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCountersRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCounters(
        (new DescribeCountersRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCountersRequest;
import io.gs2.mission.result.DescribeCountersResult;

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

try {
    DescribeCountersResult result = client.describeCounters(
        new DescribeCountersRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Counter> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCountersResult> asyncResult = null;
yield return client.DescribeCounters(
    new Gs2.Gs2Mission.Request.DescribeCountersRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCounters(
        new Gs2Mission.DescribeCountersRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_counters(
        mission.DescribeCountersRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_counters({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_counters_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeCountersByUserId

Get a list of counters by specifying a user ID

Retrieves a paginated list of counters for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Counter>List of Counter
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCountersByUserId(
    &mission.DescribeCountersByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCountersByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCountersByUserId(
        (new DescribeCountersByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCountersByUserIdRequest;
import io.gs2.mission.result.DescribeCountersByUserIdResult;

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

try {
    DescribeCountersByUserIdResult result = client.describeCountersByUserId(
        new DescribeCountersByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Counter> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCountersByUserIdResult> asyncResult = null;
yield return client.DescribeCountersByUserId(
    new Gs2.Gs2Mission.Request.DescribeCountersByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCountersByUserId(
        new Gs2Mission.DescribeCountersByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_counters_by_user_id(
        mission.DescribeCountersByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_counters_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('mission')

api_result_handler = client.describe_counters_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

increaseCounterByUserId

Increase counter by specifying a user ID

Adds the specified value to the counter for the specified user. After incrementing, all mission tasks referencing this counter are automatically re-evaluated, and any newly completed missions are returned in the changedCompletes response.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
userIdstring
~ 128 charsUser ID
valuelong
1 ~ 9223372036854775805Value to be added
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounters increased
changedCompletesList<Complete>List of updated Completion Statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.IncreaseCounterByUserId(
    &mission.IncreaseCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("quest_complete"),
        UserId: pointy.String("user-0001"),
        Value: pointy.Int64(1),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\IncreaseCounterByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->increaseCounterByUserId(
        (new IncreaseCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("quest_complete")
            ->withUserId("user-0001")
            ->withValue(1)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $changedCompletes = $result->getChangedCompletes();
} 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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.IncreaseCounterByUserIdRequest;
import io.gs2.mission.result.IncreaseCounterByUserIdResult;

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

try {
    IncreaseCounterByUserIdResult result = client.increaseCounterByUserId(
        new IncreaseCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("quest_complete")
            .withUserId("user-0001")
            .withValue(1L)
            .withTimeOffsetToken(null)
    );
    Counter item = result.getItem();
    List<Complete> changedCompletes = result.getChangedCompletes();
} 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.IncreaseCounterByUserIdResult> asyncResult = null;
yield return client.IncreaseCounterByUserId(
    new Gs2.Gs2Mission.Request.IncreaseCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("quest_complete")
        .WithUserId("user-0001")
        .WithValue(1L)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.increaseCounterByUserId(
        new Gs2Mission.IncreaseCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("quest_complete")
            .withUserId("user-0001")
            .withValue(1)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const changedCompletes = result.getChangedCompletes();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.increase_counter_by_user_id(
        mission.IncreaseCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('quest_complete')
            .with_user_id('user-0001')
            .with_value(1)
            .with_time_offset_token(None)
    )
    item = result.item
    changed_completes = result.changed_completes
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.increase_counter_by_user_id({
    namespaceName="namespace-0001",
    counterName="quest_complete",
    userId="user-0001",
    value=1,
    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;
changedCompletes = result.changedCompletes;
client = gs2('mission')

api_result_handler = client.increase_counter_by_user_id_async({
    namespaceName="namespace-0001",
    counterName="quest_complete",
    userId="user-0001",
    value=1,
    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;
changedCompletes = result.changedCompletes;

setCounterByUserId

Set counter by specifying a user ID

Sets the counter scoped values directly for the specified user, replacing existing values. Returns both the old and new counter states, as well as any newly completed missions in the changedCompletes response.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
userIdstring
~ 128 charsUser ID
valuesList<ScopedValue>0 ~ 20 itemsList of values to be set
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounters increased
oldCounterCounter after counter addition
changedCompletesList<Complete>List of updated Completion Statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.SetCounterByUserId(
    &mission.SetCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-0001"),
        UserId: pointy.String("user-0001"),
        Values: []mission.ScopedValue{
            mission.ScopedValue{
                ResetType: pointy.String("daily"),
                Value: pointy.Int64(1),
            },
            mission.ScopedValue{
                ResetType: pointy.String("weekly"),
                Value: pointy.Int64(2),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old
changedCompletes := result.ChangedCompletes
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\SetCounterByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->setCounterByUserId(
        (new SetCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-0001")
            ->withUserId("user-0001")
            ->withValues([
                (new ScopedValue())
                    ->withResetType("daily")
                    ->withValue(1),
                (new ScopedValue())
                    ->withResetType("weekly")
                    ->withValue(2),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
    $changedCompletes = $result->getChangedCompletes();
} 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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.SetCounterByUserIdRequest;
import io.gs2.mission.result.SetCounterByUserIdResult;

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

try {
    SetCounterByUserIdResult result = client.setCounterByUserId(
        new SetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withValues(Arrays.asList(
                new ScopedValue()
                    .withResetType("daily")
                    .withValue(1L),
                new ScopedValue()
                    .withResetType("weekly")
                    .withValue(2L)
            ))
            .withTimeOffsetToken(null)
    );
    Counter item = result.getItem();
    Counter old = result.getOld();
    List<Complete> changedCompletes = result.getChangedCompletes();
} 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.SetCounterByUserIdResult> asyncResult = null;
yield return client.SetCounterByUserId(
    new Gs2.Gs2Mission.Request.SetCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-0001")
        .WithUserId("user-0001")
        .WithValues(new Gs2.Gs2Mission.Model.ScopedValue[] {
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("daily")
                .WithValue(1L),
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("weekly")
                .WithValue(2L),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var changedCompletes = result.ChangedCompletes;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.setCounterByUserId(
        new Gs2Mission.SetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withValues([
                new Gs2Mission.model.ScopedValue()
                    .withResetType("daily")
                    .withValue(1),
                new Gs2Mission.model.ScopedValue()
                    .withResetType("weekly")
                    .withValue(2),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const old = result.getOld();
    const changedCompletes = result.getChangedCompletes();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.set_counter_by_user_id(
        mission.SetCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
            .with_user_id('user-0001')
            .with_values([
                mission.ScopedValue()
                    .with_reset_type('daily')
                    .with_value(1),
                mission.ScopedValue()
                    .with_reset_type('weekly')
                    .with_value(2),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
    old = result.old
    changed_completes = result.changed_completes
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.set_counter_by_user_id({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    userId="user-0001",
    values={
        {
            reset_type="daily",
            value=1,
        },
        {
            reset_type="weekly",
            value=2,
        }
    },
    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;
old = result.old;
changedCompletes = result.changedCompletes;
client = gs2('mission')

api_result_handler = client.set_counter_by_user_id_async({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    userId="user-0001",
    values={
        {
            reset_type="daily",
            value=1,
        },
        {
            reset_type="weekly",
            value=2,
        }
    },
    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;
old = result.old;
changedCompletes = result.changedCompletes;

decreaseCounter

Decrease counter

Subtracts the specified value from the counter for the requesting user. After decrementing, all mission tasks referencing this counter are automatically re-evaluated, and any missions whose completion status changed are returned in the changedCompletes response.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
accessTokenstring
~ 128 charsAccess token
valuelong
1 ~ 9223372036854775805Value to be subtracted

Result

TypeDescription
itemCounterCounters decreased
changedCompletesList<Complete>List of updated Completion Statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DecreaseCounter(
    &mission.DecreaseCounterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Value: pointy.Int64(1),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DecreaseCounterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->decreaseCounter(
        (new DecreaseCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-0001")
            ->withAccessToken("accessToken-0001")
            ->withValue(1)
    );
    $item = $result->getItem();
    $changedCompletes = $result->getChangedCompletes();
} 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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DecreaseCounterRequest;
import io.gs2.mission.result.DecreaseCounterResult;

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

try {
    DecreaseCounterResult result = client.decreaseCounter(
        new DecreaseCounterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withAccessToken("accessToken-0001")
            .withValue(1L)
    );
    Counter item = result.getItem();
    List<Complete> changedCompletes = result.getChangedCompletes();
} 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DecreaseCounterResult> asyncResult = null;
yield return client.DecreaseCounter(
    new Gs2.Gs2Mission.Request.DecreaseCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-0001")
        .WithAccessToken("accessToken-0001")
        .WithValue(1L),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.decreaseCounter(
        new Gs2Mission.DecreaseCounterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withAccessToken("accessToken-0001")
            .withValue(1)
    );
    const item = result.getItem();
    const changedCompletes = result.getChangedCompletes();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.decrease_counter(
        mission.DecreaseCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
            .with_access_token('accessToken-0001')
            .with_value(1)
    )
    item = result.item
    changed_completes = result.changed_completes
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.decrease_counter({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    accessToken="accessToken-0001",
    value=1,
})

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

result = api_result.result
item = result.item;
changedCompletes = result.changedCompletes;
client = gs2('mission')

api_result_handler = client.decrease_counter_async({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    accessToken="accessToken-0001",
    value=1,
})

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;
changedCompletes = result.changedCompletes;

decreaseCounterByUserId

Decrease counter by specifying a user ID

Subtracts the specified value from the counter for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
userIdstring
~ 128 charsUser ID
valuelong
1 ~ 9223372036854775805Value to be subtracted
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounters decreased
changedCompletesList<Complete>List of updated Completion Statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DecreaseCounterByUserId(
    &mission.DecreaseCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-0001"),
        UserId: pointy.String("user-0001"),
        Value: pointy.Int64(1),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
changedCompletes := result.ChangedCompletes
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DecreaseCounterByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->decreaseCounterByUserId(
        (new DecreaseCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-0001")
            ->withUserId("user-0001")
            ->withValue(1)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $changedCompletes = $result->getChangedCompletes();
} 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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DecreaseCounterByUserIdRequest;
import io.gs2.mission.result.DecreaseCounterByUserIdResult;

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

try {
    DecreaseCounterByUserIdResult result = client.decreaseCounterByUserId(
        new DecreaseCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withValue(1L)
            .withTimeOffsetToken(null)
    );
    Counter item = result.getItem();
    List<Complete> changedCompletes = result.getChangedCompletes();
} 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DecreaseCounterByUserIdResult> asyncResult = null;
yield return client.DecreaseCounterByUserId(
    new Gs2.Gs2Mission.Request.DecreaseCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-0001")
        .WithUserId("user-0001")
        .WithValue(1L)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var changedCompletes = result.ChangedCompletes;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.decreaseCounterByUserId(
        new Gs2Mission.DecreaseCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withValue(1)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const changedCompletes = result.getChangedCompletes();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.decrease_counter_by_user_id(
        mission.DecreaseCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
            .with_user_id('user-0001')
            .with_value(1)
            .with_time_offset_token(None)
    )
    item = result.item
    changed_completes = result.changed_completes
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.decrease_counter_by_user_id({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    userId="user-0001",
    value=1,
    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;
changedCompletes = result.changedCompletes;
client = gs2('mission')

api_result_handler = client.decrease_counter_by_user_id_async({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    userId="user-0001",
    value=1,
    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;
changedCompletes = result.changedCompletes;

getCounter

Get Counter

Retrieves the specified counter for the requesting user, including all scoped values (per reset period).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription
itemCounterCounter

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCounter(
        (new GetCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("quest_complete")
            ->withAccessToken("accessToken-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCounterRequest;
import io.gs2.mission.result.GetCounterResult;

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

try {
    GetCounterResult result = client.getCounter(
        new GetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("quest_complete")
            .withAccessToken("accessToken-0001")
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCounterResult> asyncResult = null;
yield return client.GetCounter(
    new Gs2.Gs2Mission.Request.GetCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("quest_complete")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCounter(
        new Gs2Mission.GetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("quest_complete")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_counter(
        mission.GetCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('quest_complete')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_counter({
    namespaceName="namespace-0001",
    counterName="quest_complete",
    accessToken="accessToken-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('mission')

api_result_handler = client.get_counter_async({
    namespaceName="namespace-0001",
    counterName="quest_complete",
    accessToken="accessToken-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;

getCounterByUserId

Get counter by specifying a user ID

Retrieves the specified counter for the specified user, including all scoped values.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounter

Implementation Example

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

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCounterByUserId(
        (new GetCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCounterByUserIdRequest;
import io.gs2.mission.result.GetCounterByUserIdResult;

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

try {
    GetCounterByUserIdResult result = client.getCounterByUserId(
        new GetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCounterByUserIdResult> asyncResult = null;
yield return client.GetCounterByUserId(
    new Gs2.Gs2Mission.Request.GetCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCounterByUserId(
        new Gs2Mission.GetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_counter_by_user_id(
        mission.GetCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_counter_by_user_id({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    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
item = result.item;
client = gs2('mission')

api_result_handler = client.get_counter_by_user_id_async({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    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
item = result.item;

verifyCounterValue

Verify counter value

Verifies that a counter’s scoped value meets the specified condition. Supported verification types: ’less’, ’lessEqual’, ‘greater’, ‘greaterEqual’, ’equal’, ’notEqual’. The verification targets a specific scope (reset type and condition) of the counter.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
verifyTypeString Enum
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Counter value is less than the specified value
“lessEqual”Counter value is less than or equal to the specified value
“greater”Counter value is greater than the specified value
“greaterEqual”Counter value is greater than or equal to the specified value
“equal”Counter value is equal to the specified value
“notEqual”Counter value is not equal to the specified value
scopeTypeString Enum
enum {
  “resetTiming”,
  “verifyAction”
}
“resetTiming”Scope type
Indicates whether this scoped value is based on a reset timing schedule or a verify action condition.
DefinitionDescription
“resetTiming”Reset timing
“verifyAction”Verify Action
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
{scopeType} == “resetTiming”
✓*
Reset timing
The reset timing for this scoped value. Determines the period over which the counter value is accumulated before being reset. Only applicable when scopeType is “resetTiming”.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
* Required if scopeType is “resetTiming”
conditionNamestring{scopeType} == “verifyAction”
✓*
~ 128 charsCondition Name
The name of the verify action condition that this scoped value corresponds to. Used to identify which condition scope this value belongs to. Only applicable when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
valuelong00 ~ 9223372036854775805Count value
The accumulated counter value for this scope. Increases when the counter is incremented and decreases when decremented. The value is capped at the maximum and will not go below zero.
multiplyValueSpecifyingQuantityboolfalseWhether to multiply the value used for verification when specifying the quantity

Result

TypeDescription
itemCounterCounter

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyCounterValue(
    &mission.VerifyCounterValueRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        CounterName: pointy.String("counter-0001"),
        VerifyType: pointy.String("less"),
        ScopeType: nil,
        ResetType: pointy.String("daily"),
        ConditionName: nil,
        Value: pointy.Int64(10),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCounterValueRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->verifyCounterValue(
        (new VerifyCounterValueRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withCounterName("counter-0001")
            ->withVerifyType("less")
            ->withScopeType(null)
            ->withResetType("daily")
            ->withConditionName(null)
            ->withValue(10)
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCounterValueRequest;
import io.gs2.mission.result.VerifyCounterValueResult;

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

try {
    VerifyCounterValueResult result = client.verifyCounterValue(
        new VerifyCounterValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
            .withVerifyType("less")
            .withScopeType(null)
            .withResetType("daily")
            .withConditionName(null)
            .withValue(10L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCounterValueResult> asyncResult = null;
yield return client.VerifyCounterValue(
    new Gs2.Gs2Mission.Request.VerifyCounterValueRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithCounterName("counter-0001")
        .WithVerifyType("less")
        .WithScopeType(null)
        .WithResetType("daily")
        .WithConditionName(null)
        .WithValue(10L)
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.verifyCounterValue(
        new Gs2Mission.VerifyCounterValueRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
            .withVerifyType("less")
            .withScopeType(null)
            .withResetType("daily")
            .withConditionName(null)
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.verify_counter_value(
        mission.VerifyCounterValueRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_counter_name('counter-0001')
            .with_verify_type('less')
            .with_scope_type(None)
            .with_reset_type('daily')
            .with_condition_name(None)
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_counter_value({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-0001",
    verifyType="less",
    scopeType=nil,
    resetType="daily",
    conditionName=nil,
    value=10,
    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('mission')

api_result_handler = client.verify_counter_value_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-0001",
    verifyType="less",
    scopeType=nil,
    resetType="daily",
    conditionName=nil,
    value=10,
    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;

verifyCounterValueByUserId

Verify counter value by specifying a user ID

Verifies that a counter’s scoped value meets the specified condition for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
verifyTypeString Enum
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Counter value is less than the specified value
“lessEqual”Counter value is less than or equal to the specified value
“greater”Counter value is greater than the specified value
“greaterEqual”Counter value is greater than or equal to the specified value
“equal”Counter value is equal to the specified value
“notEqual”Counter value is not equal to the specified value
scopeTypeString Enum
enum {
  “resetTiming”,
  “verifyAction”
}
“resetTiming”Scope type
Indicates whether this scoped value is based on a reset timing schedule or a verify action condition.
DefinitionDescription
“resetTiming”Reset timing
“verifyAction”Verify Action
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
{scopeType} == “resetTiming”
✓*
Reset timing
The reset timing for this scoped value. Determines the period over which the counter value is accumulated before being reset. Only applicable when scopeType is “resetTiming”.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
* Required if scopeType is “resetTiming”
conditionNamestring{scopeType} == “verifyAction”
✓*
~ 128 charsCondition Name
The name of the verify action condition that this scoped value corresponds to. Used to identify which condition scope this value belongs to. Only applicable when scopeType is “verifyAction”.
* Required if scopeType is “verifyAction”
valuelong00 ~ 9223372036854775805Count value
The accumulated counter value for this scope. Increases when the counter is incremented and decreases when decremented. The value is capped at the maximum and will not go below zero.
multiplyValueSpecifyingQuantityboolfalseWhether to multiply the value used for verification when specifying the quantity
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounter

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.VerifyCounterValueByUserId(
    &mission.VerifyCounterValueByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("counter-0001"),
        VerifyType: pointy.String("less"),
        ScopeType: nil,
        ResetType: pointy.String("daily"),
        ConditionName: nil,
        Value: pointy.Int64(10),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\VerifyCounterValueByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->verifyCounterValueByUserId(
        (new VerifyCounterValueByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withCounterName("counter-0001")
            ->withVerifyType("less")
            ->withScopeType(null)
            ->withResetType("daily")
            ->withConditionName(null)
            ->withValue(10)
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.VerifyCounterValueByUserIdRequest;
import io.gs2.mission.result.VerifyCounterValueByUserIdResult;

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

try {
    VerifyCounterValueByUserIdResult result = client.verifyCounterValueByUserId(
        new VerifyCounterValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("counter-0001")
            .withVerifyType("less")
            .withScopeType(null)
            .withResetType("daily")
            .withConditionName(null)
            .withValue(10L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.VerifyCounterValueByUserIdResult> asyncResult = null;
yield return client.VerifyCounterValueByUserId(
    new Gs2.Gs2Mission.Request.VerifyCounterValueByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithCounterName("counter-0001")
        .WithVerifyType("less")
        .WithScopeType(null)
        .WithResetType("daily")
        .WithConditionName(null)
        .WithValue(10L)
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.verifyCounterValueByUserId(
        new Gs2Mission.VerifyCounterValueByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("counter-0001")
            .withVerifyType("less")
            .withScopeType(null)
            .withResetType("daily")
            .withConditionName(null)
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.verify_counter_value_by_user_id(
        mission.VerifyCounterValueByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_counter_name('counter-0001')
            .with_verify_type('less')
            .with_scope_type(None)
            .with_reset_type('daily')
            .with_condition_name(None)
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.verify_counter_value_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="counter-0001",
    verifyType="less",
    scopeType=nil,
    resetType="daily",
    conditionName=nil,
    value=10,
    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('mission')

api_result_handler = client.verify_counter_value_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="counter-0001",
    verifyType="less",
    scopeType=nil,
    resetType="daily",
    conditionName=nil,
    value=10,
    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;

resetCounter

Reset counter

Resets the counter values for the specified scopes. Only the scoped values matching the specified scope types are reset; other scoped values remain unchanged.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
scopesList<ScopedValue>
1 ~ 20 itemsList of scopes

Result

TypeDescription
itemCounterCounter deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ResetCounter(
    &mission.ResetCounterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        CounterName: pointy.String("counter-0001"),
        Scopes: []mission.ScopedValue{
            mission.ScopedValue{
                ResetType: pointy.String("daily"),
            },
            mission.ScopedValue{
                ResetType: pointy.String("weekly"),
            },
        },
    }
)
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ResetCounterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->resetCounter(
        (new ResetCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withCounterName("counter-0001")
            ->withScopes([
                (new ScopedValue())
                    ->withResetType("daily"),
                (new ScopedValue())
                    ->withResetType("weekly"),
            ])
    );
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ResetCounterRequest;
import io.gs2.mission.result.ResetCounterResult;

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

try {
    ResetCounterResult result = client.resetCounter(
        new ResetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
            .withScopes(Arrays.asList(
                new ScopedValue()
                    .withResetType("daily"),
                new ScopedValue()
                    .withResetType("weekly")
            ))
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ResetCounterResult> asyncResult = null;
yield return client.ResetCounter(
    new Gs2.Gs2Mission.Request.ResetCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithCounterName("counter-0001")
        .WithScopes(new Gs2.Gs2Mission.Model.ScopedValue[] {
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("daily"),
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("weekly"),
        }),
    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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.resetCounter(
        new Gs2Mission.ResetCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
            .withScopes([
                new Gs2Mission.model.ScopedValue()
                    .withResetType("daily"),
                new Gs2Mission.model.ScopedValue()
                    .withResetType("weekly"),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.reset_counter(
        mission.ResetCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_counter_name('counter-0001')
            .with_scopes([
                mission.ScopedValue()
                    .with_reset_type('daily'),
                mission.ScopedValue()
                    .with_reset_type('weekly'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.reset_counter({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-0001",
    scopes={
        {
            reset_type="daily",
        },
        {
            reset_type="weekly",
        }
    },
})

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

api_result_handler = client.reset_counter_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-0001",
    scopes={
        {
            reset_type="daily",
        },
        {
            reset_type="weekly",
        }
    },
})

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;

resetCounterByUserId

Reset counter by specifying a user ID

Resets the counter values for the specified scopes for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
scopesList<ScopedValue>
1 ~ 20 itemsList of scopes
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounter deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ResetCounterByUserId(
    &mission.ResetCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("counter-0001"),
        Scopes: []mission.ScopedValue{
            mission.ScopedValue{
                ResetType: pointy.String("daily"),
            },
            mission.ScopedValue{
                ResetType: pointy.String("weekly"),
            },
        },
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ResetCounterByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->resetCounterByUserId(
        (new ResetCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withCounterName("counter-0001")
            ->withScopes([
                (new ScopedValue())
                    ->withResetType("daily"),
                (new ScopedValue())
                    ->withResetType("weekly"),
            ])
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ResetCounterByUserIdRequest;
import io.gs2.mission.result.ResetCounterByUserIdResult;

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

try {
    ResetCounterByUserIdResult result = client.resetCounterByUserId(
        new ResetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("counter-0001")
            .withScopes(Arrays.asList(
                new ScopedValue()
                    .withResetType("daily"),
                new ScopedValue()
                    .withResetType("weekly")
            ))
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ResetCounterByUserIdResult> asyncResult = null;
yield return client.ResetCounterByUserId(
    new Gs2.Gs2Mission.Request.ResetCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithCounterName("counter-0001")
        .WithScopes(new Gs2.Gs2Mission.Model.ScopedValue[] {
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("daily"),
            new Gs2.Gs2Mission.Model.ScopedValue()
                .WithResetType("weekly"),
        })
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.resetCounterByUserId(
        new Gs2Mission.ResetCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("counter-0001")
            .withScopes([
                new Gs2Mission.model.ScopedValue()
                    .withResetType("daily"),
                new Gs2Mission.model.ScopedValue()
                    .withResetType("weekly"),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.reset_counter_by_user_id(
        mission.ResetCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_counter_name('counter-0001')
            .with_scopes([
                mission.ScopedValue()
                    .with_reset_type('daily'),
                mission.ScopedValue()
                    .with_reset_type('weekly'),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.reset_counter_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="counter-0001",
    scopes={
        {
            reset_type="daily",
        },
        {
            reset_type="weekly",
        }
    },
    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('mission')

api_result_handler = client.reset_counter_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="counter-0001",
    scopes={
        {
            reset_type="daily",
        },
        {
            reset_type="weekly",
        }
    },
    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;

deleteCounter

Delete counters

Deletes the specified counter and all its scoped values for the requesting user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.

Result

TypeDescription
itemCounterCounter deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteCounter(
    &mission.DeleteCounterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCounterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteCounter(
        (new DeleteCounterRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCounterRequest;
import io.gs2.mission.result.DeleteCounterResult;

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

try {
    DeleteCounterResult result = client.deleteCounter(
        new DeleteCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteCounterResult> asyncResult = null;
yield return client.DeleteCounter(
    new Gs2.Gs2Mission.Request.DeleteCounterRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteCounter(
        new Gs2Mission.DeleteCounterRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withCounterName("counter-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_counter(
        mission.DeleteCounterRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_counter_name('counter-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_counter({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-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('mission')

api_result_handler = client.delete_counter_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    counterName="counter-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;

deleteCounterByUserId

Delete counters by specifying a user ID

Deletes the specified counter and all its scoped values for the specified user.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
counterNamestring
~ 128 charsCounter Model name
The name of the Counter Model that this counter instance is based on. Links to the counter model definition that specifies the scopes and reset timings.
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemCounterCounter deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteCounterByUserId(
    &mission.DeleteCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("quest_complete"),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCounterByUserIdRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteCounterByUserId(
        (new DeleteCounterByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withCounterName("quest_complete")
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCounterByUserIdRequest;
import io.gs2.mission.result.DeleteCounterByUserIdResult;

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

try {
    DeleteCounterByUserIdResult result = client.deleteCounterByUserId(
        new DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("quest_complete")
            .withTimeOffsetToken(null)
    );
    Counter 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteCounterByUserIdResult> asyncResult = null;
yield return client.DeleteCounterByUserId(
    new Gs2.Gs2Mission.Request.DeleteCounterByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithCounterName("quest_complete")
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteCounterByUserId(
        new Gs2Mission.DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withCounterName("quest_complete")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_counter_by_user_id(
        mission.DeleteCounterByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_counter_name('quest_complete')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_counter_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="quest_complete",
    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('mission')

api_result_handler = client.delete_counter_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    counterName="quest_complete",
    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;

describeCounterModels

Get a list of Counter Models

Retrieves the list of currently active counter models for the specified namespace. Counter models define the scopes (reset timing such as daily, weekly, monthly) and conditions under which counters operate.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<CounterModel>List of Counter Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCounterModels(
    &mission.DescribeCounterModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCounterModelsRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCounterModels(
        (new DescribeCounterModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCounterModelsRequest;
import io.gs2.mission.result.DescribeCounterModelsResult;

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

try {
    DescribeCounterModelsResult result = client.describeCounterModels(
        new DescribeCounterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<CounterModel> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCounterModelsResult> asyncResult = null;
yield return client.DescribeCounterModels(
    new Gs2.Gs2Mission.Request.DescribeCounterModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCounterModels(
        new Gs2Mission.DescribeCounterModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_counter_models(
        mission.DescribeCounterModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_counter_models({
    namespaceName="namespace-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('mission')

api_result_handler = client.describe_counter_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getCounterModel

Get Counter Model

Retrieves the specified counter model, including its scopes, reset conditions, and challenge period event configuration.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCounterModelCounter Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetCounterModel(
    &mission.GetCounterModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCounterModelRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCounterModel(
        (new GetCounterModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCounterModelRequest;
import io.gs2.mission.result.GetCounterModelResult;

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

try {
    GetCounterModelResult result = client.getCounterModel(
        new GetCounterModelRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    CounterModel 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCounterModelResult> asyncResult = null;
yield return client.GetCounterModel(
    new Gs2.Gs2Mission.Request.GetCounterModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCounterModel(
        new Gs2Mission.GetCounterModelRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_counter_model(
        mission.GetCounterModelRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_counter_model({
    namespaceName="namespace-0001",
    counterName="counter-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('mission')

api_result_handler = client.get_counter_model_async({
    namespaceName="namespace-0001",
    counterName="counter-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;

describeMissionGroupModels

Get a list of Mission Group Models

Retrieves the list of currently active mission group models for the specified namespace. Mission group models define groups of mission tasks with a common reset type (daily, weekly, monthly, or none).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<MissionGroupModel>List of Mission Group Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeMissionGroupModels(
    &mission.DescribeMissionGroupModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionGroupModelsRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeMissionGroupModels(
        (new DescribeMissionGroupModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionGroupModelsRequest;
import io.gs2.mission.result.DescribeMissionGroupModelsResult;

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

try {
    DescribeMissionGroupModelsResult result = client.describeMissionGroupModels(
        new DescribeMissionGroupModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<MissionGroupModel> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeMissionGroupModelsResult> asyncResult = null;
yield return client.DescribeMissionGroupModels(
    new Gs2.Gs2Mission.Request.DescribeMissionGroupModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeMissionGroupModels(
        new Gs2Mission.DescribeMissionGroupModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_mission_group_models(
        mission.DescribeMissionGroupModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_mission_group_models({
    namespaceName="namespace-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('mission')

api_result_handler = client.describe_mission_group_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getMissionGroupModel

Get Mission Group Model

Retrieves the specified mission group model, including its reset type, reset timing settings, and the list of mission tasks it contains.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionGroupModelMission Group Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetMissionGroupModel(
    &mission.GetMissionGroupModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetMissionGroupModelRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getMissionGroupModel(
        (new GetMissionGroupModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetMissionGroupModelRequest;
import io.gs2.mission.result.GetMissionGroupModelResult;

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

try {
    GetMissionGroupModelResult result = client.getMissionGroupModel(
        new GetMissionGroupModelRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    MissionGroupModel 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetMissionGroupModelResult> asyncResult = null;
yield return client.GetMissionGroupModel(
    new Gs2.Gs2Mission.Request.GetMissionGroupModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getMissionGroupModel(
        new Gs2Mission.GetMissionGroupModelRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_mission_group_model(
        mission.GetMissionGroupModelRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_mission_group_model({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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('mission')

api_result_handler = client.get_mission_group_model_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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;

describeMissionTaskModels

Get a list of Mission Task Models

Retrieves the list of currently active mission task models within the specified mission group. Mission task models define individual tasks with target counter conditions, completion verification types, and reward actions.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<MissionTaskModel>List of Mission Task Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeMissionTaskModels(
    &mission.DescribeMissionTaskModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
    }
)
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionTaskModelsRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeMissionTaskModels(
        (new DescribeMissionTaskModelsRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionTaskModelsRequest;
import io.gs2.mission.result.DescribeMissionTaskModelsResult;

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

try {
    DescribeMissionTaskModelsResult result = client.describeMissionTaskModels(
        new DescribeMissionTaskModelsRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    List<MissionTaskModel> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeMissionTaskModelsResult> asyncResult = null;
yield return client.DescribeMissionTaskModels(
    new Gs2.Gs2Mission.Request.DescribeMissionTaskModelsRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeMissionTaskModels(
        new Gs2Mission.DescribeMissionTaskModelsRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.describe_mission_task_models(
        mission.DescribeMissionTaskModelsRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.describe_mission_task_models({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('mission')

api_result_handler = client.describe_mission_task_models_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getMissionTaskModel

Get Mission Task Model

Retrieves the specified mission task model, including its target counter, completion verification type, reward acquire actions, and prerequisite mission task configuration.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionTaskModelMission Task Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetMissionTaskModel(
    &mission.GetMissionTaskModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetMissionTaskModelRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getMissionTaskModel(
        (new GetMissionTaskModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetMissionTaskModelRequest;
import io.gs2.mission.result.GetMissionTaskModelResult;

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

try {
    GetMissionTaskModelResult result = client.getMissionTaskModel(
        new GetMissionTaskModelRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    MissionTaskModel 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetMissionTaskModelResult> asyncResult = null;
yield return client.GetMissionTaskModel(
    new Gs2.Gs2Mission.Request.GetMissionTaskModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getMissionTaskModel(
        new Gs2Mission.GetMissionTaskModelRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_mission_task_model(
        mission.GetMissionTaskModelRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_mission_task_model({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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('mission')

api_result_handler = client.get_mission_task_model_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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 Mission Model Master in a master data format that can be activated

Exports the currently active mission group models, mission task models, and counter models in a format suitable for activation. The exported data can be used to update master data in another namespace or stored as a backup.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentMissionMasterMission Model Master data that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ExportMasterRequest;
import io.gs2.mission.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentMissionMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Mission.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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.exportMaster(
        new Gs2Mission.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.export_master(
        mission.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

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

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;

getCurrentMissionMaster

Get currently active Mission Model master data

Retrieves the currently active mission model master data for the specified namespace, including mission group models, mission task models, and counter models.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentMissionMasterCurrently active Mission Model master data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetCurrentMissionMaster(
    &mission.GetCurrentMissionMasterRequest {
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCurrentMissionMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCurrentMissionMaster(
        (new GetCurrentMissionMasterRequest())
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCurrentMissionMasterRequest;
import io.gs2.mission.result.GetCurrentMissionMasterResult;

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

try {
    GetCurrentMissionMasterResult result = client.getCurrentMissionMaster(
        new GetCurrentMissionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentMissionMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCurrentMissionMasterResult> asyncResult = null;
yield return client.GetCurrentMissionMaster(
    new Gs2.Gs2Mission.Request.GetCurrentMissionMasterRequest()
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCurrentMissionMaster(
        new Gs2Mission.GetCurrentMissionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_current_mission_master(
        mission.GetCurrentMissionMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_current_mission_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('mission')

api_result_handler = client.get_current_mission_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;

preUpdateCurrentMissionMaster

Update currently active Mission 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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentMissionMaster(
    &mission.PreUpdateCurrentMissionMasterRequest {
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\PreUpdateCurrentMissionMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentMissionMaster(
        (new PreUpdateCurrentMissionMasterRequest())
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.PreUpdateCurrentMissionMasterRequest;
import io.gs2.mission.result.PreUpdateCurrentMissionMasterResult;

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

try {
    PreUpdateCurrentMissionMasterResult result = client.preUpdateCurrentMissionMaster(
        new PreUpdateCurrentMissionMasterRequest()
            .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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.PreUpdateCurrentMissionMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentMissionMaster(
    new Gs2.Gs2Mission.Request.PreUpdateCurrentMissionMasterRequest()
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.preUpdateCurrentMissionMaster(
        new Gs2Mission.PreUpdateCurrentMissionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.pre_update_current_mission_master(
        mission.PreUpdateCurrentMissionMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.pre_update_current_mission_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('mission')

api_result_handler = client.pre_update_current_mission_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;

updateCurrentMissionMaster

Update currently active Mission Model master data

Updates the currently active mission model master data. Supports two modes: ‘direct’ for inline settings, and ‘preUpload’ for applying settings previously uploaded via the 3-phase update process.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

TypeDescription
itemCurrentMissionMasterUpdated master data of the currently active Mission Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentMissionMaster(
    &mission.UpdateCurrentMissionMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}"),
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateCurrentMissionMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateCurrentMissionMaster(
        (new UpdateCurrentMissionMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateCurrentMissionMasterRequest;
import io.gs2.mission.result.UpdateCurrentMissionMasterResult;

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

try {
    UpdateCurrentMissionMasterResult result = client.updateCurrentMissionMaster(
        new UpdateCurrentMissionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentMissionMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateCurrentMissionMasterResult> asyncResult = null;
yield return client.UpdateCurrentMissionMaster(
    new Gs2.Gs2Mission.Request.UpdateCurrentMissionMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateCurrentMissionMaster(
        new Gs2Mission.UpdateCurrentMissionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.update_current_mission_master(
        mission.UpdateCurrentMissionMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-05-28",\n  "groups": [\n    {\n      "name": "daily",\n      "metadata": "DAILY",\n      "tasks": [\n        {\n          "name": "quest_x10",\n          "metadata": "QUEST_X10",\n          "counterName": "quest_complete",\n          "targetValue": 10,\n          "completeAcquireActions": [\n            {\n              "action": "Gs2Experience:AddExperienceByUserId",\n              "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"\n            }\n          ]\n        },\n        {\n          "name": "quest_x20",\n          "metadata": "QUEST_X20",\n          "counterName": "quest_complete",\n          "premiseMissionTaskName": "quest_x10",\n          "targetValue": 20,\n          "completeAcquireActions": [\n            {\n              "action": "Gs2Experience:AddExperienceByUserId",\n              "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"\n            }\n          ]\n        },\n        {\n          "name": "gacha",\n          "metadata": "GACHA",\n          "counterName": "lot_gacha",\n          "targetValue": 1,\n          "completeAcquireActions": [\n            {\n              "action": "Gs2Experience:AddExperienceByUserId",\n              "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 30}"\n            }\n          ]\n        }\n      ],\n      "resetType": "daily",\n      "resetHour": 10\n    },\n    {\n      "name": "weekly",\n      "metadata": "WEEKLY",\n      "tasks": [\n        {\n          "name": "quest_x100",\n          "metadata": "QUEST_X100",\n          "counterName": "quest_complete",\n          "targetValue": 100,\n          "completeAcquireActions": [\n            {\n              "action": "Gs2Experience:AddExperienceByUserId",\n              "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 40}"\n            }\n          ]\n        },\n        {\n          "name": "quest_x1000",\n          "metadata": "QUEST_X1000",\n          "counterName": "quest_complete",\n          "premiseMissionTaskName": "quest_x100",\n          "targetValue": 1000,\n          "completeAcquireActions": [\n            {\n              "action": "Gs2Experience:AddExperienceByUserId",\n              "request": "{\\"experienceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceModelName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 50}"\n            }\n          ]\n        }\n      ],\n      "resetType": "weekly",\n      "resetDayOfWeek": "monday",\n      "resetHour": 10\n    },\n    {\n      "name": "story",\n      "metadata": "STORY",\n      "tasks": [\n        {\n          "name": "quest_1-1",\n          "metadata": "QUEST_1-1",\n          "counterName": "quest1",\n          "targetValue": 1\n        },\n        {\n          "name": "quest_1-2",\n          "metadata": "QUEST_1-2",\n          "counterName": "quest1",\n          "premiseMissionTaskName": "quest_1-1",\n          "targetValue": 1\n        },\n        {\n          "name": "quest_1-3",\n          "metadata": "QUEST_1-3",\n          "counterName": "quest1",\n          "premiseMissionTaskName": "quest_1-2",\n          "targetValue": 1\n        },\n        {\n          "name": "quest_1-4",\n          "metadata": "QUEST_1-4",\n          "counterName": "quest1",\n          "premiseMissionTaskName": "quest_1-3",\n          "targetValue": 1\n        },\n        {\n          "name": "quest_2-1",\n          "metadata": "QUEST_2-1",\n          "counterName": "quest2",\n          "premiseMissionTaskName": "quest_1-4",\n          "targetValue": 1\n        }\n      ],\n      "resetType": "notReset"\n    }\n  ],\n  "counters": [\n    {\n      "name": "quest_complete",\n      "metadata": "QUEST_COMPLETE",\n      "scopes": [\n        {\n          "resetType": "daily",\n          "resetHour": 5\n        },\n        {\n          "resetType": "weekly",\n          "resetDayOfWeek": "monday",\n          "resetHour": 5\n        }\n      ]\n    },\n    {\n      "name": "lot_gacha",\n      "metadata": "LOT_GACHA",\n      "scopes": [\n        {\n          "resetType": "daily",\n          "resetHour": 5\n        }\n      ]\n    },\n    {\n      "name": "quest1",\n      "metadata": "QUEST1",\n      "scopes": [\n        {\n          "resetType": "notReset"\n        }\n      ]\n    },\n    {\n      "name": "quest2",\n      "metadata": "QUEST2",\n      "scopes": [\n        {\n          "resetType": "notReset"\n        }\n      ]\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.update_current_mission_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}",
    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('mission')

api_result_handler = client.update_current_mission_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}",
    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;

updateCurrentMissionMasterFromGitHub

Update currently active Mission Model master data from GitHub

Updates the currently active mission model master data by fetching it from a specified GitHub repository. The API key stored in GS2-Key is used for authentication, and you can specify the branch, tag, or commit hash to checkout.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSettingGitHubCheckoutSetting
Setup to check out master data from GitHub

Result

TypeDescription
itemCurrentMissionMasterUpdated master data of the currently active Mission Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentMissionMasterFromGitHub(
    &mission.UpdateCurrentMissionMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &mission.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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateCurrentMissionMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateCurrentMissionMasterFromGitHub(
        (new UpdateCurrentMissionMasterFromGitHubRequest())
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateCurrentMissionMasterFromGitHubRequest;
import io.gs2.mission.result.UpdateCurrentMissionMasterFromGitHubResult;

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

try {
    UpdateCurrentMissionMasterFromGitHubResult result = client.updateCurrentMissionMasterFromGitHub(
        new UpdateCurrentMissionMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentMissionMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateCurrentMissionMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentMissionMasterFromGitHub(
    new Gs2.Gs2Mission.Request.UpdateCurrentMissionMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Mission.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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateCurrentMissionMasterFromGitHub(
        new Gs2Mission.UpdateCurrentMissionMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Mission.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 mission

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

try:
    result = client.update_current_mission_master_from_git_hub(
        mission.UpdateCurrentMissionMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(mission.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('mission')

api_result = client.update_current_mission_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('mission')

api_result_handler = client.update_current_mission_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;

describeCounterModelMasters

Get a list of Counter Model Masters

Retrieves a paginated list of counter model masters for the specified namespace. Can optionally filter by name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by Counter Model name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<CounterModelMaster>List of Counter Model Masters
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCounterModelMasters(
    &mission.DescribeCounterModelMastersRequest {
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCounterModelMastersRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeCounterModelMasters(
        (new DescribeCounterModelMastersRequest())
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCounterModelMastersRequest;
import io.gs2.mission.result.DescribeCounterModelMastersResult;

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

try {
    DescribeCounterModelMastersResult result = client.describeCounterModelMasters(
        new DescribeCounterModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<CounterModelMaster> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeCounterModelMastersResult> asyncResult = null;
yield return client.DescribeCounterModelMasters(
    new Gs2.Gs2Mission.Request.DescribeCounterModelMastersRequest()
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeCounterModelMasters(
        new Gs2Mission.DescribeCounterModelMastersRequest()
            .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 mission

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

try:
    result = client.describe_counter_model_masters(
        mission.DescribeCounterModelMastersRequest()
            .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('mission')

api_result = client.describe_counter_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('mission')

api_result_handler = client.describe_counter_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;

createCounterModelMaster

Create a new Counter Model Master

Creates a new counter model master with the specified configuration. You can configure scopes that define reset conditions (daily, weekly, monthly, or custom) and a challenge period event to control when the counter is active.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 20 itemsList of Counter reset timing
Defines the scopes (reset timings or verify action conditions) for this counter. A single counter can have multiple scopes, allowing one counter to track values across different periods (e.g., daily, weekly, and cumulative totals simultaneously).
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated

Result

TypeDescription
itemCounterModelMasterCounter Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CreateCounterModelMaster(
    &mission.CreateCounterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("counter-0001"),
        Metadata: nil,
        Description: nil,
        Scopes: []mission.CounterScopeModel{
            mission.CounterScopeModel{
                ResetType: pointy.String("notReset"),
            },
        },
        ChallengePeriodEventId: 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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateCounterModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->createCounterModelMaster(
        (new CreateCounterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("counter-0001")
            ->withMetadata(null)
            ->withDescription(null)
            ->withScopes([
                (new \Gs2\Mission\Model\CounterScopeModel())
                    ->withResetType("notReset"),
            ])
            ->withChallengePeriodEventId(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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateCounterModelMasterRequest;
import io.gs2.mission.result.CreateCounterModelMasterResult;

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

try {
    CreateCounterModelMasterResult result = client.createCounterModelMaster(
        new CreateCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("counter-0001")
            .withMetadata(null)
            .withDescription(null)
            .withScopes(Arrays.asList(
                new io.gs2.mission.model.CounterScopeModel()
                    .withResetType("notReset")
            ))
            .withChallengePeriodEventId(null)
    );
    CounterModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CreateCounterModelMasterResult> asyncResult = null;
yield return client.CreateCounterModelMaster(
    new Gs2.Gs2Mission.Request.CreateCounterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("counter-0001")
        .WithMetadata(null)
        .WithDescription(null)
        .WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
            new Gs2.Gs2Mission.Model.CounterScopeModel()
                .WithResetType("notReset"),
        })
        .WithChallengePeriodEventId(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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.createCounterModelMaster(
        new Gs2Mission.CreateCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("counter-0001")
            .withMetadata(null)
            .withDescription(null)
            .withScopes([
                new Gs2Mission.model.CounterScopeModel()
                    .withResetType("notReset"),
            ])
            .withChallengePeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.create_counter_model_master(
        mission.CreateCounterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('counter-0001')
            .with_metadata(None)
            .with_description(None)
            .with_scopes([
                mission.CounterScopeModel()
                    .with_reset_type('notReset'),
            ])
            .with_challenge_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.create_counter_model_master({
    namespaceName="namespace-0001",
    name="counter-0001",
    metadata=nil,
    description=nil,
    scopes={
        {
            resetType="notReset",
        }
    },
    challengePeriodEventId=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('mission')

api_result_handler = client.create_counter_model_master_async({
    namespaceName="namespace-0001",
    name="counter-0001",
    metadata=nil,
    description=nil,
    scopes={
        {
            resetType="notReset",
        }
    },
    challengePeriodEventId=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;

getCounterModelMaster

Get Counter Model Master

Retrieves the specified counter model master, including its scopes, reset conditions, and challenge period event configuration.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCounterModelMasterCounter Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetCounterModelMaster(
    &mission.GetCounterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCounterModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getCounterModelMaster(
        (new GetCounterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCounterModelMasterRequest;
import io.gs2.mission.result.GetCounterModelMasterResult;

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

try {
    GetCounterModelMasterResult result = client.getCounterModelMaster(
        new GetCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    CounterModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetCounterModelMasterResult> asyncResult = null;
yield return client.GetCounterModelMaster(
    new Gs2.Gs2Mission.Request.GetCounterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getCounterModelMaster(
        new Gs2Mission.GetCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_counter_model_master(
        mission.GetCounterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_counter_model_master({
    namespaceName="namespace-0001",
    counterName="counter-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('mission')

api_result_handler = client.get_counter_model_master_async({
    namespaceName="namespace-0001",
    counterName="counter-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;

updateCounterModelMaster

Update Counter Model Master

Updates the specified counter model master. You can modify the metadata, description, scopes, and challenge period event ID.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 20 itemsList of Counter reset timing
Defines the scopes (reset timings or verify action conditions) for this counter. A single counter can have multiple scopes, allowing one counter to track values across different periods (e.g., daily, weekly, and cumulative totals simultaneously).
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated

Result

TypeDescription
itemCounterModelMasterCounter Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateCounterModelMaster(
    &mission.UpdateCounterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-0001"),
        Metadata: pointy.String("COUNTER1"),
        Description: pointy.String("description1"),
        Scopes: []mission.CounterScopeModel{
            mission.CounterScopeModel{
                ResetType: pointy.String("monthly"),
                ResetHour: pointy.Int32(5),
                ResetDayOfMonth: pointy.Int32(1),
            },
        },
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateCounterModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateCounterModelMaster(
        (new UpdateCounterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-0001")
            ->withMetadata("COUNTER1")
            ->withDescription("description1")
            ->withScopes([
                (new \Gs2\Mission\Model\CounterScopeModel())
                    ->withResetType("monthly")
                    ->withResetHour(5)
                    ->withResetDayOfMonth(1),
            ])
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateCounterModelMasterRequest;
import io.gs2.mission.result.UpdateCounterModelMasterResult;

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

try {
    UpdateCounterModelMasterResult result = client.updateCounterModelMaster(
        new UpdateCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withMetadata("COUNTER1")
            .withDescription("description1")
            .withScopes(Arrays.asList(
                new io.gs2.mission.model.CounterScopeModel()
                    .withResetType("monthly")
                    .withResetHour(5)
                    .withResetDayOfMonth(1)
            ))
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    CounterModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateCounterModelMasterResult> asyncResult = null;
yield return client.UpdateCounterModelMaster(
    new Gs2.Gs2Mission.Request.UpdateCounterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-0001")
        .WithMetadata("COUNTER1")
        .WithDescription("description1")
        .WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
            new Gs2.Gs2Mission.Model.CounterScopeModel()
                .WithResetType("monthly")
                .WithResetHour(5)
                .WithResetDayOfMonth(1),
        })
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateCounterModelMaster(
        new Gs2Mission.UpdateCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
            .withMetadata("COUNTER1")
            .withDescription("description1")
            .withScopes([
                new Gs2Mission.model.CounterScopeModel()
                    .withResetType("monthly")
                    .withResetHour(5)
                    .withResetDayOfMonth(1),
            ])
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.update_counter_model_master(
        mission.UpdateCounterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
            .with_metadata('COUNTER1')
            .with_description('description1')
            .with_scopes([
                mission.CounterScopeModel()
                    .with_reset_type('monthly')
                    .with_reset_hour(5)
                    .with_reset_day_of_month(1),
            ])
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.update_counter_model_master({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    metadata="COUNTER1",
    description="description1",
    scopes={
        {
            resetType="monthly",
            resetHour=5,
            resetDayOfMonth=1,
        }
    },
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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('mission')

api_result_handler = client.update_counter_model_master_async({
    namespaceName="namespace-0001",
    counterName="counter-0001",
    metadata="COUNTER1",
    description="description1",
    scopes={
        {
            resetType="monthly",
            resetHour=5,
            resetDayOfMonth=1,
        }
    },
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-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;

deleteCounterModelMaster

Delete Counter Model Master

Deletes the specified counter model master. This does not affect the currently active master data until the next master data update.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
counterNamestring
~ 128 charsCounter Model name
Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCounterModelMasterCounter Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteCounterModelMaster(
    &mission.DeleteCounterModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCounterModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteCounterModelMaster(
        (new DeleteCounterModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCounterModelMasterRequest;
import io.gs2.mission.result.DeleteCounterModelMasterResult;

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

try {
    DeleteCounterModelMasterResult result = client.deleteCounterModelMaster(
        new DeleteCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    CounterModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteCounterModelMasterResult> asyncResult = null;
yield return client.DeleteCounterModelMaster(
    new Gs2.Gs2Mission.Request.DeleteCounterModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteCounterModelMaster(
        new Gs2Mission.DeleteCounterModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCounterName("counter-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_counter_model_master(
        mission.DeleteCounterModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_counter_name('counter-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_counter_model_master({
    namespaceName="namespace-0001",
    counterName="counter-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('mission')

api_result_handler = client.delete_counter_model_master_async({
    namespaceName="namespace-0001",
    counterName="counter-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;

describeMissionGroupModelMasters

Get a list of Mission Group Model Masters

Retrieves a paginated list of mission group model masters for the specified namespace. Can optionally filter by name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by mission group name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<MissionGroupModelMaster>List of Mission Group Model Master
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeMissionGroupModelMasters(
    &mission.DescribeMissionGroupModelMastersRequest {
        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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionGroupModelMastersRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeMissionGroupModelMasters(
        (new DescribeMissionGroupModelMastersRequest())
            ->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionGroupModelMastersRequest;
import io.gs2.mission.result.DescribeMissionGroupModelMastersResult;

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

try {
    DescribeMissionGroupModelMastersResult result = client.describeMissionGroupModelMasters(
        new DescribeMissionGroupModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<MissionGroupModelMaster> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeMissionGroupModelMastersResult> asyncResult = null;
yield return client.DescribeMissionGroupModelMasters(
    new Gs2.Gs2Mission.Request.DescribeMissionGroupModelMastersRequest()
        .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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeMissionGroupModelMasters(
        new Gs2Mission.DescribeMissionGroupModelMastersRequest()
            .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 mission

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

try:
    result = client.describe_mission_group_model_masters(
        mission.DescribeMissionGroupModelMastersRequest()
            .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('mission')

api_result = client.describe_mission_group_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('mission')

api_result_handler = client.describe_mission_group_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;

createMissionGroupModelMaster

Create a new Mission Group Model Master

Creates a new mission group model master with the specified configuration. You can configure the reset type (daily, weekly, monthly, or none), reset timing (hour, day of week/month, anchor timestamp), and a notification namespace for completion events.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
“notReset”Reset timing
Determines when the mission group’s completion status is reset. Choose from: not reset (permanent), daily, weekly, monthly, or every fixed number of days from an anchor timestamp.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
resetDayOfMonthint{resetType} == “monthly”
✓*
1 ~ 31Date to reset
The day of the month on which the mission group resets. If the specified value exceeds the number of days in the month, it is treated as the last day of that month. Only used when resetType is “monthly”.
* Required if resetType is “monthly”
resetDayOfWeekString Enum
enum {
  “sunday”,
  “monday”,
  “tuesday”,
  “wednesday”,
  “thursday”,
  “friday”,
  “saturday”
}
{resetType} == “weekly”
✓*
Day of the week to reset
The day of the week on which the mission group resets. Only used when resetType is “weekly”.
DefinitionDescription
“sunday”Sunday
“monday”Monday
“tuesday”Tuesday
“wednesday”Wednesday
“thursday”Thursday
“friday”Friday
“saturday”Saturday
* Required if resetType is “weekly”
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]
✓*
0 ~ 23Hour of Reset
The hour (0-23) at which the mission group resets. Used in combination with daily, weekly, or monthly reset types.
* Required if resetType is “monthly”,“weekly”,“daily”
anchorTimestamplong{resetType} == “days”
✓*
Base date and time for counting elapsed days
Unix time, milliseconds
* Required if resetType is “days”
daysint{resetType} == “days”
✓*
1 ~ 2147483646Number of days to reset
The interval in days between resets, counting from the anchor timestamp. Only used when resetType is “days”.
* Required if resetType is “days”
completeNotificationNamespaceIdstring~ 1024 charsPush notifications when mission tasks are accomplished
The GS2-Gateway namespace GRN used to deliver push notifications when a mission task in this group is accomplished. Allows the game client to be notified in real-time.

Result

TypeDescription
itemMissionGroupModelMasterMission Group Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CreateMissionGroupModelMaster(
    &mission.CreateMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("mission-group-0001"),
        Metadata: nil,
        Description: nil,
        ResetType: pointy.String("notReset"),
        ResetDayOfMonth: pointy.Int32(1),
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(10),
        AnchorTimestamp: pointy.Int64(100000),
        Days: pointy.Int32(3),
        CompleteNotificationNamespaceId: 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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateMissionGroupModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->createMissionGroupModelMaster(
        (new CreateMissionGroupModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("mission-group-0001")
            ->withMetadata(null)
            ->withDescription(null)
            ->withResetType("notReset")
            ->withResetDayOfMonth(1)
            ->withResetDayOfWeek("monday")
            ->withResetHour(10)
            ->withAnchorTimestamp(100000)
            ->withDays(3)
            ->withCompleteNotificationNamespaceId(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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateMissionGroupModelMasterRequest;
import io.gs2.mission.result.CreateMissionGroupModelMasterResult;

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

try {
    CreateMissionGroupModelMasterResult result = client.createMissionGroupModelMaster(
        new CreateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mission-group-0001")
            .withMetadata(null)
            .withDescription(null)
            .withResetType("notReset")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withAnchorTimestamp(100000L)
            .withDays(3)
            .withCompleteNotificationNamespaceId(null)
    );
    MissionGroupModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CreateMissionGroupModelMasterResult> asyncResult = null;
yield return client.CreateMissionGroupModelMaster(
    new Gs2.Gs2Mission.Request.CreateMissionGroupModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("mission-group-0001")
        .WithMetadata(null)
        .WithDescription(null)
        .WithResetType("notReset")
        .WithResetDayOfMonth(1)
        .WithResetDayOfWeek("monday")
        .WithResetHour(10)
        .WithAnchorTimestamp(100000L)
        .WithDays(3)
        .WithCompleteNotificationNamespaceId(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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.createMissionGroupModelMaster(
        new Gs2Mission.CreateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mission-group-0001")
            .withMetadata(null)
            .withDescription(null)
            .withResetType("notReset")
            .withResetDayOfMonth(1)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withAnchorTimestamp(100000)
            .withDays(3)
            .withCompleteNotificationNamespaceId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.create_mission_group_model_master(
        mission.CreateMissionGroupModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('mission-group-0001')
            .with_metadata(None)
            .with_description(None)
            .with_reset_type('notReset')
            .with_reset_day_of_month(1)
            .with_reset_day_of_week('monday')
            .with_reset_hour(10)
            .with_anchor_timestamp(100000)
            .with_days(3)
            .with_complete_notification_namespace_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.create_mission_group_model_master({
    namespaceName="namespace-0001",
    name="mission-group-0001",
    metadata=nil,
    description=nil,
    resetType="notReset",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=10,
    anchorTimestamp=100000,
    days=3,
    completeNotificationNamespaceId=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('mission')

api_result_handler = client.create_mission_group_model_master_async({
    namespaceName="namespace-0001",
    name="mission-group-0001",
    metadata=nil,
    description=nil,
    resetType="notReset",
    resetDayOfMonth=1,
    resetDayOfWeek="monday",
    resetHour=10,
    anchorTimestamp=100000,
    days=3,
    completeNotificationNamespaceId=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;

getMissionGroupModelMaster

Get Mission Group Model Master

Retrieves the specified mission group model master, including its reset type, reset timing, and notification settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionGroupModelMasterMission Group Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetMissionGroupModelMaster(
    &mission.GetMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetMissionGroupModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getMissionGroupModelMaster(
        (new GetMissionGroupModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetMissionGroupModelMasterRequest;
import io.gs2.mission.result.GetMissionGroupModelMasterResult;

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

try {
    GetMissionGroupModelMasterResult result = client.getMissionGroupModelMaster(
        new GetMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    MissionGroupModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetMissionGroupModelMasterResult> asyncResult = null;
yield return client.GetMissionGroupModelMaster(
    new Gs2.Gs2Mission.Request.GetMissionGroupModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getMissionGroupModelMaster(
        new Gs2Mission.GetMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_mission_group_model_master(
        mission.GetMissionGroupModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_mission_group_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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('mission')

api_result_handler = client.get_mission_group_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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;

updateMissionGroupModelMaster

Update Mission Group Model Master

Updates the specified mission group model master. You can modify the metadata, description, reset type, reset timing, and notification settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
resetTypeString Enum
enum {
  “notReset”,
  “daily”,
  “weekly”,
  “monthly”,
  “days”
}
“notReset”Reset timing
Determines when the mission group’s completion status is reset. Choose from: not reset (permanent), daily, weekly, monthly, or every fixed number of days from an anchor timestamp.
DefinitionDescription
“notReset”Not Reset
“daily”Daily
“weekly”Weekly
“monthly”Monthly
“days”Every fixed number of days
resetDayOfMonthint{resetType} == “monthly”
✓*
1 ~ 31Date to reset
The day of the month on which the mission group resets. If the specified value exceeds the number of days in the month, it is treated as the last day of that month. Only used when resetType is “monthly”.
* Required if resetType is “monthly”
resetDayOfWeekString Enum
enum {
  “sunday”,
  “monday”,
  “tuesday”,
  “wednesday”,
  “thursday”,
  “friday”,
  “saturday”
}
{resetType} == “weekly”
✓*
Day of the week to reset
The day of the week on which the mission group resets. Only used when resetType is “weekly”.
DefinitionDescription
“sunday”Sunday
“monday”Monday
“tuesday”Tuesday
“wednesday”Wednesday
“thursday”Thursday
“friday”Friday
“saturday”Saturday
* Required if resetType is “weekly”
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]
✓*
0 ~ 23Hour of Reset
The hour (0-23) at which the mission group resets. Used in combination with daily, weekly, or monthly reset types.
* Required if resetType is “monthly”,“weekly”,“daily”
anchorTimestamplong{resetType} == “days”
✓*
Base date and time for counting elapsed days
Unix time, milliseconds
* Required if resetType is “days”
daysint{resetType} == “days”
✓*
1 ~ 2147483646Number of days to reset
The interval in days between resets, counting from the anchor timestamp. Only used when resetType is “days”.
* Required if resetType is “days”
completeNotificationNamespaceIdstring~ 1024 charsPush notifications when mission tasks are accomplished
The GS2-Gateway namespace GRN used to deliver push notifications when a mission task in this group is accomplished. Allows the game client to be notified in real-time.

Result

TypeDescription
itemMissionGroupModelMasterMission Group Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateMissionGroupModelMaster(
    &mission.UpdateMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        Metadata: pointy.String("MISSION_GROUP1"),
        Description: pointy.String("description1"),
        ResetType: pointy.String("weekly"),
        ResetDayOfMonth: pointy.Int32(5),
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(10),
        AnchorTimestamp: pointy.Int64(100000),
        Days: pointy.Int32(3),
        CompleteNotificationNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateMissionGroupModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateMissionGroupModelMaster(
        (new UpdateMissionGroupModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMetadata("MISSION_GROUP1")
            ->withDescription("description1")
            ->withResetType("weekly")
            ->withResetDayOfMonth(5)
            ->withResetDayOfWeek("monday")
            ->withResetHour(10)
            ->withAnchorTimestamp(100000)
            ->withDays(3)
            ->withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateMissionGroupModelMasterRequest;
import io.gs2.mission.result.UpdateMissionGroupModelMasterResult;

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

try {
    UpdateMissionGroupModelMasterResult result = client.updateMissionGroupModelMaster(
        new UpdateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMetadata("MISSION_GROUP1")
            .withDescription("description1")
            .withResetType("weekly")
            .withResetDayOfMonth(5)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withAnchorTimestamp(100000L)
            .withDays(3)
            .withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001")
    );
    MissionGroupModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateMissionGroupModelMasterResult> asyncResult = null;
yield return client.UpdateMissionGroupModelMaster(
    new Gs2.Gs2Mission.Request.UpdateMissionGroupModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMetadata("MISSION_GROUP1")
        .WithDescription("description1")
        .WithResetType("weekly")
        .WithResetDayOfMonth(5)
        .WithResetDayOfWeek("monday")
        .WithResetHour(10)
        .WithAnchorTimestamp(100000L)
        .WithDays(3)
        .WithCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateMissionGroupModelMaster(
        new Gs2Mission.UpdateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMetadata("MISSION_GROUP1")
            .withDescription("description1")
            .withResetType("weekly")
            .withResetDayOfMonth(5)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withAnchorTimestamp(100000)
            .withDays(3)
            .withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.update_mission_group_model_master(
        mission.UpdateMissionGroupModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_metadata('MISSION_GROUP1')
            .with_description('description1')
            .with_reset_type('weekly')
            .with_reset_day_of_month(5)
            .with_reset_day_of_week('monday')
            .with_reset_hour(10)
            .with_anchor_timestamp(100000)
            .with_days(3)
            .with_complete_notification_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.update_mission_group_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    metadata="MISSION_GROUP1",
    description="description1",
    resetType="weekly",
    resetDayOfMonth=5,
    resetDayOfWeek="monday",
    resetHour=10,
    anchorTimestamp=100000,
    days=3,
    completeNotificationNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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('mission')

api_result_handler = client.update_mission_group_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    metadata="MISSION_GROUP1",
    description="description1",
    resetType="weekly",
    resetDayOfMonth=5,
    resetDayOfWeek="monday",
    resetHour=10,
    anchorTimestamp=100000,
    days=3,
    completeNotificationNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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;

deleteMissionGroupModelMaster

Delete Mission Group Model Master

Deletes the specified mission group model master. This does not affect the currently active master data until the next master data update.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionGroupModelMasterMission Group Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteMissionGroupModelMaster(
    &mission.DeleteMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteMissionGroupModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteMissionGroupModelMaster(
        (new DeleteMissionGroupModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteMissionGroupModelMasterRequest;
import io.gs2.mission.result.DeleteMissionGroupModelMasterResult;

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

try {
    DeleteMissionGroupModelMasterResult result = client.deleteMissionGroupModelMaster(
        new DeleteMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    MissionGroupModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteMissionGroupModelMasterResult> asyncResult = null;
yield return client.DeleteMissionGroupModelMaster(
    new Gs2.Gs2Mission.Request.DeleteMissionGroupModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteMissionGroupModelMaster(
        new Gs2Mission.DeleteMissionGroupModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_mission_group_model_master(
        mission.DeleteMissionGroupModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_mission_group_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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('mission')

api_result_handler = client.delete_mission_group_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-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;

describeMissionTaskModelMasters

Get a list of Mission Task Model Masters

Retrieves a paginated list of mission task model masters within the specified mission group. Can optionally filter by name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by Mission Task Model Master name prefix
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<MissionTaskModelMaster>List of Mission Task Model Masters
nextPageTokenstringPage 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/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeMissionTaskModelMasters(
    &mission.DescribeMissionTaskModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        MissionGroupName: pointy.String("mission-group-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionTaskModelMastersRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->describeMissionTaskModelMasters(
        (new DescribeMissionTaskModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withMissionGroupName("mission-group-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionTaskModelMastersRequest;
import io.gs2.mission.result.DescribeMissionTaskModelMastersResult;

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

try {
    DescribeMissionTaskModelMastersResult result = client.describeMissionTaskModelMasters(
        new DescribeMissionTaskModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withMissionGroupName("mission-group-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MissionTaskModelMaster> 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DescribeMissionTaskModelMastersResult> asyncResult = null;
yield return client.DescribeMissionTaskModelMasters(
    new Gs2.Gs2Mission.Request.DescribeMissionTaskModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithMissionGroupName("mission-group-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.describeMissionTaskModelMasters(
        new Gs2Mission.DescribeMissionTaskModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withMissionGroupName("mission-group-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 mission

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

try:
    result = client.describe_mission_task_model_masters(
        mission.DescribeMissionTaskModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_mission_group_name('mission-group-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('mission')

api_result = client.describe_mission_task_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    missionGroupName="mission-group-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('mission')

api_result_handler = client.describe_mission_task_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    missionGroupName="mission-group-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;

createMissionTaskModelMaster

Create a new Mission Task Model Master

Creates a new mission task model master with the specified configuration. You can configure the target counter and threshold, completion verification type (counter value or custom consume actions), reward acquire actions, a challenge period event, and a prerequisite mission task.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
verifyCompleteTypeString Enum
enum {
  “counter”,
  “verifyActions”
}
“counter”Completion condition type
Specifies how mission task completion is determined. “counter” checks if the associated counter’s scoped value reaches the target threshold. “verifyActions” uses verify actions to check completion conditions.
DefinitionDescription
“counter”Counter
“verifyActions”Verify Actions
targetCounterTargetCounterModel{verifyCompleteType} == “counter”
✓*
Target Counter
Defines the counter, scope, and target value used to determine mission task completion. When the counter’s scoped value reaches or exceeds the specified target value, the task is considered accomplished.
* Required if verifyCompleteType is “counter”
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “verifyActions”0 ~ 10 itemsVerify Actions when task is accomplished
A list of verify actions used to determine if the mission task is completed. All verify actions must pass for the task to be considered accomplished. Only used when verifyCompleteType is “verifyActions”.
* Applicable only if verifyCompleteType is “verifyActions”
completeAcquireActionsList<AcquireAction>[]0 ~ 100 itemsRewards for mission accomplishment
The list of acquire actions executed as rewards when the player receives the mission completion reward.
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
premiseMissionTaskNamestring~ 128 charsName of the task that must be accomplished to attempt this task
Specifies a prerequisite mission task within the same group that must be completed before the player can receive the reward for this task. Used to create sequential mission chains.

Result

TypeDescription
itemMissionTaskModelMasterMission Task Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.CreateMissionTaskModelMaster(
    &mission.CreateMissionTaskModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        Name: pointy.String("mission-task-0001"),
        Metadata: nil,
        Description: nil,
        VerifyCompleteType: pointy.String("counter"),
        TargetCounter: &mission.TargetCounterModel{
            CounterName: pointy.String("counter-0001"),
            Value: pointy.Int64(10),
        },
        VerifyCompleteConsumeActions: nil,
        CompleteAcquireActions: []mission.AcquireAction{
            mission.AcquireAction{
                Action: pointy.String("Gs2Experience:AddExperienceByUserId"),
                Request: pointy.String("Gs2Experience:AddExperienceByUserId-request1"),
            },
        },
        ChallengePeriodEventId: nil,
        PremiseMissionTaskName: 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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateMissionTaskModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->createMissionTaskModelMaster(
        (new CreateMissionTaskModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withName("mission-task-0001")
            ->withMetadata(null)
            ->withDescription(null)
            ->withVerifyCompleteType("counter")
            ->withTargetCounter((new \Gs2\Mission\Model\TargetCounterModel())
                ->withCounterName("counter-0001")
                ->withValue(10))
            ->withVerifyCompleteConsumeActions(null)
            ->withCompleteAcquireActions([
                (new \Gs2\Mission\Model\AcquireAction())
                    ->withAction("Gs2Experience:AddExperienceByUserId")
                    ->withRequest("Gs2Experience:AddExperienceByUserId-request1"),
            ])
            ->withChallengePeriodEventId(null)
            ->withPremiseMissionTaskName(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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateMissionTaskModelMasterRequest;
import io.gs2.mission.result.CreateMissionTaskModelMasterResult;

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

try {
    CreateMissionTaskModelMasterResult result = client.createMissionTaskModelMaster(
        new CreateMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withName("mission-task-0001")
            .withMetadata(null)
            .withDescription(null)
            .withVerifyCompleteType("counter")
            .withTargetCounter(new io.gs2.mission.model.TargetCounterModel()
                .withCounterName("counter-0001")
                .withValue(10L))
            .withVerifyCompleteConsumeActions(null)
            .withCompleteAcquireActions(Arrays.asList(
                new io.gs2.mission.model.AcquireAction()
                    .withAction("Gs2Experience:AddExperienceByUserId")
                    .withRequest("Gs2Experience:AddExperienceByUserId-request1")
            ))
            .withChallengePeriodEventId(null)
            .withPremiseMissionTaskName(null)
    );
    MissionTaskModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.CreateMissionTaskModelMasterResult> asyncResult = null;
yield return client.CreateMissionTaskModelMaster(
    new Gs2.Gs2Mission.Request.CreateMissionTaskModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithName("mission-task-0001")
        .WithMetadata(null)
        .WithDescription(null)
        .WithVerifyCompleteType("counter")
        .WithTargetCounter(new Gs2.Gs2Mission.Model.TargetCounterModel()
            .WithCounterName("counter-0001")
            .WithValue(10L))
        .WithVerifyCompleteConsumeActions(null)
        .WithCompleteAcquireActions(new Gs2.Core.Model.AcquireAction[] {
            new Gs2.Core.Model.AcquireAction()
                .WithAction("Gs2Experience:AddExperienceByUserId")
                .WithRequest("Gs2Experience:AddExperienceByUserId-request1"),
        })
        .WithChallengePeriodEventId(null)
        .WithPremiseMissionTaskName(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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.createMissionTaskModelMaster(
        new Gs2Mission.CreateMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withName("mission-task-0001")
            .withMetadata(null)
            .withDescription(null)
            .withVerifyCompleteType("counter")
            .withTargetCounter(new Gs2Mission.model.TargetCounterModel()
                .withCounterName("counter-0001")
                .withValue(10))
            .withVerifyCompleteConsumeActions(null)
            .withCompleteAcquireActions([
                new Gs2Mission.model.AcquireAction()
                    .withAction("Gs2Experience:AddExperienceByUserId")
                    .withRequest("Gs2Experience:AddExperienceByUserId-request1"),
            ])
            .withChallengePeriodEventId(null)
            .withPremiseMissionTaskName(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.create_mission_task_model_master(
        mission.CreateMissionTaskModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_name('mission-task-0001')
            .with_metadata(None)
            .with_description(None)
            .with_verify_complete_type('counter')
            .with_target_counter(
                mission.TargetCounterModel()
                    .with_counter_name('counter-0001')
                    .with_value(10))
            .with_verify_complete_consume_actions(None)
            .with_complete_acquire_actions([
                mission.AcquireAction()
                    .with_action('Gs2Experience:AddExperienceByUserId')
                    .with_request('Gs2Experience:AddExperienceByUserId-request1'),
            ])
            .with_challenge_period_event_id(None)
            .with_premise_mission_task_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.create_mission_task_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    name="mission-task-0001",
    metadata=nil,
    description=nil,
    verifyCompleteType="counter",
    targetCounter={
        counterName="counter-0001",
        value=10,
    },
    verifyCompleteConsumeActions=nil,
    completeAcquireActions={
        {
            action="Gs2Experience:AddExperienceByUserId",
            request="Gs2Experience:AddExperienceByUserId-request1",
        }
    },
    challengePeriodEventId=nil,
    premiseMissionTaskName=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('mission')

api_result_handler = client.create_mission_task_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    name="mission-task-0001",
    metadata=nil,
    description=nil,
    verifyCompleteType="counter",
    targetCounter={
        counterName="counter-0001",
        value=10,
    },
    verifyCompleteConsumeActions=nil,
    completeAcquireActions={
        {
            action="Gs2Experience:AddExperienceByUserId",
            request="Gs2Experience:AddExperienceByUserId-request1",
        }
    },
    challengePeriodEventId=nil,
    premiseMissionTaskName=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;

getMissionTaskModelMaster

Get Mission Task Model Master

Retrieves the specified mission task model master, including its target counter, completion verification type, reward actions, and prerequisite configuration.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionTaskModelMasterMission Task Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetMissionTaskModelMaster(
    &mission.GetMissionTaskModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetMissionTaskModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->getMissionTaskModelMaster(
        (new GetMissionTaskModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetMissionTaskModelMasterRequest;
import io.gs2.mission.result.GetMissionTaskModelMasterResult;

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

try {
    GetMissionTaskModelMasterResult result = client.getMissionTaskModelMaster(
        new GetMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    MissionTaskModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.GetMissionTaskModelMasterResult> asyncResult = null;
yield return client.GetMissionTaskModelMaster(
    new Gs2.Gs2Mission.Request.GetMissionTaskModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.getMissionTaskModelMaster(
        new Gs2Mission.GetMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.get_mission_task_model_master(
        mission.GetMissionTaskModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.get_mission_task_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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('mission')

api_result_handler = client.get_mission_task_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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;

updateMissionTaskModelMaster

Update Mission Task Model Master

Updates the specified mission task model master. You can modify the metadata, description, target counter, completion verification type, reward actions, challenge period event, and prerequisite mission task.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
descriptionstring~ 1024 charsDescription
verifyCompleteTypeString Enum
enum {
  “counter”,
  “verifyActions”
}
“counter”Completion condition type
Specifies how mission task completion is determined. “counter” checks if the associated counter’s scoped value reaches the target threshold. “verifyActions” uses verify actions to check completion conditions.
DefinitionDescription
“counter”Counter
“verifyActions”Verify Actions
targetCounterTargetCounterModel{verifyCompleteType} == “counter”
✓*
Target Counter
Defines the counter, scope, and target value used to determine mission task completion. When the counter’s scoped value reaches or exceeds the specified target value, the task is considered accomplished.
* Required if verifyCompleteType is “counter”
verifyCompleteConsumeActionsList<VerifyAction>{verifyCompleteType} == “verifyActions”0 ~ 10 itemsVerify Actions when task is accomplished
A list of verify actions used to determine if the mission task is completed. All verify actions must pass for the task to be considered accomplished. Only used when verifyCompleteType is “verifyActions”.
* Applicable only if verifyCompleteType is “verifyActions”
completeAcquireActionsList<AcquireAction>[]0 ~ 100 itemsRewards for mission accomplishment
The list of acquire actions executed as rewards when the player receives the mission completion reward.
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
premiseMissionTaskNamestring~ 128 charsName of the task that must be accomplished to attempt this task
Specifies a prerequisite mission task within the same group that must be completed before the player can receive the reward for this task. Used to create sequential mission chains.

Result

TypeDescription
itemMissionTaskModelMasterMission Task Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.UpdateMissionTaskModelMaster(
    &mission.UpdateMissionTaskModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        Metadata: pointy.String("MISSION_TASK1"),
        Description: pointy.String("description1"),
        VerifyCompleteType: pointy.String("counter"),
        TargetCounter: &mission.TargetCounterModel{
            CounterName: pointy.String("counter-0001"),
            Value: pointy.Int64(100),
        },
        VerifyCompleteConsumeActions: nil,
        CompleteAcquireActions: []mission.AcquireAction{
            mission.AcquireAction{
                Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
                Request: pointy.String("Gs2Stamina:RecoverStaminaByUserId-request"),
            },
        },
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
        PremiseMissionTaskName: 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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateMissionTaskModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->updateMissionTaskModelMaster(
        (new UpdateMissionTaskModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withMetadata("MISSION_TASK1")
            ->withDescription("description1")
            ->withVerifyCompleteType("counter")
            ->withTargetCounter((new \Gs2\Mission\Model\TargetCounterModel())
                ->withCounterName("counter-0001")
                ->withValue(100))
            ->withVerifyCompleteConsumeActions(null)
            ->withCompleteAcquireActions([
                (new \Gs2\Mission\Model\AcquireAction())
                    ->withAction("Gs2Stamina:RecoverStaminaByUserId")
                    ->withRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
            ])
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
            ->withPremiseMissionTaskName(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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateMissionTaskModelMasterRequest;
import io.gs2.mission.result.UpdateMissionTaskModelMasterResult;

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

try {
    UpdateMissionTaskModelMasterResult result = client.updateMissionTaskModelMaster(
        new UpdateMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withMetadata("MISSION_TASK1")
            .withDescription("description1")
            .withVerifyCompleteType("counter")
            .withTargetCounter(new io.gs2.mission.model.TargetCounterModel()
                .withCounterName("counter-0001")
                .withValue(100L))
            .withVerifyCompleteConsumeActions(null)
            .withCompleteAcquireActions(Arrays.asList(
                new io.gs2.mission.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("Gs2Stamina:RecoverStaminaByUserId-request")
            ))
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
            .withPremiseMissionTaskName(null)
    );
    MissionTaskModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.UpdateMissionTaskModelMasterResult> asyncResult = null;
yield return client.UpdateMissionTaskModelMaster(
    new Gs2.Gs2Mission.Request.UpdateMissionTaskModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-0001")
        .WithMetadata("MISSION_TASK1")
        .WithDescription("description1")
        .WithVerifyCompleteType("counter")
        .WithTargetCounter(new Gs2.Gs2Mission.Model.TargetCounterModel()
            .WithCounterName("counter-0001")
            .WithValue(100L))
        .WithVerifyCompleteConsumeActions(null)
        .WithCompleteAcquireActions(new Gs2.Core.Model.AcquireAction[] {
            new Gs2.Core.Model.AcquireAction()
                .WithAction("Gs2Stamina:RecoverStaminaByUserId")
                .WithRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
        })
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
        .WithPremiseMissionTaskName(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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.updateMissionTaskModelMaster(
        new Gs2Mission.UpdateMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withMetadata("MISSION_TASK1")
            .withDescription("description1")
            .withVerifyCompleteType("counter")
            .withTargetCounter(new Gs2Mission.model.TargetCounterModel()
                .withCounterName("counter-0001")
                .withValue(100))
            .withVerifyCompleteConsumeActions(null)
            .withCompleteAcquireActions([
                new Gs2Mission.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("Gs2Stamina:RecoverStaminaByUserId-request"),
            ])
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
            .withPremiseMissionTaskName(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.update_mission_task_model_master(
        mission.UpdateMissionTaskModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_metadata('MISSION_TASK1')
            .with_description('description1')
            .with_verify_complete_type('counter')
            .with_target_counter(
                mission.TargetCounterModel()
                    .with_counter_name('counter-0001')
                    .with_value(100))
            .with_verify_complete_consume_actions(None)
            .with_complete_acquire_actions([
                mission.AcquireAction()
                    .with_action('Gs2Stamina:RecoverStaminaByUserId')
                    .with_request('Gs2Stamina:RecoverStaminaByUserId-request'),
            ])
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001')
            .with_premise_mission_task_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.update_mission_task_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    metadata="MISSION_TASK1",
    description="description1",
    verifyCompleteType="counter",
    targetCounter={
        counterName="counter-0001",
        value=100,
    },
    verifyCompleteConsumeActions=nil,
    completeAcquireActions={
        {
            action="Gs2Stamina:RecoverStaminaByUserId",
            request="Gs2Stamina:RecoverStaminaByUserId-request",
        }
    },
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
    premiseMissionTaskName=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('mission')

api_result_handler = client.update_mission_task_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-0001",
    metadata="MISSION_TASK1",
    description="description1",
    verifyCompleteType="counter",
    targetCounter={
        counterName="counter-0001",
        value=100,
    },
    verifyCompleteConsumeActions=nil,
    completeAcquireActions={
        {
            action="Gs2Stamina:RecoverStaminaByUserId",
            request="Gs2Stamina:RecoverStaminaByUserId-request",
        }
    },
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
    premiseMissionTaskName=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;

deleteMissionTaskModelMaster

Delete Mission Task Model Master

Deletes the specified mission task model master. This does not affect the currently active master data until the next master data update.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionGroupNamestring
~ 128 charsMission Group Model name
Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
missionTaskNamestring
~ 128 charsMission Task Model name
Mission Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemMissionTaskModelMasterMission Task Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteMissionTaskModelMaster(
    &mission.DeleteMissionTaskModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteMissionTaskModelMasterRequest;

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

$session->open();

$client = new Gs2MissionRestClient(
    $session
);

try {
    $result = $client->deleteMissionTaskModelMaster(
        (new DeleteMissionTaskModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteMissionTaskModelMasterRequest;
import io.gs2.mission.result.DeleteMissionTaskModelMasterResult;

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

try {
    DeleteMissionTaskModelMasterResult result = client.deleteMissionTaskModelMaster(
        new DeleteMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    MissionTaskModelMaster 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 Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Mission.Result.DeleteMissionTaskModelMasterResult> asyncResult = null;
yield return client.DeleteMissionTaskModelMaster(
    new Gs2.Gs2Mission.Request.DeleteMissionTaskModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMissionGroupName("mission-group-0001")
        .WithMissionTaskName("mission-task-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 Gs2Mission from '@/gs2/mission';

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

try {
    const result = await client.deleteMissionTaskModelMaster(
        new Gs2Mission.DeleteMissionTaskModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

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

try:
    result = client.delete_mission_task_model_master(
        mission.DeleteMissionTaskModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('mission')

api_result = client.delete_mission_task_model_master({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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('mission')

api_result_handler = client.delete_mission_task_model_master_async({
    namespaceName="namespace-0001",
    missionGroupName="mission-group-0001",
    missionTaskName="mission-task-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;