|
2 | 2 |
|
3 | 3 | import calendar |
4 | 4 | import datetime |
| 5 | +import warnings |
5 | 6 | from enum import IntEnum, Enum |
6 | 7 | from typing import Any, Dict, List, MutableMapping, Optional, Type, TypeVar, Union |
7 | 8 | from attr import define |
|
14 | 15 | from appstoreserverlibrary.models.LibraryUtility import _get_cattrs_converter |
15 | 16 | from .models.CheckTestNotificationResponse import CheckTestNotificationResponse |
16 | 17 | from .models.ConsumptionRequest import ConsumptionRequest |
| 18 | +from .models.ConsumptionRequestV1 import ConsumptionRequestV1 |
17 | 19 | from .models.DefaultConfigurationRequest import DefaultConfigurationRequest |
18 | 20 | from .models.Environment import Environment |
19 | 21 | from .models.ExtendRenewalDateRequest import ExtendRenewalDateRequest |
@@ -853,17 +855,32 @@ def request_test_notification(self) -> SendTestNotificationResponse: |
853 | 855 | """ |
854 | 856 | return self._make_request("/inApps/v1/notifications/test", "POST", {}, None, SendTestNotificationResponse, None) |
855 | 857 |
|
856 | | - def send_consumption_data(self, transaction_id: str, consumption_request: ConsumptionRequest): |
| 858 | + def send_consumption_data(self, transaction_id: str, consumption_request: ConsumptionRequestV1): |
857 | 859 | """ |
858 | 860 | Send consumption information about a consumable in-app purchase to the App Store after your server receives a consumption request notification. |
859 | | - https://developer.apple.com/documentation/appstoreserverapi/send_consumption_information |
| 861 | + https://developer.apple.com/documentation/appstoreserverapi/send-consumption-information-v1 |
| 862 | +
|
| 863 | + .. deprecated:: |
| 864 | + Use :func:`send_consumption_information` instead. |
860 | 865 |
|
861 | 866 | :param transaction_id: The transaction identifier for which you're providing consumption information. You receive this identifier in the CONSUMPTION_REQUEST notification the App Store sends to your server. |
862 | 867 | :param consumption_request: The request body containing consumption information. |
863 | 868 | :raises APIException: If a response was returned indicating the request could not be processed |
864 | 869 | """ |
| 870 | + warnings.warn("send_consumption_data is deprecated, use send_consumption_information instead", DeprecationWarning, stacklevel=2) |
865 | 871 | self._make_request(f"/inApps/v1/transactions/consumption/{transaction_id}", "PUT", {}, consumption_request, None, None) |
866 | 872 |
|
| 873 | + def send_consumption_information(self, transaction_id: str, consumption_request: ConsumptionRequest): |
| 874 | + """ |
| 875 | + Send consumption information about an In-App Purchase to the App Store after your server receives a consumption request notification. |
| 876 | + https://developer.apple.com/documentation/appstoreserverapi/send-consumption-information |
| 877 | +
|
| 878 | + :param transaction_id: The transaction identifier for which you're providing consumption information. You receive this identifier in the CONSUMPTION_REQUEST notification the App Store sends to your server's App Store Server Notifications V2 endpoint. |
| 879 | + :param consumption_request: The request body containing consumption information. |
| 880 | + :raises APIException: If a response was returned indicating the request could not be processed |
| 881 | + """ |
| 882 | + self._make_request(f"/inApps/v2/transactions/consumption/{transaction_id}", "PUT", {}, consumption_request, None, None) |
| 883 | + |
867 | 884 | def set_app_account_token(self, original_transaction_id: str, update_app_account_token_request: UpdateAppAccountTokenRequest): |
868 | 885 | """ |
869 | 886 | Sets the app account token value for a purchase the customer makes outside your app, or updates its value in an existing transaction. |
@@ -1170,17 +1187,32 @@ async def request_test_notification(self) -> SendTestNotificationResponse: |
1170 | 1187 | """ |
1171 | 1188 | return await self._make_request("/inApps/v1/notifications/test", "POST", {}, None, SendTestNotificationResponse, None) |
1172 | 1189 |
|
1173 | | - async def send_consumption_data(self, transaction_id: str, consumption_request: ConsumptionRequest): |
| 1190 | + async def send_consumption_data(self, transaction_id: str, consumption_request: ConsumptionRequestV1): |
1174 | 1191 | """ |
1175 | 1192 | Send consumption information about a consumable in-app purchase to the App Store after your server receives a consumption request notification. |
1176 | | - https://developer.apple.com/documentation/appstoreserverapi/send_consumption_information |
| 1193 | + https://developer.apple.com/documentation/appstoreserverapi/send-consumption-information-v1 |
| 1194 | +
|
| 1195 | + .. deprecated:: |
| 1196 | + Use :func:`send_consumption_information` instead. |
1177 | 1197 |
|
1178 | 1198 | :param transaction_id: The transaction identifier for which you're providing consumption information. You receive this identifier in the CONSUMPTION_REQUEST notification the App Store sends to your server. |
1179 | 1199 | :param consumption_request: The request body containing consumption information. |
1180 | 1200 | :raises APIException: If a response was returned indicating the request could not be processed |
1181 | 1201 | """ |
| 1202 | + warnings.warn("send_consumption_data is deprecated, use send_consumption_information instead", DeprecationWarning, stacklevel=2) |
1182 | 1203 | await self._make_request(f"/inApps/v1/transactions/consumption/{transaction_id}", "PUT", {}, consumption_request, None, None) |
1183 | 1204 |
|
| 1205 | + async def send_consumption_information(self, transaction_id: str, consumption_request: ConsumptionRequest): |
| 1206 | + """ |
| 1207 | + Send consumption information about an In-App Purchase to the App Store after your server receives a consumption request notification. |
| 1208 | + https://developer.apple.com/documentation/appstoreserverapi/send-consumption-information |
| 1209 | +
|
| 1210 | + :param transaction_id: The transaction identifier for which you're providing consumption information. You receive this identifier in the CONSUMPTION_REQUEST notification the App Store sends to your server's App Store Server Notifications V2 endpoint. |
| 1211 | + :param consumption_request: The request body containing consumption information. |
| 1212 | + :raises APIException: If a response was returned indicating the request could not be processed |
| 1213 | + """ |
| 1214 | + await self._make_request(f"/inApps/v2/transactions/consumption/{transaction_id}", "PUT", {}, consumption_request, None, None) |
| 1215 | + |
1184 | 1216 | async def set_app_account_token(self, original_transaction_id: str, update_app_account_token_request: UpdateAppAccountTokenRequest): |
1185 | 1217 | """ |
1186 | 1218 | Sets the app account token value for a purchase the customer makes outside your app, or updates its value in an existing transaction. |
|
0 commit comments