karrio-mydhl 2025.5rc7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. karrio/mappers/mydhl/__init__.py +3 -0
  2. karrio/mappers/mydhl/mapper.py +99 -0
  3. karrio/mappers/mydhl/proxy.py +148 -0
  4. karrio/mappers/mydhl/settings.py +24 -0
  5. karrio/plugins/mydhl/__init__.py +24 -0
  6. karrio/providers/mydhl/__init__.py +28 -0
  7. karrio/providers/mydhl/address.py +65 -0
  8. karrio/providers/mydhl/error.py +77 -0
  9. karrio/providers/mydhl/pickup/__init__.py +14 -0
  10. karrio/providers/mydhl/pickup/cancel.py +62 -0
  11. karrio/providers/mydhl/pickup/create.py +94 -0
  12. karrio/providers/mydhl/pickup/update.py +108 -0
  13. karrio/providers/mydhl/rate.py +112 -0
  14. karrio/providers/mydhl/shipment/__init__.py +9 -0
  15. karrio/providers/mydhl/shipment/cancel.py +91 -0
  16. karrio/providers/mydhl/shipment/create.py +100 -0
  17. karrio/providers/mydhl/tracking.py +86 -0
  18. karrio/providers/mydhl/units.py +99 -0
  19. karrio/providers/mydhl/utils.py +92 -0
  20. karrio/schemas/mydhl/__init__.py +0 -0
  21. karrio/schemas/mydhl/address_validation_request.py +13 -0
  22. karrio/schemas/mydhl/address_validation_response.py +25 -0
  23. karrio/schemas/mydhl/error_response.py +13 -0
  24. karrio/schemas/mydhl/pickup_cancel_request.py +10 -0
  25. karrio/schemas/mydhl/pickup_cancel_response.py +8 -0
  26. karrio/schemas/mydhl/pickup_create_request.py +108 -0
  27. karrio/schemas/mydhl/pickup_create_response.py +11 -0
  28. karrio/schemas/mydhl/pickup_update_request.py +110 -0
  29. karrio/schemas/mydhl/pickup_update_response.py +11 -0
  30. karrio/schemas/mydhl/rate_request.py +114 -0
  31. karrio/schemas/mydhl/rate_response.py +143 -0
  32. karrio/schemas/mydhl/shipment_request.py +275 -0
  33. karrio/schemas/mydhl/shipment_response.py +90 -0
  34. karrio/schemas/mydhl/tracking_response.py +112 -0
  35. karrio_mydhl-2025.5rc7.dist-info/METADATA +44 -0
  36. karrio_mydhl-2025.5rc7.dist-info/RECORD +39 -0
  37. karrio_mydhl-2025.5rc7.dist-info/WHEEL +5 -0
  38. karrio_mydhl-2025.5rc7.dist-info/entry_points.txt +2 -0
  39. karrio_mydhl-2025.5rc7.dist-info/top_level.txt +3 -0
