メインコンテンツまでスキップ

AsyncAPI for entitlement service 0.0.1 documentation

備考

In this document, PUB means "publish" and SUB means "subscribe". This refers to the "publish/subscribe" (pub/sub) messaging framework, where "publish" means that the service sends data to Kafka topics, and "subscribe" means the service acts as a consumer that subscribes to specific Kafka topics to receive data.

Table of Contents

Operations

PUB entitlementManagement Operation

Accepts one of the following messages:

Message entitlementGranted

message is sent when user is granted with entitlement

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.grantsarray<object>----
payload.grants.idstringentitlement id---
payload.grants.namespacestringentitlement namespace---
payload.grants.clazzstringentitlement class---
payload.grants.typestringentitlement type---
payload.grants.statusstringentitlement status---
payload.grants.appIdstringappId if entitlement is an app---
payload.grants.appTypestringappType if entitlement is an app---
payload.grants.skustringsku for purchased item---
payload.grants.userIdstringuserId for this entitlement---
payload.grants.itemIdstringitemId of the entitlement---
payload.grants.itemNamespacestringitemNamespace for the purchased item---
payload.grants.namestringentitlement name---
payload.grants.useCountintegeruseCount for entitlement-format (int32)-
payload.grants.sourcestringentitlement source---
payload.grants.startDatestringentitlement start date-format (date-time)-
payload.grants.endDatestringentitlement end date-format (date-time)-
payload.grants.grantedAtstringentitlement granted at-format (date-time)-
payload.grants.createdAtstringentitlement created at-format (date-time)-
payload.grants.updatedAtstringentitlement updated at-format (date-time)-
payload.grants.stackablebooleanwhether the entitlement is stackable---
payload.grants.stackedUseCountintegerthe stacked use count in the entitlement-format (int32)-
payload.grants.originstringentitlement origin---
payload.grants.collectionIdstringentitlement collection id---
payload.metadataobject---additional properties are allowed
payload.x-uid--"AnonymousSchema1"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"grants": [
{
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"stackable": true,
"stackedUseCount": 0,
"origin": "string",
"collectionId": "string"
}
],
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message entitlementUpdated

message is sent when entitlement is updated

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementobject---additional properties are allowed
payload.entitlement.idstringentitlement id---
payload.entitlement.namespacestringentitlement namespace---
payload.entitlement.clazzstringentitlement class---
payload.entitlement.typestringentitlement type---
payload.entitlement.statusstringentitlement status---
payload.entitlement.appIdstringappId if entitlement is an app---
payload.entitlement.appTypestringappType if entitlement is an app---
payload.entitlement.skustringsku for purchased item---
payload.entitlement.userIdstringuserId for this entitlement---
payload.entitlement.itemIdstringitemId of the entitlement---
payload.entitlement.itemNamespacestringitemNamespace for the purchased item---
payload.entitlement.namestringentitlement name---
payload.entitlement.useCountintegeruseCount for entitlement-format (int32)-
payload.entitlement.sourcestringentitlement source---
payload.entitlement.startDatestringentitlement start date-format (date-time)-
payload.entitlement.endDatestringentitlement end date-format (date-time)-
payload.entitlement.grantedAtstringentitlement granted at-format (date-time)-
payload.entitlement.createdAtstringentitlement created at-format (date-time)-
payload.entitlement.updatedAtstringentitlement updated at-format (date-time)-
payload.entitlement.originstring----
payload.entitlement.collectionIdstring----
payload.oldEntitlementobject---additional properties are allowed
payload.oldEntitlement.idstringentitlement id---
payload.oldEntitlement.namespacestringentitlement namespace---
payload.oldEntitlement.clazzstringentitlement class---
payload.oldEntitlement.typestringentitlement type---
payload.oldEntitlement.statusstringentitlement status---
payload.oldEntitlement.appIdstringappId if entitlement is an app---
payload.oldEntitlement.appTypestringappType if entitlement is an app---
payload.oldEntitlement.skustringsku for purchased item---
payload.oldEntitlement.userIdstringuserId for this entitlement---
payload.oldEntitlement.itemIdstringitemId of the entitlement---
payload.oldEntitlement.itemNamespacestringitemNamespace for the purchased item---
payload.oldEntitlement.namestringentitlement name---
payload.oldEntitlement.useCountintegeruseCount for entitlement-format (int32)-
payload.oldEntitlement.sourcestringentitlement source---
payload.oldEntitlement.startDatestringentitlement start date-format (date-time)-
payload.oldEntitlement.endDatestringentitlement end date-format (date-time)-
payload.oldEntitlement.grantedAtstringentitlement granted at-format (date-time)-
payload.oldEntitlement.createdAtstringentitlement created at-format (date-time)-
payload.oldEntitlement.updatedAtstringentitlement updated at-format (date-time)-
payload.oldEntitlement.originstring----
payload.oldEntitlement.collectionIdstring----
payload.x-uid0--"AnonymousSchema2"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlement": {
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"origin": "string",
"collectionId": "string"
},
"oldEntitlement": {
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"origin": "string",
"collectionId": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message entitlementRevoked

message is sent when entitlement is revoked

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementRevocationobject---additional properties are allowed
payload.entitlementRevocation.entitlementIdsarray<string>entitlement ids---
payload.entitlementRevocation.entitlementIds (single item)string----
payload.entitlementRevocation.userIdstringuser id---
payload.metadataobject---additional properties are allowed
payload.x-uid--"AnonymousSchema5"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementRevocation": {
"entitlementIds": [
"string"
],
"userId": "string"
},
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message entitlementDisabled

