API Reference of GS2-Distributor SDK for Game Engine

Model

EzConfig

Configration

Set values to be applied to transaction variables

TypeRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

EzDistributorModel

Delivery Setting Model

A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota. By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsDelivery setting name
metadatastring~ 2048 charsmetadata
inboxNamespaceIdstring~ 1024 charsGS2-Inbox namespace GRN to transfer overflow resources
whiteListTargetIdsList<string>[]~ 1000 itemsWhitelist of target resource GRNs that can be processed through the distributor

EzDistributeResource

Distribute Resource

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring~ 1048576 charsJSON of request

EzStampSheetResult

Transaction execution results

Transaction execution results executed using server-side transaction auto-execution functionality

TypeRequireDefaultLimitationDescription
transactionIdstring36 ~ 36 charsTransaction ID
taskRequestsList<EzConsumeAction>~ 100 itemsList of consume action request payload
sheetRequestEzAcquireActionAcquire action request payload
taskResultsList<string>~ 100 itemsConsume action execution results
sheetResultstring~ 1048576 charsAcquire action execution results

EzBatchRequestPayload

API Batch Request

TypeRequireDefaultLimitationDescription
requestIdstring~ 128 charsRequest ID
serviceenum {
    “account”,
    “adReward”,
    “auth”,
    “buff”,
    “chat”,
    “datastore”,
    “deploy”,
    “dictionary”,
    “distributor”,
    “enchant”,
    “enhance”,
    “exchange”,
    “experience”,
    “formation”,
    “friend”,
    “gateway”,
    “grade”,
    “guard”,
    “guild”,
    “identifier”,
    “idle”,
    “inbox”,
    “inventory”,
    “jobQueue”,
    “key”,
    “limit”,
    “lock”,
    “log”,
    “loginReward”,
    “lottery”,
    “matchmaking”,
    “megaField”,
    “mission”,
    “money”,
    “money2”,
    “news”,
    “quest”,
    “ranking”,
    “ranking2”,
    “realtime”,
    “schedule”,
    “script”,
    “seasonRating”,
    “serialKey”,
    “showcase”,
    “skillTree”,
    “stamina”,
    “stateMachine”,
    “version”
}
~ 128 charsService
methodNamestring~ 128 charsMethod Name
parameterstring~ 10240 charsMethod Name

Enumeration type definition to specify as service

Enumerator String DefinitionDescription
accountGS2-Account
adRewardGS2-AdReward
authGS2-Auth
buffGS2-Buff
chatGS2-Chat
datastoreGS2-Datastore
deployGS2-Deploy
dictionaryGS2-Dictionary
distributorGS2-Distributor
enchantGS2-Enchant
enhanceGS2-Enhance
exchangeGS2-Exchange
experienceGS2-Experience
formationGS2-Formation
friendGS2-Friend
gatewayGS2-Gateway
gradeGS2-Grade
guardGS2-Guard
guildGS2-Guild
identifierGS2-Identifier
idleGS2-Idle
inboxGS2-Inbox
inventoryGS2-Inventory
jobQueueGS2-JobQueue
keyGS2-Key
limitGS2-Limit
lockGS2-Lock
logGS2-Log
loginRewardGS2-LoginReward
lotteryGS2-Lottery
matchmakingGS2-Matchmaking
megaFieldGS2-MegaField
missionGS2-Mission
moneyGS2-Money
money2GS2-Money2
newsGS2-News
questGS2-Quest
rankingGS2-Ranking
ranking2GS2-Ranking2
realtimeGS2-Realtime
scheduleGS2-Schedule
scriptGS2-Script
seasonRatingGS2-SeasonRating
serialKeyGS2-SerialKey
showcaseGS2-Showcase
skillTreeGS2-SkillTree
staminaGS2-Stamina
stateMachineGS2-StateMachine
versionGS2-Version

EzBatchResultPayload

API Batch Result

TypeRequireDefaultLimitationDescription
requestIdstring~ 128 charsRequest ID
statusCodeint100 ~ 1000Status Code
resultPayloadstring~ 10240 charsResponse

EzAcquireAction

Acquire Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring~ 1048576 charsJSON of request

