API Reference of GS2-Limit SDK
Model
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Namespace GRN | ||
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Counter
Current value of frequency limit
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
counterId | string | ✓ | ~ 1024 chars | Counter GRN | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
name | string | ✓ | ~ 128 chars | Counter Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
count | int | ✓ | 0 | ~ 2147483646 | count value | |
nextResetAt | long | Next reset timing (Unix time unit:milliseconds) | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
LimitModelMaster
Frequency Limit Master
The reset interval can be set for the limit. The reset interval can be set to daily, weekly, monthly, or not reset. All times are specified in Coordinated Universal Time (UTC).
The maximum number of times limit is not set in the master data. Because the product can be purchased when the purchase count counter is less than 3 times, using a step-up gacha-like mechanism. A product that can be purchased when the aforementioned product cannot be purchased and the purchase count counter is less than 5 times. This is so that the maximum value can be changed depending on the context.
Multiple counters can be created for the count limit settings defined here. For example, if you have a quest reward that can only be received once, instead of having a count limit for each quest By providing a single count limit and a counter for each quest, you can avoid exploding the number of settings.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
limitModelId | string | ✓ | ~ 1024 chars | Limit Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Limit Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | ~ 128 chars | Reset timing | ||
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | Reset hour | |
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thursday |
friday | Friday |
saturday | Saturday |
CurrentLimitMaster
Currently available master data
GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Limit for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available frequency limit setting GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
LogSetting
Log setting
This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
LimitModel
Limit model
The reset interval can be set for the limit. The reset interval can be selected from daily, weekly, monthly, or not reset.
The maximum number of times limit is not set in the master data. Because the system works like a step-up gacha, a product can be purchased when the purchase count counter is less than 3 times. A product that can be purchased when the aforementioned product cannot be purchased and the purchase count counter is less than 5 times. This is so that the maximum value can be changed depending on the context.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
limitModelId | string | ✓ | ~ 1024 chars | Limit Model GRN | ||
name | string | ✓ | ~ 128 chars | Limit Model Name | ||
metadata | string | ~ 2048 chars | metadata | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | ~ 128 chars | Reset timing | ||
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | Reset hour |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thursday |
friday | Friday |
saturday | Saturday |
Methods
describeNamespaces
Get list of namespaces
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&limit.DescribeNamespacesRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeNamespacesRequest;
import io.gs2.limit.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DescribeNamespacesRequest;
using Gs2.Gs2Limit.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Limit.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Limit.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.describe_namespaces(
limit.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('limit')
api_result_handler = client.describe_namespaces_async({
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createNamespace
Create a new namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&limit.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
LogSetting: &limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withLogSetting((new \Gs2\Limit\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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CreateNamespaceRequest;
import io.gs2.limit.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new io.gs2.limit.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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CreateNamespaceRequest;
using Gs2.Gs2Limit.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Limit.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithLogSetting(new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Limit.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new Gs2Limit.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.create_namespace(
limit.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_log_setting(
limit.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('limit')
api_result = client.create_namespace({
name="namespace1",
description=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['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=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['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&limit.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetNamespaceStatusRequest;
import io.gs2.limit.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Limit.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Limit.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Limit.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_namespace_status(
limit.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('limit')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
status = result.status;
getNamespace
Get namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&limit.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetNamespaceRequest;
import io.gs2.limit.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetNamespaceRequest;
using Gs2.Gs2Limit.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Limit.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Limit.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_namespace(
limit.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&limit.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
LogSetting: &limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withLogSetting((new \Gs2\Limit\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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateNamespaceRequest;
import io.gs2.limit.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new io.gs2.limit.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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.UpdateNamespaceRequest;
using Gs2.Gs2Limit.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Limit.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithLogSetting(new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Limit.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new Gs2Limit.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.update_namespace(
limit.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_log_setting(
limit.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('limit')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
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['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
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['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
Delete namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&limit.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteNamespaceRequest;
import io.gs2.limit.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DeleteNamespaceRequest;
using Gs2.Gs2Limit.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Limit.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Limit.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.delete_namespace(
limit.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DumpUserDataByUserIdRequest;
import io.gs2.limit.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Limit.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.dump_user_data_by_user_id(
limit.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
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['message'])
end
result = api_result.result
checkDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of output data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.limit.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Limit.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
limit.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('limit')
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['message'])
end
result = api_result.result
url = result.url;
cleanUserDataByUserId
Get clean data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CleanUserDataByUserIdRequest;
import io.gs2.limit.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Limit.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.clean_user_data_by_user_id(
limit.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
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['message'])
end
result = api_result.result
checkCleanUserDataByUserId
Check if the clean of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.limit.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Limit.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
limit.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
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['message'])
end
result = api_result.result
prepareImportUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL used to upload user data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.limit.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Limit.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
limit.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('limit')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('limit')
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['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.ImportUserDataByUserIdRequest;
import io.gs2.limit.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Limit.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.import_user_data_by_user_id(
limit.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('limit')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
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['message'])
end
result = api_result.result
checkImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of log data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&limit.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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CheckImportUserDataByUserIdRequest;
import io.gs2.limit.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Limit.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Limit.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Limit.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
limit.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('limit')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('limit')
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['message'])
end
result = api_result.result
url = result.url;
describeCounters
Get list of counters
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
limitName | string | ~ 128 chars | Limit Model Name | |||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Counter> | List of Counter |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DescribeCounters(
&limit.DescribeCountersRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
LimitName: pointy.String("daily"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeCountersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCounters(
(new DescribeCountersRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withLimitName("daily")
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeCountersRequest;
import io.gs2.limit.result.DescribeCountersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DescribeCountersResult result = client.describeCounters(
new DescribeCountersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withLimitName("daily")
.withPageToken(null)
.withLimit(null)
);
List<Counter> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DescribeCountersRequest;
using Gs2.Gs2Limit.Result.DescribeCountersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DescribeCountersResult> asyncResult = null;
yield return client.DescribeCounters(
new Gs2.Gs2Limit.Request.DescribeCountersRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithLimitName("daily")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.describeCounters(
new Gs2Limit.DescribeCountersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withLimitName("daily")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.describe_counters(
limit.DescribeCountersRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_limit_name('daily')
.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('limit')
api_result = client.describe_counters({
namespaceName="namespace1",
accessToken="accessToken-0001",
limitName="daily",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('limit')
api_result_handler = client.describe_counters_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
limitName="daily",
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeCountersByUserId
Get list of counters by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
limitName | string | ~ 128 chars | Limit Model Name | |||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Counter> | List of Counter |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DescribeCountersByUserId(
&limit.DescribeCountersByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
LimitName: pointy.String("daily"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeCountersByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCountersByUserId(
(new DescribeCountersByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withLimitName("daily")
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeCountersByUserIdRequest;
import io.gs2.limit.result.DescribeCountersByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DescribeCountersByUserIdResult result = client.describeCountersByUserId(
new DescribeCountersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withLimitName("daily")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Counter> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DescribeCountersByUserIdRequest;
using Gs2.Gs2Limit.Result.DescribeCountersByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DescribeCountersByUserIdResult> asyncResult = null;
yield return client.DescribeCountersByUserId(
new Gs2.Gs2Limit.Request.DescribeCountersByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithLimitName("daily")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.describeCountersByUserId(
new Gs2Limit.DescribeCountersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withLimitName("daily")
.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.describe_counters_by_user_id(
limit.DescribeCountersByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_limit_name('daily')
.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('limit')
api_result = client.describe_counters_by_user_id({
namespaceName="namespace1",
userId="user-0001",
limitName="daily",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('limit')
api_result_handler = client.describe_counters_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
limitName="daily",
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getCounter
Get a Counter
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
counterName | string | ✓ | ~ 128 chars | Counter Name |
Result
Type | Description | |
---|---|---|
item | Counter | Counter |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetCounter(
&limit.GetCounterRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
AccessToken: pointy.String("accessToken-0001"),
CounterName: pointy.String("counter1"),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCounterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounter(
(new GetCounterRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withAccessToken(self::$accessToken0001)
->withCounterName("counter1")
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCounterRequest;
import io.gs2.limit.result.GetCounterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetCounterResult result = client.getCounter(
new GetCounterRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withAccessToken("accessToken-0001")
.withCounterName("counter1")
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetCounterRequest;
using Gs2.Gs2Limit.Result.GetCounterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetCounterResult> asyncResult = null;
yield return client.GetCounter(
new Gs2.Gs2Limit.Request.GetCounterRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithAccessToken("accessToken-0001")
.WithCounterName("counter1"),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getCounter(
new Gs2Limit.GetCounterRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withAccessToken("accessToken-0001")
.withCounterName("counter1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_counter(
limit.GetCounterRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_access_token(self.access_token_0001)
.with_counter_name('counter1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_counter({
namespaceName="namespace1",
limitName="daily",
accessToken="accessToken-0001",
counterName="counter1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_counter_async({
namespaceName="namespace1",
limitName="daily",
accessToken="accessToken-0001",
counterName="counter1",
})
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['message'])
end
result = api_result.result
item = result.item;
getCounterByUserId
Get a counter by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Counter | Counter |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetCounterByUserId(
&limit.GetCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
UserId: pointy.String("user-0001"),
CounterName: pointy.String("counter2"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounterByUserId(
(new GetCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withUserId("user-0001")
->withCounterName("counter2")
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCounterByUserIdRequest;
import io.gs2.limit.result.GetCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetCounterByUserIdResult result = client.getCounterByUserId(
new GetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withUserId("user-0001")
.withCounterName("counter2")
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetCounterByUserIdRequest;
using Gs2.Gs2Limit.Result.GetCounterByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetCounterByUserIdResult> asyncResult = null;
yield return client.GetCounterByUserId(
new Gs2.Gs2Limit.Request.GetCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithUserId("user-0001")
.WithCounterName("counter2")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getCounterByUserId(
new Gs2Limit.GetCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withUserId("user-0001")
.withCounterName("counter2")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_counter_by_user_id(
limit.GetCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_user_id('user-0001')
.with_counter_name('counter2')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_counter_by_user_id({
namespaceName="namespace1",
limitName="daily",
userId="user-0001",
counterName="counter2",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_counter_by_user_id_async({
namespaceName="namespace1",
limitName="daily",
userId="user-0001",
counterName="counter2",
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['message'])
end
result = api_result.result
item = result.item;
countUp
Count-up
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
countUpValue | int | ✓ | 1 | 1 ~ 2147483646 | Amount to count up | |
maxValue | int | 1 ~ 2147483646 | Maximum value allowed to count up |
Result
Type | Description | |
---|---|---|
item | Counter | Counter with increased count |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CountUp(
&limit.CountUpRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
CounterName: pointy.String("counter1"),
AccessToken: pointy.String("accessToken-0001"),
CountUpValue: pointy.Int32(1),
MaxValue: pointy.Int32(100),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountUpRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->countUp(
(new CountUpRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withCounterName("counter1")
->withAccessToken(self::$accessToken0001)
->withCountUpValue(1)
->withMaxValue(100)
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountUpRequest;
import io.gs2.limit.result.CountUpResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CountUpResult result = client.countUp(
new CountUpRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter1")
.withAccessToken("accessToken-0001")
.withCountUpValue(1)
.withMaxValue(100)
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CountUpRequest;
using Gs2.Gs2Limit.Result.CountUpResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CountUpResult> asyncResult = null;
yield return client.CountUp(
new Gs2.Gs2Limit.Request.CountUpRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithCounterName("counter1")
.WithAccessToken("accessToken-0001")
.WithCountUpValue(1)
.WithMaxValue(100),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.countUp(
new Gs2Limit.CountUpRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter1")
.withAccessToken("accessToken-0001")
.withCountUpValue(1)
.withMaxValue(100)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.count_up(
limit.CountUpRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_counter_name('counter1')
.with_access_token(self.access_token_0001)
.with_count_up_value(1)
.with_max_value(100)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.count_up({
namespaceName="namespace1",
limitName="daily",
counterName="counter1",
accessToken="accessToken-0001",
countUpValue=1,
maxValue=100,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.count_up_async({
namespaceName="namespace1",
limitName="daily",
counterName="counter1",
accessToken="accessToken-0001",
countUpValue=1,
maxValue=100,
})
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['message'])
end
result = api_result.result
item = result.item;
countUpByUserId
count-up by the specify user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
userId | string | ✓ | ~ 128 chars | 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 |
Result
Type | Description | |
---|---|---|
item | Counter | Counter with increased count |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CountUpByUserId(
&limit.CountUpByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
CounterName: pointy.String("counter2"),
UserId: pointy.String("user-0001"),
CountUpValue: pointy.Int32(2),
MaxValue: pointy.Int32(100),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountUpByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->countUpByUserId(
(new CountUpByUserIdRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withCounterName("counter2")
->withUserId("user-0001")
->withCountUpValue(2)
->withMaxValue(100)
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountUpByUserIdRequest;
import io.gs2.limit.result.CountUpByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CountUpByUserIdResult result = client.countUpByUserId(
new CountUpByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter2")
.withUserId("user-0001")
.withCountUpValue(2)
.withMaxValue(100)
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CountUpByUserIdRequest;
using Gs2.Gs2Limit.Result.CountUpByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CountUpByUserIdResult> asyncResult = null;
yield return client.CountUpByUserId(
new Gs2.Gs2Limit.Request.CountUpByUserIdRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithCounterName("counter2")
.WithUserId("user-0001")
.WithCountUpValue(2)
.WithMaxValue(100)
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.countUpByUserId(
new Gs2Limit.CountUpByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter2")
.withUserId("user-0001")
.withCountUpValue(2)
.withMaxValue(100)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.count_up_by_user_id(
limit.CountUpByUserIdRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_counter_name('counter2')
.with_user_id('user-0001')
.with_count_up_value(2)
.with_max_value(100)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.count_up_by_user_id({
namespaceName="namespace1",
limitName="daily",
counterName="counter2",
userId="user-0001",
countUpValue=2,
maxValue=100,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.count_up_by_user_id_async({
namespaceName="namespace1",
limitName="daily",
counterName="counter2",
userId="user-0001",
countUpValue=2,
maxValue=100,
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['message'])
end
result = api_result.result
item = result.item;
countDownByUserId
count-down by the specify user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
countDownValue | int | ✓ | 1 | 1 ~ 2147483646 | Amount to count down | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Counter | Counter with increased count |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CountDownByUserId(
&limit.CountDownByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
CounterName: pointy.String("counter2"),
UserId: pointy.String("user-0001"),
CountDownValue: pointy.Int32(2),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountDownByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->countDownByUserId(
(new CountDownByUserIdRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withCounterName("counter2")
->withUserId("user-0001")
->withCountDownValue(2)
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountDownByUserIdRequest;
import io.gs2.limit.result.CountDownByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CountDownByUserIdResult result = client.countDownByUserId(
new CountDownByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter2")
.withUserId("user-0001")
.withCountDownValue(2)
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CountDownByUserIdRequest;
using Gs2.Gs2Limit.Result.CountDownByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CountDownByUserIdResult> asyncResult = null;
yield return client.CountDownByUserId(
new Gs2.Gs2Limit.Request.CountDownByUserIdRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithCounterName("counter2")
.WithUserId("user-0001")
.WithCountDownValue(2)
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.countDownByUserId(
new Gs2Limit.CountDownByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withCounterName("counter2")
.withUserId("user-0001")
.withCountDownValue(2)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.count_down_by_user_id(
limit.CountDownByUserIdRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_counter_name('counter2')
.with_user_id('user-0001')
.with_count_down_value(2)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.count_down_by_user_id({
namespaceName="namespace1",
limitName="daily",
counterName="counter2",
userId="user-0001",
countDownValue=2,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.count_down_by_user_id_async({
namespaceName="namespace1",
limitName="daily",
counterName="counter2",
userId="user-0001",
countDownValue=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['message'])
end
result = api_result.result
item = result.item;
deleteCounterByUserId
Delete counter by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Counter | Deleted counter |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DeleteCounterByUserId(
&limit.DeleteCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("daily"),
UserId: pointy.String("user-0001"),
CounterName: pointy.String("counter1"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteCounterByUserId(
(new DeleteCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withLimitName("daily")
->withUserId("user-0001")
->withCounterName("counter1")
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteCounterByUserIdRequest;
import io.gs2.limit.result.DeleteCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DeleteCounterByUserIdResult result = client.deleteCounterByUserId(
new DeleteCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withUserId("user-0001")
.withCounterName("counter1")
.withTimeOffsetToken(null)
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DeleteCounterByUserIdRequest;
using Gs2.Gs2Limit.Result.DeleteCounterByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DeleteCounterByUserIdResult> asyncResult = null;
yield return client.DeleteCounterByUserId(
new Gs2.Gs2Limit.Request.DeleteCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithLimitName("daily")
.WithUserId("user-0001")
.WithCounterName("counter1")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.deleteCounterByUserId(
new Gs2Limit.DeleteCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withLimitName("daily")
.withUserId("user-0001")
.withCounterName("counter1")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.delete_counter_by_user_id(
limit.DeleteCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_limit_name('daily')
.with_user_id('user-0001')
.with_counter_name('counter1')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.delete_counter_by_user_id({
namespaceName="namespace1",
limitName="daily",
userId="user-0001",
counterName="counter1",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.delete_counter_by_user_id_async({
namespaceName="namespace1",
limitName="daily",
userId="user-0001",
counterName="counter1",
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['message'])
end
result = api_result.result
item = result.item;
verifyCounter
Verify counter value
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
verifyType | enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128 chars | Type of verification | ||
count | int | ✓ | 0 | ~ 2147483646 | count value | |
multiplyValueSpecifyingQuantity | bool | ✓ | true | Whether to multiply the value used for verification when specifying the quantity |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
less | Possession quantity is less than the specified value |
lessEqual | Possession quantity is less than or equal to the specified value |
greater | Possession quantity is greater than the specified value |
greaterEqual | Possession quantity is greater than or equal to the specified value |
equal | Possession quantity is equal to the specified value |
notEqual | Possession quantity is not equal to the specified value |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.VerifyCounter(
&limit.VerifyCounterRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
LimitName: pointy.String("daily"),
CounterName: pointy.String("counter2"),
VerifyType: pointy.String("less"),
Count: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\VerifyCounterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounter(
(new VerifyCounterRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withLimitName("daily")
->withCounterName("counter2")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.VerifyCounterRequest;
import io.gs2.limit.result.VerifyCounterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
VerifyCounterResult result = client.verifyCounter(
new VerifyCounterRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withLimitName("daily")
.withCounterName("counter2")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.VerifyCounterRequest;
using Gs2.Gs2Limit.Result.VerifyCounterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.VerifyCounterResult> asyncResult = null;
yield return client.VerifyCounter(
new Gs2.Gs2Limit.Request.VerifyCounterRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithLimitName("daily")
.WithCounterName("counter2")
.WithVerifyType("less")
.WithCount(10)
.WithMultiplyValueSpecifyingQuantity(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.verifyCounter(
new Gs2Limit.VerifyCounterRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withLimitName("daily")
.withCounterName("counter2")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.verify_counter(
limit.VerifyCounterRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_limit_name('daily')
.with_counter_name('counter2')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.verify_counter({
namespaceName="namespace1",
accessToken="accessToken-0001",
limitName="daily",
counterName="counter2",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
api_result_handler = client.verify_counter_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
limitName="daily",
counterName="counter2",
verifyType="less",
count=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['message'])
end
result = api_result.result
verifyCounterByUserId
Verify counter value by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
limitName | string | ✓ | ~ 128 chars | Name of limit model | ||
counterName | string | ✓ | ~ 128 chars | Counter Name | ||
verifyType | enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128 chars | Type of verification | ||
count | int | ✓ | 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 |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
less | Possession quantity is less than the specified value |
lessEqual | Possession quantity is less than or equal to the specified value |
greater | Possession quantity is greater than the specified value |
greaterEqual | Possession quantity is greater than or equal to the specified value |
equal | Possession quantity is equal to the specified value |
notEqual | Possession quantity is not equal to the specified value |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.VerifyCounterByUserId(
&limit.VerifyCounterByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
LimitName: pointy.String("daily"),
CounterName: pointy.String("counter2"),
VerifyType: pointy.String("less"),
Count: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: nil,
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\VerifyCounterByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounterByUserId(
(new VerifyCounterByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withLimitName("daily")
->withCounterName("counter2")
->withVerifyType("less")
->withCount(10)
->withMultiplyValueSpecifyingQuantity(null)
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.VerifyCounterByUserIdRequest;
import io.gs2.limit.result.VerifyCounterByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
VerifyCounterByUserIdResult result = client.verifyCounterByUserId(
new VerifyCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withLimitName("daily")
.withCounterName("counter2")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.VerifyCounterByUserIdRequest;
using Gs2.Gs2Limit.Result.VerifyCounterByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.VerifyCounterByUserIdResult> asyncResult = null;
yield return client.VerifyCounterByUserId(
new Gs2.Gs2Limit.Request.VerifyCounterByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithLimitName("daily")
.WithCounterName("counter2")
.WithVerifyType("less")
.WithCount(10)
.WithMultiplyValueSpecifyingQuantity(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.verifyCounterByUserId(
new Gs2Limit.VerifyCounterByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withLimitName("daily")
.withCounterName("counter2")
.withVerifyType("less")
.withCount(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.verify_counter_by_user_id(
limit.VerifyCounterByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_limit_name('daily')
.with_counter_name('counter2')
.with_verify_type('less')
.with_count(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.verify_counter_by_user_id({
namespaceName="namespace1",
userId="user-0001",
limitName="daily",
counterName="counter2",
verifyType="less",
count=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('limit')
api_result_handler = client.verify_counter_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
limitName="daily",
counterName="counter2",
verifyType="less",
count=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['message'])
end
result = api_result.result
countUpByStampTask
Execute count-up as consume action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Counter | Counter with increased count |
newContextStack | string | Request of context in which consume action execution results are recorded |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CountUpByStampTask(
&limit.CountUpByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountUpByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->countUpByStampTask(
(new CountUpByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountUpByStampTaskRequest;
import io.gs2.limit.result.CountUpByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CountUpByStampTaskResult result = client.countUpByStampTask(
new CountUpByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
Counter item = result.getItem();
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CountUpByStampTaskRequest;
using Gs2.Gs2Limit.Result.CountUpByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CountUpByStampTaskResult> asyncResult = null;
yield return client.CountUpByStampTask(
new Gs2.Gs2Limit.Request.CountUpByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.countUpByStampTask(
new Gs2Limit.CountUpByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const item = result.getItem();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.count_up_by_stamp_task(
limit.CountUpByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.count_up_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
client = gs2('limit')
api_result_handler = client.count_up_by_stamp_task_async({
stampTask="stampTask",
keyId="key-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['message'])
end
result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
countDownByStampSheet
Execute count-down as an acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Counter | Deleted counter |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CountDownByStampSheet(
&limit.CountDownByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CountDownByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->countDownByStampSheet(
(new CountDownByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CountDownByStampSheetRequest;
import io.gs2.limit.result.CountDownByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CountDownByStampSheetResult result = client.countDownByStampSheet(
new CountDownByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CountDownByStampSheetRequest;
using Gs2.Gs2Limit.Result.CountDownByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CountDownByStampSheetResult> asyncResult = null;
yield return client.CountDownByStampSheet(
new Gs2.Gs2Limit.Request.CountDownByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.countDownByStampSheet(
new Gs2Limit.CountDownByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.count_down_by_stamp_sheet(
limit.CountDownByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.count_down_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.count_down_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-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['message'])
end
result = api_result.result
item = result.item;
deleteByStampSheet
Execute counter deletion as an acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Counter | Deleted counter |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DeleteByStampSheet(
&limit.DeleteByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteByStampSheet(
(new DeleteByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteByStampSheetRequest;
import io.gs2.limit.result.DeleteByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DeleteByStampSheetResult result = client.deleteByStampSheet(
new DeleteByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
Counter item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DeleteByStampSheetRequest;
using Gs2.Gs2Limit.Result.DeleteByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DeleteByStampSheetResult> asyncResult = null;
yield return client.DeleteByStampSheet(
new Gs2.Gs2Limit.Request.DeleteByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.deleteByStampSheet(
new Gs2Limit.DeleteByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.delete_by_stamp_sheet(
limit.DeleteByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.delete_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.delete_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-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['message'])
end
result = api_result.result
item = result.item;
verifyCounterByStampTask
Execute counter value verification as a verify action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Verify Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in which verify action execution results are recorded |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.VerifyCounterByStampTask(
&limit.VerifyCounterByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\VerifyCounterByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyCounterByStampTask(
(new VerifyCounterByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.VerifyCounterByStampTaskRequest;
import io.gs2.limit.result.VerifyCounterByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
VerifyCounterByStampTaskResult result = client.verifyCounterByStampTask(
new VerifyCounterByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.VerifyCounterByStampTaskRequest;
using Gs2.Gs2Limit.Result.VerifyCounterByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.VerifyCounterByStampTaskResult> asyncResult = null;
yield return client.VerifyCounterByStampTask(
new Gs2.Gs2Limit.Request.VerifyCounterByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.verifyCounterByStampTask(
new Gs2Limit.VerifyCounterByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.verify_counter_by_stamp_task(
limit.VerifyCounterByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.verify_counter_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
client = gs2('limit')
api_result_handler = client.verify_counter_by_stamp_task_async({
stampTask="stampTask",
keyId="key-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['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
describeLimitModelMasters
Get list of limit model masters
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<LimitModelMaster> | List of Limit Model Master |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DescribeLimitModelMasters(
&limit.DescribeLimitModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeLimitModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeLimitModelMasters(
(new DescribeLimitModelMastersRequest())
->withNamespaceName(self::namespace1)
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeLimitModelMastersRequest;
import io.gs2.limit.result.DescribeLimitModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DescribeLimitModelMastersResult result = client.describeLimitModelMasters(
new DescribeLimitModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<LimitModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DescribeLimitModelMastersRequest;
using Gs2.Gs2Limit.Result.DescribeLimitModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DescribeLimitModelMastersResult> asyncResult = null;
yield return client.DescribeLimitModelMasters(
new Gs2.Gs2Limit.Request.DescribeLimitModelMastersRequest()
.WithNamespaceName("namespace1")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.describeLimitModelMasters(
new Gs2Limit.DescribeLimitModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.describe_limit_model_masters(
limit.DescribeLimitModelMastersRequest()
.with_namespace_name(self.hash1)
.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('limit')
api_result = client.describe_limit_model_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('limit')
api_result_handler = client.describe_limit_model_masters_async({
namespaceName="namespace1",
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createLimitModelMaster
Create a new limit model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Limit Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | ~ 128 chars | Reset timing | ||
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | Reset hour |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thursday |
friday | Friday |
saturday | Saturday |
Result
Type | Description | |
---|---|---|
item | LimitModelMaster | Created limit model master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.CreateLimitModelMaster(
&limit.CreateLimitModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("limit-model-0001"),
Description: nil,
Metadata: nil,
ResetType: pointy.String("monthly"),
ResetDayOfMonth: pointy.Int32(1),
ResetDayOfWeek: pointy.String("monday"),
ResetHour: pointy.Int32(5),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\CreateLimitModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createLimitModelMaster(
(new CreateLimitModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("limit-model-0001")
->withDescription(null)
->withMetadata(null)
->withResetType("monthly")
->withResetDayOfMonth(1)
->withResetDayOfWeek("monday")
->withResetHour(5)
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.CreateLimitModelMasterRequest;
import io.gs2.limit.result.CreateLimitModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
CreateLimitModelMasterResult result = client.createLimitModelMaster(
new CreateLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withName("limit-model-0001")
.withDescription(null)
.withMetadata(null)
.withResetType("monthly")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(5)
);
LimitModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.CreateLimitModelMasterRequest;
using Gs2.Gs2Limit.Result.CreateLimitModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.CreateLimitModelMasterResult> asyncResult = null;
yield return client.CreateLimitModelMaster(
new Gs2.Gs2Limit.Request.CreateLimitModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("limit-model-0001")
.WithDescription(null)
.WithMetadata(null)
.WithResetType("monthly")
.WithResetDayOfMonth(1)
.WithResetDayOfWeek("monday")
.WithResetHour(5),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.createLimitModelMaster(
new Gs2Limit.CreateLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withName("limit-model-0001")
.withDescription(null)
.withMetadata(null)
.withResetType("monthly")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(5)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.create_limit_model_master(
limit.CreateLimitModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('limit-model-0001')
.with_description(None)
.with_metadata(None)
.with_reset_type('monthly')
.with_reset_day_of_month(1)
.with_reset_day_of_week('monday')
.with_reset_hour(5)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.create_limit_model_master({
namespaceName="namespace1",
name="limit-model-0001",
description=nil,
metadata=nil,
resetType="monthly",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=5,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.create_limit_model_master_async({
namespaceName="namespace1",
name="limit-model-0001",
description=nil,
metadata=nil,
resetType="monthly",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=5,
})
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['message'])
end
result = api_result.result
item = result.item;
getLimitModelMaster
Get a limit model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Limit Model Name |
Result
Type | Description | |
---|---|---|
item | LimitModelMaster | Limit Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetLimitModelMaster(
&limit.GetLimitModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetLimitModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getLimitModelMaster(
(new GetLimitModelMasterRequest())
->withNamespaceName(self::namespace1)
->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetLimitModelMasterRequest;
import io.gs2.limit.result.GetLimitModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetLimitModelMasterResult result = client.getLimitModelMaster(
new GetLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
LimitModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetLimitModelMasterRequest;
using Gs2.Gs2Limit.Result.GetLimitModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetLimitModelMasterResult> asyncResult = null;
yield return client.GetLimitModelMaster(
new Gs2.Gs2Limit.Request.GetLimitModelMasterRequest()
.WithNamespaceName("namespace1")
.WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getLimitModelMaster(
new Gs2Limit.GetLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_limit_model_master(
limit.GetLimitModelMasterRequest()
.with_namespace_name(self.hash1)
.with_limit_name('limit-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_limit_model_master({
namespaceName="namespace1",
limitName="limit-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_limit_model_master_async({
namespaceName="namespace1",
limitName="limit-model-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['message'])
end
result = api_result.result
item = result.item;
updateLimitModelMaster
Update limit model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Limit Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | ~ 128 chars | Reset timing | ||
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓ | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | ~ 23 | Reset hour |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thursday |
friday | Friday |
saturday | Saturday |
Result
Type | Description | |
---|---|---|
item | LimitModelMaster | Updated limit model master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.UpdateLimitModelMaster(
&limit.UpdateLimitModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("limit-model-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
ResetType: pointy.String("daily"),
ResetDayOfMonth: pointy.Int32(1),
ResetDayOfWeek: pointy.String("monday"),
ResetHour: pointy.Int32(18),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateLimitModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateLimitModelMaster(
(new UpdateLimitModelMasterRequest())
->withNamespaceName(self::namespace1)
->withLimitName("limit-model-0001")
->withDescription("description1")
->withMetadata("{\"hoge\": \"fuga\"}")
->withResetType("daily")
->withResetDayOfMonth(1)
->withResetDayOfWeek("monday")
->withResetHour(18)
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateLimitModelMasterRequest;
import io.gs2.limit.result.UpdateLimitModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
UpdateLimitModelMasterResult result = client.updateLimitModelMaster(
new UpdateLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withResetType("daily")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(18)
);
LimitModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.UpdateLimitModelMasterRequest;
using Gs2.Gs2Limit.Result.UpdateLimitModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.UpdateLimitModelMasterResult> asyncResult = null;
yield return client.UpdateLimitModelMaster(
new Gs2.Gs2Limit.Request.UpdateLimitModelMasterRequest()
.WithNamespaceName("namespace1")
.WithLimitName("limit-model-0001")
.WithDescription("description1")
.WithMetadata("{\"hoge\": \"fuga\"}")
.WithResetType("daily")
.WithResetDayOfMonth(1)
.WithResetDayOfWeek("monday")
.WithResetHour(18),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.updateLimitModelMaster(
new Gs2Limit.UpdateLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withResetType("daily")
.withResetDayOfMonth(1)
.withResetDayOfWeek("monday")
.withResetHour(18)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.update_limit_model_master(
limit.UpdateLimitModelMasterRequest()
.with_namespace_name(self.hash1)
.with_limit_name('limit-model-0001')
.with_description('description1')
.with_metadata('{"hoge": "fuga"}')
.with_reset_type('daily')
.with_reset_day_of_month(1)
.with_reset_day_of_week('monday')
.with_reset_hour(18)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.update_limit_model_master({
namespaceName="namespace1",
limitName="limit-model-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
resetType="daily",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=18,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.update_limit_model_master_async({
namespaceName="namespace1",
limitName="limit-model-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
resetType="daily",
resetDayOfMonth=1,
resetDayOfWeek="monday",
resetHour=18,
})
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['message'])
end
result = api_result.result
item = result.item;
deleteLimitModelMaster
Delete limit model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Limit Model Name |
Result
Type | Description | |
---|---|---|
item | LimitModelMaster | Deleted limit model master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DeleteLimitModelMaster(
&limit.DeleteLimitModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DeleteLimitModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteLimitModelMaster(
(new DeleteLimitModelMasterRequest())
->withNamespaceName(self::namespace1)
->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DeleteLimitModelMasterRequest;
import io.gs2.limit.result.DeleteLimitModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DeleteLimitModelMasterResult result = client.deleteLimitModelMaster(
new DeleteLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
LimitModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DeleteLimitModelMasterRequest;
using Gs2.Gs2Limit.Result.DeleteLimitModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DeleteLimitModelMasterResult> asyncResult = null;
yield return client.DeleteLimitModelMaster(
new Gs2.Gs2Limit.Request.DeleteLimitModelMasterRequest()
.WithNamespaceName("namespace1")
.WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.deleteLimitModelMaster(
new Gs2Limit.DeleteLimitModelMasterRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.delete_limit_model_master(
limit.DeleteLimitModelMasterRequest()
.with_namespace_name(self.hash1)
.with_limit_name('limit-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.delete_limit_model_master({
namespaceName="namespace1",
limitName="limit-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.delete_limit_model_master_async({
namespaceName="namespace1",
limitName="limit-model-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['message'])
end
result = api_result.result
item = result.item;
exportMaster
Export master data for currently available limit settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentLimitMaster | Currently available limit settings |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&limit.ExportMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.ExportMasterRequest;
import io.gs2.limit.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentLimitMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.ExportMasterRequest;
using Gs2.Gs2Limit.Result.ExportMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Limit.Request.ExportMasterRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.exportMaster(
new Gs2Limit.ExportMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.export_master(
limit.ExportMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.export_master({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.export_master_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
item = result.item;
getCurrentLimitMaster
Get the currently available count limit setting
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentLimitMaster | Currently available limit settings |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetCurrentLimitMaster(
&limit.GetCurrentLimitMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetCurrentLimitMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentLimitMaster(
(new GetCurrentLimitMasterRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetCurrentLimitMasterRequest;
import io.gs2.limit.result.GetCurrentLimitMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetCurrentLimitMasterResult result = client.getCurrentLimitMaster(
new GetCurrentLimitMasterRequest()
.withNamespaceName("namespace1")
);
CurrentLimitMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetCurrentLimitMasterRequest;
using Gs2.Gs2Limit.Result.GetCurrentLimitMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetCurrentLimitMasterResult> asyncResult = null;
yield return client.GetCurrentLimitMaster(
new Gs2.Gs2Limit.Request.GetCurrentLimitMasterRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getCurrentLimitMaster(
new Gs2Limit.GetCurrentLimitMasterRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_current_limit_master(
limit.GetCurrentLimitMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_current_limit_master({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_current_limit_master_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
item = result.item;
updateCurrentLimitMaster
Update the currently available count limit settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
Result
Type | Description | |
---|---|---|
item | CurrentLimitMaster | Updated, currently available limit settings |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.UpdateCurrentLimitMaster(
&limit.UpdateCurrentLimitMasterRequest {
NamespaceName: pointy.String("namespace1"),
Settings: pointy.String("{\n \"version\": \"2019-04-05\",\n \"limitModels\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"resetType\": \"daily\",\n \"resetHour\": 9\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"sunday\",\n \"resetHour\": 18\n }\n ]\n}"),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateCurrentLimitMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentLimitMaster(
(new UpdateCurrentLimitMasterRequest())
->withNamespaceName(self::namespace1)
->withSettings("{\n \"version\": \"2019-04-05\",\n \"limitModels\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"resetType\": \"daily\",\n \"resetHour\": 9\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"sunday\",\n \"resetHour\": 18\n }\n ]\n}")
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateCurrentLimitMasterRequest;
import io.gs2.limit.result.UpdateCurrentLimitMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
UpdateCurrentLimitMasterResult result = client.updateCurrentLimitMaster(
new UpdateCurrentLimitMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2019-04-05\",\n \"limitModels\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"resetType\": \"daily\",\n \"resetHour\": 9\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"sunday\",\n \"resetHour\": 18\n }\n ]\n}")
);
CurrentLimitMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterRequest;
using Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterResult> asyncResult = null;
yield return client.UpdateCurrentLimitMaster(
new Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterRequest()
.WithNamespaceName("namespace1")
.WithSettings("{\n \"version\": \"2019-04-05\",\n \"limitModels\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"resetType\": \"daily\",\n \"resetHour\": 9\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"sunday\",\n \"resetHour\": 18\n }\n ]\n}"),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.updateCurrentLimitMaster(
new Gs2Limit.UpdateCurrentLimitMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\n \"version\": \"2019-04-05\",\n \"limitModels\": [\n {\n \"name\": \"daily\",\n \"metadata\": \"DAILY\",\n \"resetType\": \"daily\",\n \"resetHour\": 9\n },\n {\n \"name\": \"weekly\",\n \"metadata\": \"WEEKLY\",\n \"resetType\": \"weekly\",\n \"resetDayOfWeek\": \"sunday\",\n \"resetHour\": 18\n }\n ]\n}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.update_current_limit_master(
limit.UpdateCurrentLimitMasterRequest()
.with_namespace_name(self.hash1)
.with_settings('{\n "version": "2019-04-05",\n "limitModels": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "resetType": "daily",\n "resetHour": 9\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "resetType": "weekly",\n "resetDayOfWeek": "sunday",\n "resetHour": 18\n }\n ]\n}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.update_current_limit_master({
namespaceName="namespace1",
settings="{\n "version": "2019-04-05",\n "limitModels": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "resetType": "daily",\n "resetHour": 9\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "resetType": "weekly",\n "resetDayOfWeek": "sunday",\n "resetHour": 18\n }\n ]\n}",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.update_current_limit_master_async({
namespaceName="namespace1",
settings="{\n "version": "2019-04-05",\n "limitModels": [\n {\n "name": "daily",\n "metadata": "DAILY",\n "resetType": "daily",\n "resetHour": 9\n },\n {\n "name": "weekly",\n "metadata": "WEEKLY",\n "resetType": "weekly",\n "resetDayOfWeek": "sunday",\n "resetHour": 18\n }\n ]\n}",
})
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['message'])
end
result = api_result.result
item = result.item;
updateCurrentLimitMasterFromGitHub
Update the currently available count limit settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
Type | Description | |
---|---|---|
item | CurrentLimitMaster | Updated, currently available limit settings |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.UpdateCurrentLimitMasterFromGitHub(
&limit.UpdateCurrentLimitMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace1"),
CheckoutSetting: &limit.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\UpdateCurrentLimitMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentLimitMasterFromGitHub(
(new UpdateCurrentLimitMasterFromGitHubRequest())
->withNamespaceName(self::namespace1)
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.UpdateCurrentLimitMasterFromGitHubRequest;
import io.gs2.limit.result.UpdateCurrentLimitMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
UpdateCurrentLimitMasterFromGitHubResult result = client.updateCurrentLimitMasterFromGitHub(
new UpdateCurrentLimitMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentLimitMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterFromGitHubRequest;
using Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.UpdateCurrentLimitMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentLimitMasterFromGitHub(
new Gs2.Gs2Limit.Request.UpdateCurrentLimitMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting(new Gs2.Gs2Limit.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.updateCurrentLimitMasterFromGitHub(
new Gs2Limit.UpdateCurrentLimitMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new Gs2Limit.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.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 limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.update_current_limit_master_from_git_hub(
limit.UpdateCurrentLimitMasterFromGitHubRequest()
.with_namespace_name(self.hash1)
.with_checkout_setting(limit.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.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('limit')
api_result = client.update_current_limit_master_from_git_hub({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
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['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.update_current_limit_master_from_git_hub_async({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
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['message'])
end
result = api_result.result
item = result.item;
describeLimitModels
Get list of limit models
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<LimitModel> | List of Limit Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.DescribeLimitModels(
&limit.DescribeLimitModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\DescribeLimitModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeLimitModels(
(new DescribeLimitModelsRequest())
->withNamespaceName(self::namespace1)
);
$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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.DescribeLimitModelsRequest;
import io.gs2.limit.result.DescribeLimitModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
DescribeLimitModelsResult result = client.describeLimitModels(
new DescribeLimitModelsRequest()
.withNamespaceName("namespace1")
);
List<LimitModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.DescribeLimitModelsRequest;
using Gs2.Gs2Limit.Result.DescribeLimitModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.DescribeLimitModelsResult> asyncResult = null;
yield return client.DescribeLimitModels(
new Gs2.Gs2Limit.Request.DescribeLimitModelsRequest()
.WithNamespaceName("namespace1"),
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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.describeLimitModels(
new Gs2Limit.DescribeLimitModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.describe_limit_models(
limit.DescribeLimitModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.describe_limit_models({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('limit')
api_result_handler = client.describe_limit_models_async({
namespaceName="namespace1",
})
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['message'])
end
result = api_result.result
items = result.items;
getLimitModel
Get limit model
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
limitName | string | ✓ | ~ 128 chars | Limit Model Name |
Result
Type | Description | |
---|---|---|
item | LimitModel | Limit Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/limit"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := limit.Gs2LimitRestClient{
Session: &session,
}
result, err := client.GetLimitModel(
&limit.GetLimitModelRequest {
NamespaceName: pointy.String("namespace1"),
LimitName: pointy.String("limit-model-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\Limit\Gs2LimitRestClient;
use Gs2\Limit\Request\GetLimitModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getLimitModel(
(new GetLimitModelRequest())
->withNamespaceName(self::namespace1)
->withLimitName("limit-model-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.limit.rest.Gs2LimitRestClient;
import io.gs2.limit.request.GetLimitModelRequest;
import io.gs2.limit.result.GetLimitModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LimitRestClient client = new Gs2LimitRestClient(session);
try {
GetLimitModelResult result = client.getLimitModel(
new GetLimitModelRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
LimitModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Limit.Gs2LimitRestClient;
using Gs2.Gs2Limit.Request.GetLimitModelRequest;
using Gs2.Gs2Limit.Result.GetLimitModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LimitRestClient(session);
AsyncResult<Gs2.Gs2Limit.Result.GetLimitModelResult> asyncResult = null;
yield return client.GetLimitModel(
new Gs2.Gs2Limit.Request.GetLimitModelRequest()
.WithNamespaceName("namespace1")
.WithLimitName("limit-model-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 Gs2Limit from '@/gs2/limit';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Limit.Gs2LimitRestClient(session);
try {
const result = await client.getLimitModel(
new Gs2Limit.GetLimitModelRequest()
.withNamespaceName("namespace1")
.withLimitName("limit-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import limit
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = limit.Gs2LimitRestClient(session)
try:
result = client.get_limit_model(
limit.GetLimitModelRequest()
.with_namespace_name(self.hash1)
.with_limit_name('limit-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('limit')
api_result = client.get_limit_model({
namespaceName="namespace1",
limitName="limit-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('limit')
api_result_handler = client.get_limit_model_async({
namespaceName="namespace1",
limitName="limit-model-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['message'])
end
result = api_result.result
item = result.item;