Transaction Action of GS2-Limit
Specification of verify/consume/acquire transaction actions
VerifyAction
Gs2Limit:VerifyCounterByUserId
Verify counter value by specifying a user ID
Whether the action allows quantity specification: NO
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||||||||||||||||
| limitName | string | ✓ | ~ 128 chars | Limit Model name | ||||||||||||||||
| counterName | string | ✓ | ~ 128 chars | Counter Name | ||||||||||||||||
| verifyType | String Enum enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | Type of verification
| |||||||||||||||||
| count | int | ✓ | 0 | 0 ~ 2147483646 | count value | |||||||||||||||
| multiplyValueSpecifyingQuantity | bool | ✓ | true | Whether to multiply the value used for verification when specifying the quantity | ||||||||||||||||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:VerifyCounterByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"limitName": "[string]Limit Model name",
"counterName": "[string]Counter Name",
"verifyType": "[string]Type of verification",
"count": "[int]count value",
"multiplyValueSpecifyingQuantity": "[bool]Whether to multiply the value used for verification when specifying the quantity",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:VerifyCounterByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
limitName: "[string]Limit Model name"
counterName: "[string]Counter Name"
verifyType: "[string]Type of verification"
count: "[int]count value"
multiplyValueSpecifyingQuantity: "[bool]Whether to multiply the value used for verification when specifying the quantity"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").verify.verify_counter_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
limitName="[string]Limit Model name",
counterName="[string]Counter Name",
verifyType="[string]Type of verification",
count="[int]count value",
multiplyValueSpecifyingQuantity="[bool]Whether to multiply the value used for verification when specifying the quantity",
timeOffsetToken="[string]Time offset token",
})ConsumeAction
Gs2Limit:CountUpByUserId
count-up by the specify user ID
Whether the action allows quantity specification: YES
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| limitName | string | ✓ | ~ 128 chars | Limit Model name | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| countUpValue | int | ✓ | 1 | 1 ~ 2147483646 | Amount to count up | |
| maxValue | int | 1 ~ 2147483646 | Maximum value allowed to count up | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:CountUpByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Limit Model name",
"counterName": "[string]Counter Name",
"userId": "[string]User ID",
"countUpValue": "[int]Amount to count up",
"maxValue": "[int]Maximum value allowed to count up",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:CountUpByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Limit Model name"
counterName: "[string]Counter Name"
userId: "[string]User ID"
countUpValue: "[int]Amount to count up"
maxValue: "[int]Maximum value allowed to count up"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").consume.count_up_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Limit Model name",
counterName="[string]Counter Name",
userId="[string]User ID",
countUpValue="[int]Amount to count up",
maxValue="[int]Maximum value allowed to count up",
timeOffsetToken="[string]Time offset token",
})AcquireAction
Gs2Limit:CountDownByUserId
count-down by the specify user ID
Whether the action allows quantity specification: YES
Whether the action is reversible: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| limitName | string | ✓ | ~ 128 chars | Limit Model name | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| countDownValue | int | ✓ | 1 | 1 ~ 2147483646 | Amount to count down | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:CountDownByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Limit Model name",
"counterName": "[string]Counter Name",
"userId": "[string]User ID",
"countDownValue": "[int]Amount to count down",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:CountDownByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Limit Model name"
counterName: "[string]Counter Name"
userId: "[string]User ID"
countDownValue: "[int]Amount to count down"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").acquire.count_down_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Limit Model name",
counterName="[string]Counter Name",
userId="[string]User ID",
countDownValue="[int]Amount to count down",
timeOffsetToken="[string]Time offset token",
})Gs2Limit:DeleteCounterByUserId
Delete counter by specifying a user ID
Whether the action allows quantity specification: NO
Whether the action is reversible: NO
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| limitName | string | ✓ | ~ 128 chars | Limit Model name | ||
| userId | string | ✓ | ~ 128 chars | User ID Set #{userId} to replace the currently logged in user ID. | ||
| counterName | string | ✓ | ~ 128 chars | Counter Name | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Limit:DeleteCounterByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"limitName": "[string]Limit Model name",
"userId": "[string]User ID",
"counterName": "[string]Counter Name",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Limit:DeleteCounterByUserId
request:
namespaceName: "[string]Namespace name"
limitName: "[string]Limit Model name"
userId: "[string]User ID"
counterName: "[string]Counter Name"
timeOffsetToken: "[string]Time offset token"transaction.service("limit").acquire.delete_counter_by_user_id({
namespaceName="[string]Namespace name",
limitName="[string]Limit Model name",
userId="[string]User ID",
counterName="[string]Counter Name",
timeOffsetToken="[string]Time offset token",
})