Skip to content

Commit d4ef494

Browse files
1 parent c593431 commit d4ef494

23 files changed

Lines changed: 923 additions & 10 deletions

appstoreserverlibrary/api_client.py

Lines changed: 231 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from uuid import UUID
4+
5+
from attr import define
6+
import attr
7+
8+
@define
9+
class BulletPoint:
10+
"""
11+
The text and its bullet-point image to include in a retention message’s bulleted list.
12+
13+
https://developer.apple.com/documentation/retentionmessaging/bulletpoint
14+
"""
15+
16+
text: str = attr.ib(validator=attr.validators.max_len(66))
17+
"""
18+
The text of the individual bullet point.
19+
20+
https://developer.apple.com/documentation/retentionmessaging/bulletpointtext
21+
"""
22+
23+
imageIdentifier: UUID = attr.ib()
24+
"""
25+
The identifier of the image to use as the bullet point.
26+
27+
https://developer.apple.com/documentation/retentionmessaging/imageidentifier
28+
"""
29+
30+
altText: str = attr.ib(validator=attr.validators.max_len(150))
31+
"""
32+
The alternative text you provide for the corresponding image of the bullet point.
33+
34+
https://developer.apple.com/documentation/retentionmessaging/alttext
35+
"""

appstoreserverlibrary/models/DefaultConfigurationRequest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ class DefaultConfigurationRequest:
1818
"""
1919
The message identifier of the message to configure as a default message.
2020
21+
Note: In a future version, this field will become required.
22+
2123
https://developer.apple.com/documentation/retentionmessaging/messageidentifier
2224
"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from uuid import UUID
4+
5+
from attr import define
6+
import attr
7+
8+
@define
9+
class DefaultConfigurationResponse:
10+
"""
11+
The response body that contains the default configuration information.
12+
13+
https://developer.apple.com/documentation/retentionmessaging/defaultconfigurationresponse
14+
"""
15+
16+
messageIdentifier: UUID = attr.ib()
17+
"""
18+
The message identifier of the retention message you configured as a default.
19+
20+
https://developer.apple.com/documentation/retentionmessaging/messageidentifier
21+
"""

appstoreserverlibrary/models/GetImageListResponseItem.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from attr import define
77
import attr
88

9+
from .ImageSize import ImageSize
910
from .ImageState import ImageState
1011
from .LibraryUtility import AttrsRawValueAware
1112

@@ -34,4 +35,16 @@ class GetImageListResponseItem(AttrsRawValueAware):
3435
rawImageState: Optional[str] = ImageState.create_raw_attr('imageState')
3536
"""
3637
See imageState
38+
"""
39+
40+
imageSize: Optional[ImageSize] = ImageSize.create_main_attr('rawImageSize')
41+
"""
42+
The size of the image.
43+
44+
https://developer.apple.com/documentation/retentionmessaging/imagesize
45+
"""
46+
47+
rawImageSize: Optional[str] = ImageSize.create_raw_attr('imageSize')
48+
"""
49+
See imageSize
3750
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from enum import Enum
4+
5+
from .LibraryUtility import AppStoreServerLibraryEnumMeta
6+
7+
class HeaderPosition(str, Enum, metaclass=AppStoreServerLibraryEnumMeta):
8+
"""
9+
The position where the header text appears in a message.
10+
11+
https://developer.apple.com/documentation/retentionmessaging/headerposition
12+
"""
13+
ABOVE_BODY = "ABOVE_BODY"
14+
ABOVE_IMAGE = "ABOVE_IMAGE"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from enum import Enum
4+
5+
from .LibraryUtility import AppStoreServerLibraryEnumMeta
6+
7+
class ImageSize(str, Enum, metaclass=AppStoreServerLibraryEnumMeta):
8+
"""
9+
The size of an image.
10+
11+
https://developer.apple.com/documentation/retentionmessaging/imagesize
12+
"""
13+
FULL_SIZE = "FULL_SIZE"
14+
BULLET_POINT = "BULLET_POINT"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from typing import Optional
4+
5+
from attr import define
6+
import attr
7+
8+
@define
9+
class PerformanceTestConfig:
10+
"""
11+
An object that enumerates the test configuration parameters.
12+
13+
https://developer.apple.com/documentation/retentionmessaging/performancetestconfig
14+
"""
15+
16+
maxConcurrentRequests: Optional[int] = attr.ib(default=None)
17+
"""
18+
The maximum number of concurrent requests the API allows.
19+
20+
https://developer.apple.com/documentation/retentionmessaging/maxconcurrentrequests
21+
"""
22+
23+
totalRequests: Optional[int] = attr.ib(default=None)
24+
"""
25+
The total number of requests to make during the test.
26+
27+
https://developer.apple.com/documentation/retentionmessaging/totalrequests
28+
"""
29+
30+
totalDuration: Optional[int] = attr.ib(default=None)
31+
"""
32+
The total duration of the test in milliseconds.
33+
34+
https://developer.apple.com/documentation/retentionmessaging/totalduration
35+
"""
36+
37+
responseTimeThreshold: Optional[int] = attr.ib(default=None)
38+
"""
39+
The maximum time your server has to respond when the system calls your Get Retention Message endpoint in the sandbox environment.
40+
41+
https://developer.apple.com/documentation/retentionmessaging/responsetimethreshold
42+
"""
43+
44+
successRateThreshold: Optional[int] = attr.ib(default=None)
45+
"""
46+
The success rate threshold percentage.
47+
48+
https://developer.apple.com/documentation/retentionmessaging/successratethreshold
49+
"""
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from attr import define
4+
import attr
5+
6+
@define
7+
class PerformanceTestRequest:
8+
"""
9+
The request object you provide for a performance test that contains an original transaction identifier.
10+
11+
https://developer.apple.com/documentation/retentionmessaging/performancetestrequest
12+
"""
13+
14+
originalTransactionId: str = attr.ib()
15+
"""
16+
The original transaction identifier of an In-App Purchase you initiate in the sandbox environment, to use as the purchase for this test.
17+
18+
https://developer.apple.com/documentation/retentionmessaging/originaltransactionid
19+
"""
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2026 Apple Inc. Licensed under MIT License.
2+
3+
from typing import Optional
4+
5+
from attr import define
6+
import attr
7+
8+
from .PerformanceTestConfig import PerformanceTestConfig
9+
10+
@define
11+
class PerformanceTestResponse:
12+
"""
13+
The performance test response object.
14+
15+
https://developer.apple.com/documentation/retentionmessaging/performancetestresponse
16+
"""
17+
18+
config: Optional[PerformanceTestConfig] = attr.ib(default=None)
19+
"""
20+
The performance test configuration object.
21+
22+
https://developer.apple.com/documentation/retentionmessaging/performancetestconfig
23+
"""
24+
25+
requestId: Optional[str] = attr.ib(default=None)
26+
"""
27+
The performance test request identifier.
28+
29+
https://developer.apple.com/documentation/retentionmessaging/requestid
30+
"""

0 commit comments

Comments
 (0)