gifts
« Previous section Next section »
UCloud Developer Guide / Accounting and Project Management / Grants / Gifts
Gifts
Gifts provide the system a way to grant new and existing users (personal projects) credits from a project
Rationale
The gifting system is primarily intended to provide credits to new users when they join the system. A Gift
follows the same rules as Wallets
do. This means that in order to give a gift to someone you must transfer the resources from a project. This means that the credits will be subtracted directly from the source project.
A Gift
can only be claimed once by every user and it will be applied directly to the user's personal project. Clients used by the end-user should use Gifts.availableGifts
to figure out which Gift
s are unclaimed by this user. It may then claim the individual Gift
s with Gifts.claimGift
.
Administrators of a project can manage Gift
s through the Gifts.createGift
, Gifts.deleteGift
and Gifts.listGifts
endpoints.
⚠️ WARNING: The API listed on this page will likely change to conform with our API conventions. Be careful when building integrations. The following changes are expected:
RPC names will change to conform with the conventions
RPC request and response types will change to conform with the conventions
RPCs which return a page will be collapsed into a single
browse
endpointSome property names will change to be consistent with
Resource
s
Table of Contents
Remote Procedure Calls
availableGifts
availableGifts
Finds a list of a user's unclaimed Gift
s
Request | Response | Error |
---|---|---|
claimGift
claimGift
Claims a Gift
to the calling user's personal project
Request | Response | Error |
---|---|---|
User errors:
Users who are not eligible for claiming this
Gift
will receive an appropriate error code.If the gifting project has run out of resources then this endpoint will fail. The gift will not be marked as claimed.
createGift
createGift
Creates a new Gift in the system
Request | Response | Error |
---|---|---|
Only project administrators can create new Gift
s in the system.
deleteGift
deleteGift
Deletes a Gift by its DeleteGiftRequest.giftId
Request | Response | Error |
---|---|---|
Only project administrators of Gift.resourcesOwnedBy
can delete the Gift
.
Data Models
GiftWithCriteria
GiftWithCriteria
A Gift
along with the criteria
for which that can Gifts.claimGift
this
ClaimGiftRequest
ClaimGiftRequest
DeleteGiftRequest
DeleteGiftRequest
AvailableGiftsResponse
AvailableGiftsResponse
Last updated