|
| 1 | +# Copyright (c) 2025 Apple Inc. Licensed under MIT License. |
| 2 | + |
| 3 | +from typing import Optional |
| 4 | +from uuid import UUID |
| 5 | + |
| 6 | +from attr import define |
| 7 | +import attr |
| 8 | + |
| 9 | +from .Environment import Environment |
| 10 | +from .LibraryUtility import AttrsRawValueAware |
| 11 | + |
| 12 | +@define |
| 13 | +class DecodedRealtimeRequestBody(AttrsRawValueAware): |
| 14 | + """ |
| 15 | + The decoded request body the App Store sends to your server to request a real-time retention message. |
| 16 | +
|
| 17 | + https://developer.apple.com/documentation/retentionmessaging/decodedrealtimerequestbody |
| 18 | + """ |
| 19 | + |
| 20 | + originalTransactionId: str = attr.ib() |
| 21 | + """ |
| 22 | + The original transaction identifier of the customer's subscription. |
| 23 | +
|
| 24 | + https://developer.apple.com/documentation/retentionmessaging/originaltransactionid |
| 25 | + """ |
| 26 | + |
| 27 | + appAppleId: int = attr.ib() |
| 28 | + """ |
| 29 | + The unique identifier of the app in the App Store. |
| 30 | +
|
| 31 | + https://developer.apple.com/documentation/retentionmessaging/appappleid |
| 32 | + """ |
| 33 | + |
| 34 | + productId: str = attr.ib() |
| 35 | + """ |
| 36 | + The unique identifier of the auto-renewable subscription. |
| 37 | +
|
| 38 | + https://developer.apple.com/documentation/retentionmessaging/productid |
| 39 | + """ |
| 40 | + |
| 41 | + userLocale: str = attr.ib() |
| 42 | + """ |
| 43 | + The device's locale. |
| 44 | +
|
| 45 | + https://developer.apple.com/documentation/retentionmessaging/locale |
| 46 | + """ |
| 47 | + |
| 48 | + requestIdentifier: UUID = attr.ib() |
| 49 | + """ |
| 50 | + A UUID the App Store server creates to uniquely identify each request. |
| 51 | +
|
| 52 | + https://developer.apple.com/documentation/retentionmessaging/requestidentifier |
| 53 | + """ |
| 54 | + |
| 55 | + signedDate: int = attr.ib() |
| 56 | + """ |
| 57 | + The UNIX time, in milliseconds, that the App Store signed the JSON Web Signature (JWS) data. |
| 58 | +
|
| 59 | + https://developer.apple.com/documentation/retentionmessaging/signeddate |
| 60 | + """ |
| 61 | + |
| 62 | + environment: Optional[Environment] = Environment.create_main_attr('rawEnvironment', raw_required=True) |
| 63 | + """ |
| 64 | + The server environment, either sandbox or production. |
| 65 | +
|
| 66 | + https://developer.apple.com/documentation/retentionmessaging/environment |
| 67 | + """ |
| 68 | + |
| 69 | + rawEnvironment: str = Environment.create_raw_attr('environment', required=True) |
| 70 | + """ |
| 71 | + See environment |
| 72 | + """ |
| 73 | + |
0 commit comments