message is sent when entitlement is disabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementStatusChangeobject---additional properties are allowed
payload.entitlementStatusChange.entitlementIdstringentitlement id---
payload.entitlementStatusChange.entitlementNamestringentitlement name---
payload.entitlementStatusChange.userIdstringuser id---
payload.entitlementStatusChange.statusstringentitlement statusallowed ("ACTIVE", "INACTIVE", "CONSUMED", "REVOKED", "SOLD")--
payload.entitlementStatusChange.previousStatusstringentitlement status before changeallowed ("ACTIVE", "INACTIVE", "CONSUMED", "REVOKED", "SOLD")--
payload.x-uid0--"AnonymousSchema6"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementStatusChange": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"status": "ACTIVE",
"previousStatus": "ACTIVE"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message entitlementEnabled

message is sent when entitlement is enabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementStatusChangeobject---additional properties are allowed
payload.entitlementStatusChange.entitlementIdstringentitlement id---
payload.entitlementStatusChange.entitlementNamestringentitlement name---
payload.entitlementStatusChange.userIdstringuser id---
payload.entitlementStatusChange.statusstringentitlement statusallowed ("ACTIVE", "INACTIVE", "CONSUMED", "REVOKED", "SOLD")--
payload.entitlementStatusChange.previousStatusstringentitlement status before changeallowed ("ACTIVE", "INACTIVE", "CONSUMED", "REVOKED", "SOLD")--
payload.x-uid0--"AnonymousSchema7"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementStatusChange": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"status": "ACTIVE",
"previousStatus": "ACTIVE"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message entitlementUseCountRevoked

message is sent when entitlement use count is revoked, only for consumable entitlement

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementUseCountRevocationobject---additional properties are allowed
payload.entitlementUseCountRevocation.entitlementIdstringentitlement id---
payload.entitlementUseCountRevocation.entitlementNamestringentitlement name---
payload.entitlementUseCountRevocation.userIdstringuser id---
payload.entitlementUseCountRevocation.useCountintegerthe useCount after entitlement was revoked---
payload.entitlementUseCountRevocation.countintegerthe count be revoked---
payload.x-uid--"AnonymousSchema4"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementUseCountRevocation": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"useCount": 0,
"count": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

PUB entitlementConsumption Operation

Message entitlementConsumed

message is sent when user entitlement is consumed

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementConsumptionobject---additional properties are allowed
payload.entitlementConsumption.entitlementIdstringentitlement id---
payload.entitlementConsumption.entitlementNamestringentitlement name---
payload.entitlementConsumption.userIdstringuser id---
payload.entitlementConsumption.useCountintegerthe useCount after entitlement was consumed---
payload.entitlementConsumption.countintegerthe count be consumed---
payload.metadataobject---additional properties are allowed
payload.x-uid--"AnonymousSchema3"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementConsumption": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"useCount": 0,
"count": 0
},
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

PUB entitlementSale Operation

Message entitlementSellback

message is sent when user sell entitlement

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.entitlementSaleobject---additional properties are allowed
payload.entitlementSale.entitlementIdstringentitlement id---
payload.entitlementSale.entitlementNamestringentitlement name---
payload.entitlementSale.entitlementTypestringentitlement typeallowed ("DURABLE", "CONSUMABLE")--
payload.entitlementSale.clazzstringentitlement clazz---
payload.entitlementSale.userIdstringuser id---
payload.entitlementSale.useCountintegerthe useCount after entitlement was consumed---
payload.entitlementSale.countintegerthe count be sold---
payload.entitlementSale.creditSummariesarray<object>credit granted---
payload.entitlementSale.creditSummaries.walletIdstringwallet id---
payload.entitlementSale.creditSummaries.namespacestringnamespace---
payload.entitlementSale.creditSummaries.userIdstringuser id---
payload.entitlementSale.creditSummaries.amountintegeramount need to be paid-format (int64)-
payload.x-uid0--"AnonymousSchema8"--
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"entitlementSale": {
"entitlementId": "string",
"entitlementName": "string",
"entitlementType": "DURABLE",
"clazz": "string",
"userId": "string",
"useCount": 0,
"count": 0,
"creditSummaries": [
{
"walletId": "string",
"namespace": "string",
"userId": "string",
"amount": 0
}
]
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}