@@ -0,0 +1,92 @@
1
+
2
+ import base64
3
+ import datetime
4
+ import karrio.lib as lib
5
+ import karrio.core as core
6
+ import karrio.core.errors as errors
7
+
8
+
9
+ class Settings(core.Settings):
10
+ """MyDHL provider settings."""
11
+
12
+ username: str
13
+ password: str
14
+ account_number: str
15
+
16
+ @property
17
+ def carrier_name(self):
18
+ return "mydhl"
19
+
20
+ @property
21
+ def server_url(self):
22
+ return "https://express.api.dhl.com"
23
+
24
+ @property
25
+ def authorization(self):
26
+ """Basic Authentication header for DHL Express API."""
27
+ pair = f"{self.username}:{self.password}"
28
+ return base64.b64encode(pair.encode("utf-8")).decode("ascii")
29
+
30
+ @property
31
+ def connection_config(self) -> lib.units.Options:
32
+ return lib.to_connection_config(
33
+ self.config or {},
34
+ option_type=ConnectionConfig,
35
+ )
36
+
37
+ # """uncomment the following code block to implement the oauth login."""
38
+ # @property
39
+ # def access_token(self):
40
+ # """Retrieve the access_token using the client_id|client_secret pair
41
+ # or collect it from the cache if an unexpired access_token exist.
42
+ # """
43
+ # cache_key = f"{self.carrier_name}|{self.client_id}|{self.client_secret}"
44
+ # now = datetime.datetime.now() + datetime.timedelta(minutes=30)
45
+
46
+ # auth = self.connection_cache.get(cache_key) or {}
47
+ # token = auth.get("access_token")
48
+ # expiry = lib.to_date(auth.get("expiry"), current_format="%Y-%m-%d %H:%M:%S")
49
+
50
+ # if token is not None and expiry is not None and expiry > now:
51
+ # return token
52
+
53
+ # self.connection_cache.set(cache_key, lambda: login(self))
54
+ # new_auth = self.connection_cache.get(cache_key)
55
+
56
+ # return new_auth["access_token"]
57
+
58
+ # """uncomment the following code block to implement the oauth login."""
59
+ # def login(settings: Settings):
60
+ # import karrio.providers.mydhl.error as error
61
+
62
+ # result = lib.request(
63
+ # url=f"{settings.server_url}/oauth/token",
64
+ # method="POST",
65
+ # headers={"content-Type": "application/x-www-form-urlencoded"},
66
+ # data=lib.to_query_string(
67
+ # dict(
68
+ # grant_type="client_credentials",
69
+ # client_id=settings.client_id,
70
+ # client_secret=settings.client_secret,
71
+ # )
72
+ # ),
73
+ # )
74
+
75
+ # response = lib.to_dict(result)
76
+ # messages = error.parse_error_response(response, settings)
77
+
78
+ # if any(messages):
79
+ # raise errors.ParsedMessagesError(messages)
80
+
81
+ # expiry = datetime.datetime.now() + datetime.timedelta(
82
+ # seconds=float(response.get("expires_in", 0))
83
+ # )
84
+ # return {**response, "expiry": lib.fdatetime(expiry)}
85
+
86
+
87
+ class ConnectionConfig(lib.Enum):
88
+ """MyDHL connection configuration options."""
89
+ label_type = lib.OptionEnum("label_type", str, "PDF")
90
+ label_template = lib.OptionEnum("label_template", str, "ECOM26_84_A4_001")
91
+ shipping_options = lib.OptionEnum("shipping_options", list)
92
+ shipping_services = lib.OptionEnum("shipping_services", list)
File without changes
@@ -0,0 +1,13 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class AddressValidationRequestType:
8
+ type: typing.Optional[str] = None
9
+ countryCode: typing.Optional[str] = None
10
+ postalCode: typing.Optional[int] = None
11
+ cityName: typing.Optional[str] = None
12
+ countyName: typing.Optional[str] = None
13
+ strictValidation: typing.Optional[bool] = None
@@ -0,0 +1,25 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class ServiceAreaType:
8
+ code: typing.Optional[str] = None
9
+ description: typing.Optional[str] = None
10
+ GMTOffset: typing.Optional[str] = None
11
+
12
+
13
+ @attr.s(auto_attribs=True)
14
+ class AddressType:
15
+ countryCode: typing.Optional[str] = None
16
+ postalCode: typing.Optional[int] = None
17
+ cityName: typing.Optional[str] = None
18
+ countyName: typing.Optional[str] = None
19
+ serviceArea: typing.Optional[ServiceAreaType] = jstruct.JStruct[ServiceAreaType]
20
+
21
+
22
+ @attr.s(auto_attribs=True)
23
+ class AddressValidationResponseType:
24
+ warnings: typing.Optional[typing.List[str]] = None
25
+ address: typing.Optional[typing.List[AddressType]] = jstruct.JList[AddressType]
@@ -0,0 +1,13 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class ErrorResponseType:
8
+ instance: typing.Optional[str] = None
9
+ detail: typing.Optional[str] = None
10
+ title: typing.Optional[str] = None
11
+ message: typing.Optional[str] = None
12
+ status: typing.Optional[int] = None
13
+ additionalDetails: typing.Optional[typing.List[str]] = None
@@ -0,0 +1,10 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class PickupCancelRequestType:
8
+ dispatchConfirmationNumber: typing.Optional[str] = None
9
+ requestorName: typing.Optional[str] = None
10
+ reason: typing.Optional[str] = None
@@ -0,0 +1,8 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class PickupCancelResponseType:
8
+ message: typing.Optional[str] = None
@@ -0,0 +1,108 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class AccountType:
8
+ typeCode: typing.Optional[str] = None
9
+ number: typing.Optional[int] = None
10
+
11
+
12
+ @attr.s(auto_attribs=True)
13
+ class ContactInformationType:
14
+ email: typing.Optional[str] = None
15
+ phone: typing.Optional[str] = None
16
+ mobilePhone: typing.Optional[str] = None
17
+ companyName: typing.Optional[str] = None
18
+ fullName: typing.Optional[str] = None
19
+
20
+
21
+ @attr.s(auto_attribs=True)
22
+ class PostalAddressType:
23
+ postalCode: typing.Optional[int] = None
24
+ cityName: typing.Optional[str] = None
25
+ countryCode: typing.Optional[str] = None
26
+ provinceCode: typing.Optional[str] = None
27
+ addressLine1: typing.Optional[str] = None
28
+ addressLine2: typing.Optional[str] = None
29
+ addressLine3: typing.Optional[str] = None
30
+ countyName: typing.Optional[str] = None
31
+
32
+
33
+ @attr.s(auto_attribs=True)
34
+ class RegistrationNumberType:
35
+ typeCode: typing.Optional[str] = None
36
+ number: typing.Optional[str] = None
37
+ issuerCountryCode: typing.Optional[str] = None
38
+
39
+
40
+ @attr.s(auto_attribs=True)
41
+ class DetailsType:
42
+ postalAddress: typing.Optional[PostalAddressType] = jstruct.JStruct[PostalAddressType]
43
+ contactInformation: typing.Optional[ContactInformationType] = jstruct.JStruct[ContactInformationType]
44
+ registrationNumbers: typing.Optional[typing.List[RegistrationNumberType]] = jstruct.JList[RegistrationNumberType]
45
+ typeCode: typing.Optional[str] = None
46
+
47
+
48
+ @attr.s(auto_attribs=True)
49
+ class CustomerDetailsType:
50
+ shipperDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
51
+ receiverDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
52
+ bookingRequestorDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
53
+ pickupDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
54
+
55
+
56
+ @attr.s(auto_attribs=True)
57
+ class DimensionsType:
58
+ length: typing.Optional[int] = None
59
+ width: typing.Optional[int] = None
60
+ height: typing.Optional[int] = None
61
+
62
+
63
+ @attr.s(auto_attribs=True)
64
+ class PackageType:
65
+ typeCode: typing.Optional[str] = None
66
+ weight: typing.Optional[float] = None
67
+ dimensions: typing.Optional[DimensionsType] = jstruct.JStruct[DimensionsType]
68
+
69
+
70
+ @attr.s(auto_attribs=True)
71
+ class ValueAddedServiceType:
72
+ serviceCode: typing.Optional[str] = None
73
+ localServiceCode: typing.Optional[str] = None
74
+ value: typing.Optional[int] = None
75
+ currency: typing.Optional[str] = None
76
+
77
+
78
+ @attr.s(auto_attribs=True)
79
+ class ShipmentDetailType:
80
+ productCode: typing.Optional[str] = None
81
+ localProductCode: typing.Optional[str] = None
82
+ accounts: typing.Optional[typing.List[AccountType]] = jstruct.JList[AccountType]
83
+ valueAddedServices: typing.Optional[typing.List[ValueAddedServiceType]] = jstruct.JList[ValueAddedServiceType]
84
+ isCustomsDeclarable: typing.Optional[bool] = None
85
+ declaredValue: typing.Optional[int] = None
86
+ declaredValueCurrency: typing.Optional[str] = None
87
+ unitOfMeasurement: typing.Optional[str] = None
88
+ shipmentTrackingNumber: typing.Optional[int] = None
89
+ packages: typing.Optional[typing.List[PackageType]] = jstruct.JList[PackageType]
90
+
91
+
92
+ @attr.s(auto_attribs=True)
93
+ class SpecialInstructionType:
94
+ value: typing.Optional[str] = None
95
+ typeCode: typing.Optional[str] = None
96
+
97
+
98
+ @attr.s(auto_attribs=True)
99
+ class PickupCreateRequestType:
100
+ plannedPickupDateAndTime: typing.Optional[str] = None
101
+ closeTime: typing.Optional[str] = None
102
+ location: typing.Optional[str] = None
103
+ locationType: typing.Optional[str] = None
104
+ accounts: typing.Optional[typing.List[AccountType]] = jstruct.JList[AccountType]
105
+ specialInstructions: typing.Optional[typing.List[SpecialInstructionType]] = jstruct.JList[SpecialInstructionType]
106
+ remark: typing.Optional[str] = None
107
+ customerDetails: typing.Optional[CustomerDetailsType] = jstruct.JStruct[CustomerDetailsType]
108
+ shipmentDetails: typing.Optional[typing.List[ShipmentDetailType]] = jstruct.JList[ShipmentDetailType]
@@ -0,0 +1,11 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class PickupCreateResponseType:
8
+ dispatchConfirmationNumbers: typing.Optional[typing.List[str]] = None
9
+ readyByTime: typing.Optional[str] = None
10
+ nextPickupDate: typing.Optional[str] = None
11
+ warnings: typing.Optional[typing.List[str]] = None
@@ -0,0 +1,110 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class AccountType:
8
+ typeCode: typing.Optional[str] = None
9
+ number: typing.Optional[int] = None
10
+
11
+
12
+ @attr.s(auto_attribs=True)
13
+ class ContactInformationType:
14
+ email: typing.Optional[str] = None
15
+ phone: typing.Optional[str] = None
16
+ mobilePhone: typing.Optional[str] = None
17
+ companyName: typing.Optional[str] = None
18
+ fullName: typing.Optional[str] = None
19
+
20
+
21
+ @attr.s(auto_attribs=True)
22
+ class PostalAddressType:
23
+ postalCode: typing.Optional[int] = None
24
+ cityName: typing.Optional[str] = None
25
+ countryCode: typing.Optional[str] = None
26
+ provinceCode: typing.Optional[str] = None
27
+ addressLine1: typing.Optional[str] = None
28
+ addressLine2: typing.Optional[str] = None
29
+ addressLine3: typing.Optional[str] = None
30
+ countyName: typing.Optional[str] = None
31
+
32
+
33
+ @attr.s(auto_attribs=True)
34
+ class RegistrationNumberType:
35
+ typeCode: typing.Optional[str] = None
36
+ number: typing.Optional[str] = None
37
+ issuerCountryCode: typing.Optional[str] = None
38
+
39
+
40
+ @attr.s(auto_attribs=True)
41
+ class DetailsType:
42
+ postalAddress: typing.Optional[PostalAddressType] = jstruct.JStruct[PostalAddressType]
43
+ contactInformation: typing.Optional[ContactInformationType] = jstruct.JStruct[ContactInformationType]
44
+ registrationNumbers: typing.Optional[typing.List[RegistrationNumberType]] = jstruct.JList[RegistrationNumberType]
45
+ typeCode: typing.Optional[str] = None
46
+
47
+
48
+ @attr.s(auto_attribs=True)
49
+ class CustomerDetailsType:
50
+ shipperDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
51
+ receiverDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
52
+ bookingRequestorDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
53
+ pickupDetails: typing.Optional[DetailsType] = jstruct.JStruct[DetailsType]
54
+
55
+
56
+ @attr.s(auto_attribs=True)
57
+ class DimensionsType:
58
+ length: typing.Optional[int] = None
59
+ width: typing.Optional[int] = None
60
+ height: typing.Optional[int] = None
61
+
62
+
63
+ @attr.s(auto_attribs=True)
64
+ class PackageType:
65
+ typeCode: typing.Optional[str] = None
66
+ weight: typing.Optional[float] = None
67
+ dimensions: typing.Optional[DimensionsType] = jstruct.JStruct[DimensionsType]
68
+
69
+
70
+ @attr.s(auto_attribs=True)
71
+ class ValueAddedServiceType:
72
+ serviceCode: typing.Optional[str] = None
73
+ localServiceCode: typing.Optional[str] = None
74
+ value: typing.Optional[int] = None
75
+ currency: typing.Optional[str] = None
76
+
77
+
78
+ @attr.s(auto_attribs=True)
79
+ class ShipmentDetailType:
80
+ productCode: typing.Optional[str] = None
81
+ localProductCode: typing.Optional[str] = None
82
+ accounts: typing.Optional[typing.List[AccountType]] = jstruct.JList[AccountType]
83
+ valueAddedServices: typing.Optional[typing.List[ValueAddedServiceType]] = jstruct.JList[ValueAddedServiceType]
84
+ isCustomsDeclarable: typing.Optional[bool] = None
85
+ declaredValue: typing.Optional[int] = None
86
+ declaredValueCurrency: typing.Optional[str] = None
87
+ unitOfMeasurement: typing.Optional[str] = None
88
+ shipmentTrackingNumber: typing.Optional[int] = None
89
+ packages: typing.Optional[typing.List[PackageType]] = jstruct.JList[PackageType]
90
+
91
+
92
+ @attr.s(auto_attribs=True)
93
+ class SpecialInstructionType:
94
+ value: typing.Optional[str] = None
95
+ typeCode: typing.Optional[str] = None
96
+
97
+
98
+ @attr.s(auto_attribs=True)
99
+ class PickupUpdateRequestType:
100
+ dispatchConfirmationNumber: typing.Optional[str] = None
101
+ originalShipperAccountNumber: typing.Optional[int] = None
102
+ plannedPickupDateAndTime: typing.Optional[str] = None
103
+ closeTime: typing.Optional[str] = None
104
+ location: typing.Optional[str] = None
105
+ locationType: typing.Optional[str] = None
106
+ accounts: typing.Optional[typing.List[AccountType]] = jstruct.JList[AccountType]
107
+ specialInstructions: typing.Optional[typing.List[SpecialInstructionType]] = jstruct.JList[SpecialInstructionType]
108
+ remark: typing.Optional[str] = None
109
+ customerDetails: typing.Optional[CustomerDetailsType] = jstruct.JStruct[CustomerDetailsType]
110
+ shipmentDetails: typing.Optional[typing.List[ShipmentDetailType]] = jstruct.JList[ShipmentDetailType]
@@ -0,0 +1,11 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class PickupUpdateResponseType:
8
+ dispatchConfirmationNumber: typing.Optional[str] = None
9
+ readyByTime: typing.Optional[str] = None
10
+ nextPickupDate: typing.Optional[str] = None
11
+ warnings: typing.Optional[typing.List[str]] = None
@@ -0,0 +1,114 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class AccountType:
8
+ typeCode: typing.Optional[str] = None
9
+ number: typing.Optional[int] = None
10
+
11
+
12
+ @attr.s(auto_attribs=True)
13
+ class ContactInformationType:
14
+ email: typing.Optional[str] = None
15
+ phone: typing.Optional[str] = None
16
+ mobilePhone: typing.Optional[str] = None
17
+ companyName: typing.Optional[str] = None
18
+ fullName: typing.Optional[str] = None
19
+
20
+
21
+ @attr.s(auto_attribs=True)
22
+ class PostalAddressType:
23
+ postalCode: typing.Optional[int] = None
24
+ cityName: typing.Optional[str] = None
25
+ countryCode: typing.Optional[str] = None
26
+ provinceCode: typing.Optional[str] = None
27
+ addressLine1: typing.Optional[str] = None
28
+ addressLine2: typing.Optional[str] = None
29
+ addressLine3: typing.Optional[str] = None
30
+ countyName: typing.Optional[str] = None
31
+
32
+
33
+ @attr.s(auto_attribs=True)
34
+ class RegistrationNumberType:
35
+ typeCode: typing.Optional[str] = None
36
+ number: typing.Optional[str] = None
37
+ issuerCountryCode: typing.Optional[str] = None
38
+
39
+
40
+ @attr.s(auto_attribs=True)
41
+ class ErDetailsType:
42
+ postalAddress: typing.Optional[PostalAddressType] = jstruct.JStruct[PostalAddressType]
43
+ contactInformation: typing.Optional[ContactInformationType] = jstruct.JStruct[ContactInformationType]
44
+ registrationNumbers: typing.Optional[typing.List[RegistrationNumberType]] = jstruct.JList[RegistrationNumberType]
45
+ typeCode: typing.Optional[str] = None
46
+
47
+
48
+ @attr.s(auto_attribs=True)
49
+ class CustomerDetailsType:
50
+ shipperDetails: typing.Optional[ErDetailsType] = jstruct.JStruct[ErDetailsType]
51
+ receiverDetails: typing.Optional[ErDetailsType] = jstruct.JStruct[ErDetailsType]
52
+
53
+
54
+ @attr.s(auto_attribs=True)
55
+ class EstimatedDeliveryDateType:
56
+ isRequested: typing.Optional[bool] = None
57
+ typeCode: typing.Optional[str] = None
58
+
59
+
60
+ @attr.s(auto_attribs=True)
61
+ class MonetaryAmountType:
62
+ typeCode: typing.Optional[str] = None
63
+ value: typing.Optional[int] = None
64
+ currency: typing.Optional[str] = None
65
+
66
+
67
+ @attr.s(auto_attribs=True)
68
+ class DimensionsType:
69
+ length: typing.Optional[int] = None
70
+ width: typing.Optional[int] = None
71
+ height: typing.Optional[int] = None
72
+
73
+
74
+ @attr.s(auto_attribs=True)
75
+ class PackageType:
76
+ typeCode: typing.Optional[str] = None
77
+ weight: typing.Optional[float] = None
78
+ dimensions: typing.Optional[DimensionsType] = jstruct.JStruct[DimensionsType]
79
+
80
+
81
+ @attr.s(auto_attribs=True)
82
+ class ValueAddedServiceType:
83
+ serviceCode: typing.Optional[str] = None
84
+ value: typing.Optional[int] = None
85
+ currency: typing.Optional[str] = None
86
+
87
+
88
+ @attr.s(auto_attribs=True)
89
+ class ProductsAndServiceType:
90
+ productCode: typing.Optional[str] = None
91
+ localProductCode: typing.Optional[str] = None
92
+ valueAddedServices: typing.Optional[typing.List[ValueAddedServiceType]] = jstruct.JList[ValueAddedServiceType]
93
+
94
+
95
+ @attr.s(auto_attribs=True)
96
+ class RateRequestType:
97
+ customerDetails: typing.Optional[CustomerDetailsType] = jstruct.JStruct[CustomerDetailsType]
98
+ accounts: typing.Optional[typing.List[AccountType]] = jstruct.JList[AccountType]
99
+ productCode: typing.Optional[str] = None
100
+ localProductCode: typing.Optional[str] = None
101
+ valueAddedServices: typing.Optional[typing.List[ValueAddedServiceType]] = jstruct.JList[ValueAddedServiceType]
102
+ productsAndServices: typing.Optional[typing.List[ProductsAndServiceType]] = jstruct.JList[ProductsAndServiceType]
103
+ payerCountryCode: typing.Optional[str] = None
104
+ plannedShippingDateAndTime: typing.Optional[str] = None
105
+ unitOfMeasurement: typing.Optional[str] = None
106
+ isCustomsDeclarable: typing.Optional[bool] = None
107
+ monetaryAmount: typing.Optional[typing.List[MonetaryAmountType]] = jstruct.JList[MonetaryAmountType]
108
+ requestAllValueAddedServices: typing.Optional[bool] = None
109
+ returnStandardProductsOnly: typing.Optional[bool] = None
110
+ nextBusinessDay: typing.Optional[bool] = None
111
+ productTypeCode: typing.Optional[str] = None
112
+ packages: typing.Optional[typing.List[PackageType]] = jstruct.JList[PackageType]
113
+ estimatedDeliveryDate: typing.Optional[EstimatedDeliveryDateType] = jstruct.JStruct[EstimatedDeliveryDateType]
114
+ getAdditionalInformation: typing.Optional[typing.List[EstimatedDeliveryDateType]] = jstruct.JList[EstimatedDeliveryDateType]
@@ -0,0 +1,143 @@
1
+ import attr
2
+ import jstruct
3
+ import typing
4
+
5
+
6
+ @attr.s(auto_attribs=True)
7
+ class ExchangeRateType:
8
+ currentExchangeRate: typing.Optional[float] = None
9
+ currency: typing.Optional[str] = None
10
+ baseCurrency: typing.Optional[str] = None
11
+
12
+
13
+ @attr.s(auto_attribs=True)
14
+ class DeliveryCapabilitiesType:
15
+ deliveryTypeCode: typing.Optional[str] = None
16
+ estimatedDeliveryDateAndTime: typing.Optional[str] = None
17
+ destinationServiceAreaCode: typing.Optional[str] = None
18
+ destinationFacilityAreaCode: typing.Optional[str] = None
19
+ deliveryAdditionalDays: typing.Optional[int] = None
20
+ deliveryDayOfWeek: typing.Optional[int] = None
21
+ totalTransitDays: typing.Optional[int] = None
22
+
23
+
24
+ @attr.s(auto_attribs=True)
25
+ class PriceBreakdownType:
26
+ priceType: typing.Optional[str] = None
27
+ typeCode: typing.Optional[str] = None
28
+ price: typing.Optional[int] = None
29
+ rate: typing.Optional[int] = None
30
+ basePrice: typing.Optional[int] = None
31
+
32
+
33
+ @attr.s(auto_attribs=True)
34
+ class BreakdownType:
35
+ name: typing.Optional[str] = None
36
+ serviceCode: typing.Optional[str] = None
37
+ localServiceCode: typing.Optional[str] = None
38
+ typeCode: typing.Optional[str] = None
39
+ serviceTypeCode: typing.Optional[str] = None
40
+ price: typing.Optional[float] = None
41
+ priceCurrency: typing.Optional[str] = None
42
+ isCustomerAgreement: typing.Optional[bool] = None
43
+ isMarketedService: typing.Optional[bool] = None
44
+ isBillingServiceIndicator: typing.Optional[bool] = None
45
+ priceBreakdown: typing.Optional[typing.List[PriceBreakdownType]] = jstruct.JList[PriceBreakdownType]
46
+ tariffRateFormula: typing.Optional[str] = None
47
+
48
+
49
+ @attr.s(auto_attribs=True)
50
+ class DetailedPriceBreakdownType:
51
+ currencyType: typing.Optional[str] = None
52
+ priceCurrency: typing.Optional[str] = None
53
+ breakdown: typing.Optional[typing.List[BreakdownType]] = jstruct.JList[BreakdownType]
54
+
55
+
56
+ @attr.s(auto_attribs=True)
57
+ class PickupCapabilitiesType:
58
+ nextBusinessDay: typing.Optional[bool] = None
59
+ localCutoffDateAndTime: typing.Optional[str] = None
60
+ GMTCutoffTime: typing.Optional[str] = None
61
+ pickupEarliest: typing.Optional[str] = None
62
+ pickupLatest: typing.Optional[str] = None
63
+ originServiceAreaCode: typing.Optional[str] = None
64
+ originFacilityAreaCode: typing.Optional[str] = None
65
+ pickupAdditionalDays: typing.Optional[int] = None
66
+ pickupDayOfWeek: typing.Optional[int] = None
67
+
68
+
69
+ @attr.s(auto_attribs=True)
70
+ class ServiceCodeType:
71
+ serviceCode: typing.Optional[str] = None
72
+
73
+
74
+ @attr.s(auto_attribs=True)
75
+ class DependencyRuleGroupType:
76
+ dependencyRuleName: typing.Optional[str] = None
77
+ dependencyDescription: typing.Optional[str] = None
78
+ dependencyCondition: typing.Optional[str] = None
79
+ requiredServiceCodes: typing.Optional[typing.List[ServiceCodeType]] = jstruct.JList[ServiceCodeType]
80
+
81
+
82
+ @attr.s(auto_attribs=True)
83
+ class ServiceCodeDependencyRuleGroupType:
84
+ dependentServiceCode: typing.Optional[str] = None
85
+ dependencyRuleGroup: typing.Optional[typing.List[DependencyRuleGroupType]] = jstruct.JList[DependencyRuleGroupType]
86
+
87
+
88
+ @attr.s(auto_attribs=True)
89
+ class ServiceCodeMutuallyExclusiveGroupType:
90
+ serviceCodeRuleName: typing.Optional[str] = None
91
+ description: typing.Optional[str] = None
92
+ serviceCodes: typing.Optional[typing.List[ServiceCodeType]] = jstruct.JList[ServiceCodeType]
93
+
94
+
95
+ @attr.s(auto_attribs=True)
96
+ class TotalPriceType:
97
+ currencyType: typing.Optional[str] = None
98
+ priceCurrency: typing.Optional[str] = None
99
+ price: typing.Optional[float] = None
100
+
101
+
102
+ @attr.s(auto_attribs=True)
103
+ class TotalPriceBreakdownType:
104
+ currencyType: typing.Optional[str] = None
105
+ priceCurrency: typing.Optional[str] = None
106
+ priceType: typing.Optional[str] = None
107
+ price: typing.Optional[int] = None
108
+ rate: typing.Optional[int] = None
109
+ basePrice: typing.Optional[int] = None
110
+
111
+
112
+ @attr.s(auto_attribs=True)
113
+ class WeightType:
114
+ volumetric: typing.Optional[int] = None
115
+ provided: typing.Optional[float] = None
116
+ unitOfMeasurement: typing.Optional[str] = None
117
+
118
+
119
+ @attr.s(auto_attribs=True)
120
+ class ProductType:
121
+ productName: typing.Optional[str] = None
122
+ productCode: typing.Optional[str] = None
123
+ localProductCode: typing.Optional[str] = None
124
+ localProductCountryCode: typing.Optional[str] = None
125
+ networkTypeCode: typing.Optional[str] = None
126
+ isCustomerAgreement: typing.Optional[bool] = None
127
+ weight: typing.Optional[WeightType] = jstruct.JStruct[WeightType]
128
+ totalPrice: typing.Optional[typing.List[TotalPriceType]] = jstruct.JList[TotalPriceType]
129
+ totalPriceBreakdown: typing.Optional[typing.List[TotalPriceBreakdownType]] = jstruct.JList[TotalPriceBreakdownType]
130
+ detailedPriceBreakdown: typing.Optional[typing.List[DetailedPriceBreakdownType]] = jstruct.JList[DetailedPriceBreakdownType]
131
+ serviceCodeMutuallyExclusiveGroups: typing.Optional[typing.List[ServiceCodeMutuallyExclusiveGroupType]] = jstruct.JList[ServiceCodeMutuallyExclusiveGroupType]
132
+ serviceCodeDependencyRuleGroups: typing.Optional[typing.List[ServiceCodeDependencyRuleGroupType]] = jstruct.JList[ServiceCodeDependencyRuleGroupType]
133
+ pickupCapabilities: typing.Optional[PickupCapabilitiesType] = jstruct.JStruct[PickupCapabilitiesType]
134
+ deliveryCapabilities: typing.Optional[DeliveryCapabilitiesType] = jstruct.JStruct[DeliveryCapabilitiesType]
135
+ items: typing.Optional[typing.List[typing.Any]] = None
136
+ pricingDate: typing.Optional[str] = None
137
+
138
+
139
+ @attr.s(auto_attribs=True)
140
+ class RateResponseType:
141
+ products: typing.Optional[typing.List[ProductType]] = jstruct.JList[ProductType]
142
+ exchangeRates: typing.Optional[typing.List[ExchangeRateType]] = jstruct.JList[ExchangeRateType]
143
+ warnings: typing.Optional[typing.List[str]] = None