|
| 1 | +package microsoftstore |
| 2 | + |
| 3 | +import "time" |
| 4 | + |
| 5 | +type UserIdentity struct { |
| 6 | + IdentityType string `json:"identityType"` |
| 7 | + IdentityValue string `json:"identityValue"` |
| 8 | + LocalTicketReference string `json:"localTicketReference"` |
| 9 | +} |
| 10 | + |
| 11 | +type ProductSkuId struct { |
| 12 | + ProductId string `json:"productId"` |
| 13 | + SkuId string `json:"skuId"` |
| 14 | +} |
| 15 | + |
| 16 | +type ProductType string |
| 17 | + |
| 18 | +const ( |
| 19 | + Application ProductType = "Application" |
| 20 | + Durable ProductType = "Durable" |
| 21 | + Game ProductType = "Game" |
| 22 | + UnmanagedConsumable ProductType = "UnmanagedConsumable" |
| 23 | +) |
| 24 | + |
| 25 | +type IAPRequest struct { |
| 26 | + Beneficiaries []UserIdentity `json:"beneficiaries"` |
| 27 | + ContinuationToken string `json:"continuationToken,omitempty"` |
| 28 | + MaxPageSize int `json:"maxPageSize,omitempty"` |
| 29 | + ModifiedAfter *time.Time `json:"modifiedAfter,omitempty"` |
| 30 | + ParentProductId string `json:"parentProductId,omitempty"` |
| 31 | + ProductSkuIds []ProductSkuId `json:"productSkuIds,omitempty"` |
| 32 | + ProductTypes []ProductType `json:"productTypes"` |
| 33 | + ValidityType string `json:"validityType,omitempty"` |
| 34 | +} |
| 35 | + |
| 36 | +type IdentityContractV6 struct { |
| 37 | + IdentityType string `json:"identityType"` // Contains the value "pub". |
| 38 | + IdentityValue string `json:"identityValue"` // The string value of the publisherUserId from the specified Microsoft Store ID key. |
| 39 | +} |
| 40 | + |
| 41 | +// CollectionItemContractV6 represents an item in the user's collection. |
| 42 | +type CollectionItemContractV6 struct { |
| 43 | + AcquiredDate time.Time `json:"acquiredDate"` // The date on which the user acquired the item. |
| 44 | + CampaignId *string `json:"campaignId,omitempty"` // The campaign ID that was provided at purchase time for this item. |
| 45 | + DevOfferId *string `json:"devOfferId,omitempty"` // The offer ID from an in-app purchase. |
| 46 | + EndDate time.Time `json:"endDate"` // The end date of the item. |
| 47 | + FulfillmentData []string `json:"fulfillmentData,omitempty"` // N/A |
| 48 | + InAppOfferToken *string `json:"inAppOfferToken,omitempty"` // The developer-specified product ID string assigned to the item in Partner Center. |
| 49 | + ItemId string `json:"itemId"` // An ID that identifies this collection item from other items the user owns. |
| 50 | + LocalTicketReference string `json:"localTicketReference"` // The ID of the previously supplied localTicketReference in the request body. |
| 51 | + ModifiedDate time.Time `json:"modifiedDate"` // The date this item was last modified. |
| 52 | + OrderId *string `json:"orderId,omitempty"` // If present, the order ID of which this item was obtained. |
| 53 | + OrderLineItemId *string `json:"orderLineItemId,omitempty"` // If present, the line item of the particular order for which this item was obtained. |
| 54 | + OwnershipType string `json:"ownershipType"` // The string "OwnedByBeneficiary". |
| 55 | + ProductId string `json:"productId"` // The Store ID for the product in the Microsoft Store catalog. |
| 56 | + ProductType string `json:"productType"` // One of the following product types: Application, Durable, UnmanagedConsumable. |
| 57 | + PurchasedCountry *string `json:"purchasedCountry,omitempty"` // N/A |
| 58 | + Purchaser *IdentityContractV6 `json:"purchaser,omitempty"` // Represents the identity of the purchaser of the item. |
| 59 | + Quantity *int `json:"quantity,omitempty"` // The quantity of the item. Currently, this will always be 1. |
| 60 | + SkuId string `json:"skuId"` // The Store ID for the product's SKU in the Microsoft Store catalog. |
| 61 | + SkuType string `json:"skuType"` // Type of the SKU. Possible values include Trial, Full, and Rental. |
| 62 | + StartDate time.Time `json:"startDate"` // The date that the item starts being valid. |
| 63 | + Status string `json:"status"` // The status of the item. Possible values include Active, Expired, Revoked, and Banned. |
| 64 | + Tags []string `json:"tags"` // N/A |
| 65 | + TransactionId string `json:"transactionId"` // The transaction ID as a result of the purchase of this item. |
| 66 | +} |
| 67 | + |
| 68 | +type IAPResponse struct { |
| 69 | + ContinuationToken *string `json:"continuationToken,omitempty"` // Token to retrieve remaining products if there are multiple sets. |
| 70 | + Items []CollectionItemContractV6 `json:"items,omitempty"` // An array of products for the specified user. |
| 71 | +} |
0 commit comments