EzConsumeAction

Consume Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
~ 128 charsTypes of actions to be performed in the consume action
requeststring~ 1048576 charsJSON of request

EzVerifyAction

Verify Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
}
~ 128 charsTypes of actions to be performed in the verify task
requeststring~ 1048576 charsJSON of request

EzTransactionResult

Transaction execution results

Transaction execution results executed using server-side transaction auto-execution functionality

TypeRequireDefaultLimitationDescription
transactionIdstring36 ~ 36 charsTransaction ID
verifyResultsList<EzVerifyActionResult>~ 100 itemsList of verify action execution results
consumeResultsList<EzConsumeActionResult>~ 100 itemsList of consume action execution results
acquireResultsList<EzAcquireActionResult>~ 100 itemsList of acquire action execution results

EzAcquireActionResult

Acquire action execution result

TypeRequireDefaultLimitationDescription
acquireRequeststring~ 1048576 charsJSON of request
statusCodeint~ 999Status code
acquireResultstring~ 1048576 charsResult payload

EzConsumeActionResult

Consume action execution result

TypeRequireDefaultLimitationDescription
consumeRequeststring~ 1048576 charsJSON of request
statusCodeint~ 999Status code
consumeResultstring~ 1048576 charsResult payload

EzVerifyActionResult

Verify action execution result

TypeRequireDefaultLimitationDescription
verifyRequeststring~ 1048576 charsJSON of request
statusCodeint~ 999Status code
verifyResultstring~ 1048576 charsResult payload

Methods

getDistributorModel

Get delivery settings

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsDelivery setting name

Result

TypeDescription
itemEzDistributorModelDelivery Setting

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).DistributorModel(
        distributorName: "distributor-model-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).DistributorModel(
        distributorName: "distributor-model-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->DistributorModel(
        "distributor-model-0001" // distributorName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).DistributorModel(
        distributorName: "distributor-model-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).DistributorModel(
        distributorName: "distributor-model-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->DistributorModel(
        "distributor-model-0001" // distributorName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Distributor::Model::FDistributorModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listDistributorModels

Get list of delivery settings

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemsList<EzDistributorModel>List of delivery settings

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.DistributorModelsAsync(
    ).ToListAsync();
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.DistributorModels(
    );
    List<EzDistributorModel> items = new List<EzDistributorModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->DistributorModels(
    );
    TArray<Gs2::UE5::Distributor::Model::FEzDistributorModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeDistributorModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeDistributorModels(callbackId);
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.DistributorModels(
    );
    List<EzDistributorModel> items = new List<EzDistributorModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeDistributorModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeDistributorModels(CallbackId);

batchExecuteApi

Batch execution of APIs

Request

TypeRequireDefaultLimitationDescription
requestPayloadsList<EzBatchRequestPayload>1 ~ 100 itemsBatch request

Result

TypeDescription
resultsList<EzBatchResultPayload>Batch result

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: null
    );
    var result = await domain.BatchExecuteApiAsync(
        requestPayloads: new List<Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload> {
            new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
                Service = "inventory",
                Method = "describeSimpleItems",
                Request = "{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}",
            },
            new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
                Service = "exchange",
                Method = "describeRateModels",
                Request = "{\"namespaceName\": \"namespace-0001\"}",
            },
        }
    );
    var results = result.Results;
    var domain = gs2.Distributor.Namespace(
        namespaceName: null
    );
    var future = domain.BatchExecuteApiFuture(
        requestPayloads: new List<Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload> {
            new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
                Service = "inventory",
                Method = "describeSimpleItems",
                Request = "{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}",
            },
            new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
                Service = "exchange",
                Method = "describeRateModels",
                Request = "{\"namespaceName\": \"namespace-0001\"}",
            },
        }
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var results = future.Result.Results;
    const auto Domain = Gs2->Distributor->Namespace(
        nullptr // namespaceName
    );
    const auto Future = Domain->BatchExecuteApi(
        []
        {
            auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>>>();
            v->Add(
                MakeShared<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>()
                ->WithService(TOptional<FString>("inventory"))
                ->WithMethod(TOptional<FString>("describeSimpleItems"))
                ->WithRequest(TOptional<FString>("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}"))
            );
            v->Add(
                MakeShared<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>()
                ->WithService(TOptional<FString>("exchange"))
                ->WithMethod(TOptional<FString>("describeRateModels"))
                ->WithRequest(TOptional<FString>("{\"namespaceName\": \"namespace-0001\"}"))
            );
            return v;
        }() // requestPayloads
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();
    const auto Results = Result->Results;

freezeMasterData

Issue a Context Stack that holds the information to fix the contents at the time of calling this API in the Master Data.

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
newContextStackstringRequest of context in time to freeze the master data

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Distribute(
    );
    var result = await domain.FreezeMasterDataAsync(
        accessToken: 
    );
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Distribute(
    );
    var future = domain.FreezeMasterDataFuture(
        accessToken: 
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Distribute(
    );
    const auto Future = Domain->FreezeMasterData(
         // accessToken
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();

freezeMasterDataBySignedTimestamp

Issue a Context Stack that holds the information to fix the contents at the time of signing the timestamp in the Master Data. Signed timestamps can be issued with SignFreezeMasterDataTimestamp.

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
bodystring~ 1024 charsBody
signaturestring~ 256 charsSignature
keyIdstring~ 1024 charsGS2-Key GRN of the cryptographic key used for signature calculation

Result

TypeDescription
newContextStackstringRequest of context in time to freeze the master data

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Distribute(
    );
    var result = await domain.FreezeMasterDataBySignedTimestampAsync(
        accessToken: ,
        body: "body",
        signature: "signature",
        keyId: 
    );
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Distribute(
    );
    var future = domain.FreezeMasterDataBySignedTimestampFuture(
        accessToken: ,
        body: "body",
        signature: "signature",
        keyId: 
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Distribute(
    );
    const auto Future = Domain->FreezeMasterDataBySignedTimestamp(
        , // accessToken
        "body", // body
        "signature", // signature
         // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();

runStampSheet

Run acquire action

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runStampSheetExpress

Batch execution of verify actions, consume actions, and acquire actions in transactions

Batch execution reduces response time. However, there is no guarantee of a correct retry in the event of failure in the process of transaction execution. It is strongly recommended to keep a log of transaction execution in GS2-Log in case execution fails, so that appropriate action can be taken during customer support.

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
verifyTaskResultCodesList<int>Verify action execution status code
verifyTaskResultsList<string>Verify action execution results
taskResultCodesList<int>Consume action execution status code
taskResultsList<string>Consume action execution results
sheetResultCodeintAcquire action execution status code
sheetResultstringAcquire action execution result response content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runStampSheetExpressWithoutNamespace

Batch execution of verify actions, consume actions, and acquire actions in transactions

Batch execution reduces response time. However, there is no guarantee of a correct retry in the event of failure in the process of transaction execution. It is strongly recommended to keep a log of transaction execution in GS2-Log in case execution fails, so that appropriate action can be taken during customer support.

By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.

Request

TypeRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
verifyTaskResultCodesList<int>Verify action execution status code
verifyTaskResultsList<string>Verify action execution results
taskResultCodesList<int>Consume action execution status code
taskResultsList<string>Consume action execution results
sheetResultCodeintAcquire action execution status code
sheetResultstringAcquire action execution result response content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runStampSheetWithoutNamespace

Run acquire action without specifying namespace

By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.

Request

TypeRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runStampTask

Run consume action

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampTaskstring~ 5242880 charsConsume Action
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runStampTaskWithoutNamespace

Run consume action without specifying namespace

By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.

Request

TypeRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsConsume Action
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runVerifyTask

Run verify action

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
verifyTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

runVerifyTaskWithoutNamespace

Run verify action without specifying namespace

By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.

Request

TypeRequireDefaultLimitationDescription
verifyTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN
contextStackstring~ 32768 charsContext of request

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API

setDefaultConfig

Issue a Context Stack that holds the default values of Config to be specified in the Transaction Issuance API.

Request

TypeRequireDefaultLimitationDescription
accessTokenstring~ 128 charsUser Id
configList<EzConfig>1 ~ 1000 itemsTransaction placeholder applied settings values

Result

TypeDescription
newContextStackstringContext stack reflecting the results of the task

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: null
    );
    var result = await domain.SetDefaultConfigAsync(
        accessToken: ,
        config: new List<Gs2.Unity.Gs2Distributor.Model.EzConfig> {
            new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
                Key = "key-0001",
                Value = "value-0001",
            },
            new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
                Key = "key-0002",
                Value = "value-0002",
            },
        }
    );
    var domain = gs2.Distributor.Namespace(
        namespaceName: null
    );
    var future = domain.SetDefaultConfigFuture(
        accessToken: ,
        config: new List<Gs2.Unity.Gs2Distributor.Model.EzConfig> {
            new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
                Key = "key-0001",
                Value = "value-0001",
            },
            new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
                Key = "key-0002",
                Value = "value-0002",
            },
        }
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    const auto Domain = Gs2->Distributor->Namespace(
        nullptr // namespaceName
    );
    const auto Future = Domain->SetDefaultConfig(
        , // accessToken
        []
        {
            auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Distributor::Model::FEzConfig>>>();
            v->Add(
                MakeShared<Gs2::UE5::Distributor::Model::FEzConfig>()
                ->WithKey(TOptional<FString>("key-0001"))
                ->WithValue(TOptional<FString>("value-0001"))
            );
            v->Add(
                MakeShared<Gs2::UE5::Distributor::Model::FEzConfig>()
                ->WithKey(TOptional<FString>("key-0002"))
                ->WithValue(TOptional<FString>("value-0002"))
            );
            return v;
        }() // config
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();

getStampSheetResult

Get transaction execution results

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
transactionIdstring36 ~ 36 charsTransaction ID

Result

TypeDescription
itemEzStampSheetResultTransaction execution results

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).StampSheetResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).StampSheetResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->StampSheetResult(
        "cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).StampSheetResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).StampSheetResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->StampSheetResult(
        "cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Distributor::Model::FStampSheetResult> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

getTransactionResult

Get transaction execution results

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
transactionIdstring36 ~ 36 charsTransaction ID

Result

TypeDescription
itemEzTransactionResultTransaction execution results

Implementation Example

    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).TransactionResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).TransactionResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->TransactionResult(
        "cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).TransactionResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Distributor.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).TransactionResult(
        transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Distributor->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->TransactionResult(
        "cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Distributor::Model::FTransactionResult> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

Event Handler

OnAutoRunStampSheetNotification

Notification when transaction auto-execution is complete

NameTypeDescription
namespaceNamestringNamespace name
userIdstringUser Id
transactionIdstringTransaction ID

Implementation Example

    gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
    {
        var namespaceName = notification.NamespaceName;
        var userId = notification.UserId;
        var transactionId = notification.TransactionId;
    };
    gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
    {
        var namespaceName = notification.NamespaceName;
        var userId = notification.UserId;
        var transactionId = notification.TransactionId;
    };
    Gs2->Distributor->OnAutoRunStampSheetNotification().AddLambda([](const auto Notification)
    {
        const auto NamespaceName = Notification->NamespaceNameValue;
        const auto UserId = Notification->UserIdValue;
        const auto TransactionId = Notification->TransactionIdValue;
    });

OnAutoRunTransactionNotification

Notification when transaction auto-execution is complete

NameTypeDescription
namespaceNamestringNamespace name
userIdstringUser Id
transactionIdstringTransaction ID

Implementation Example

    gs2.Distributor.OnAutoRunTransactionNotification += notification =>
    {
        var namespaceName = notification.NamespaceName;
        var userId = notification.UserId;
        var transactionId = notification.TransactionId;
    };
    gs2.Distributor.OnAutoRunTransactionNotification += notification =>
    {
        var namespaceName = notification.NamespaceName;
        var userId = notification.UserId;
        var transactionId = notification.TransactionId;
    };
    Gs2->Distributor->OnAutoRunTransactionNotification().AddLambda([](const auto Notification)
    {
        const auto NamespaceName = Notification->NamespaceNameValue;
        const auto UserId = Notification->UserIdValue;
        const auto TransactionId = Notification->TransactionIdValue;
    });