Skip to content

Commit ccac1d8

Browse files
committed
Add API for frontend-api and checkout
1 parent 57a47bc commit ccac1d8

26 files changed

+2590
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is automatically generated by the rmf-codegen project.
2+
#
3+
# The Python code generator is maintained by Lab Digital. If you want to
4+
# contribute to this project then please do not edit this file directly
5+
# but send a pull request to the Lab Digital fork of rmf-codegen at
6+
# https://github.com/labd/rmf-codegen
7+
from .client import Client
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by the rmf-codegen project.
2+
#
3+
# The Python code generator is maintained by Lab Digital. If you want to
4+
# contribute to this project then please do not edit this file directly
5+
# but send a pull request to the Lab Digital fork of rmf-codegen at
6+
# https://github.com/labd/rmf-codegen
7+
8+
from commercetools.client import BaseClient
9+
10+
11+
class Client(BaseClient):
12+
def __init__(self, *args, **kwargs):
13+
kwargs.setdefault("url", "https://checkout.{region}.commercetools.com")
14+
super().__init__(self, **kwargs)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file is automatically generated by the rmf-codegen project.
2+
#
3+
# The Python code generator is maintained by Lab Digital. If you want to
4+
# contribute to this project then please do not edit this file directly
5+
# but send a pull request to the Lab Digital fork of rmf-codegen at
6+
# https://github.com/labd/rmf-codegen
7+
8+
from .responses import * # noqa
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This file is automatically generated by the rmf-codegen project.
2+
#
3+
# The Python code generator is maintained by Lab Digital. If you want to
4+
# contribute to this project then please do not edit this file directly
5+
# but send a pull request to the Lab Digital fork of rmf-codegen at
6+
# https://github.com/labd/rmf-codegen
7+
8+
9+
class _BaseType:
10+
def __eq__(self, other):
11+
if other.__class__ is self.__class__:
12+
return self.__values__() == other.__values__()
13+
else:
14+
return NotImplemented
15+
16+
def __ne__(self, other):
17+
result = self.__eq__(other)
18+
if result is NotImplemented:
19+
return NotImplemented
20+
else:
21+
return not result
22+
23+
def __lt__(self, other):
24+
if other.__class__ is self.__class__:
25+
return self.__values__() < other.__values__()
26+
else:
27+
return NotImplemented
28+
29+
def __le__(self, other):
30+
if other.__class__ is self.__class__:
31+
return self.__values__() <= other.__values__()
32+
else:
33+
return NotImplemented
34+
35+
def __gt__(self, other):
36+
if other.__class__ is self.__class__:
37+
return self.__values__() > other.__values__()
38+
else:
39+
return NotImplemented
40+
41+
def __ge__(self, other):
42+
if other.__class__ is self.__class__:
43+
return self.__values__() >= other.__values__()
44+
else:
45+
return NotImplemented
46+
47+
def __values__(self):
48+
return tuple(self.__dict__.values())
49+
50+
def __hash__(self):
51+
return hash((self.__class__,) + self.__values__())
52+
53+
def __repr__(self):
54+
return "%s(%s)" % (
55+
self.__class__.__name__,
56+
", ".join("%s=%r" % (k, v) for k, v in self.__dict__.items()),
57+
)
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
# This file is automatically generated by the rmf-codegen project.
2+
#
3+
# The Python code generator is maintained by Lab Digital. If you want to
4+
# contribute to this project then please do not edit this file directly
5+
# but send a pull request to the Lab Digital fork of rmf-codegen at
6+
# https://github.com/labd/rmf-codegen
7+
import re
8+
import typing
9+
10+
import marshmallow
11+
import marshmallow_enum
12+
13+
from commercetools import helpers
14+
15+
from ... import models
16+
17+
# Fields
18+
19+
20+
# Marshmallow Schemas
21+
class ResponseMessageSchema(helpers.BaseSchema):
22+
code = marshmallow.fields.String(allow_none=True, load_default=None)
23+
type = marshmallow.fields.String(allow_none=True, load_default=None)
24+
message = marshmallow.fields.String(allow_none=True, load_default=None)
25+
payload = marshmallow.fields.Raw(
26+
allow_none=True, metadata={"omit_empty": True}, load_default=None
27+
)
28+
29+
class Meta:
30+
unknown = marshmallow.EXCLUDE
31+
32+
@marshmallow.post_load
33+
def post_load(self, data, **kwargs):
34+
del data["code"]
35+
return models.ResponseMessage(**data)
36+
37+
38+
class AdyenBadConfigSchema(ResponseMessageSchema):
39+
class Meta:
40+
unknown = marshmallow.EXCLUDE
41+
42+
@marshmallow.post_load
43+
def post_load(self, data, **kwargs):
44+
del data["code"]
45+
return models.AdyenBadConfig(**data)
46+
47+
48+
class AdyenInitErrorSchema(ResponseMessageSchema):
49+
class Meta:
50+
unknown = marshmallow.EXCLUDE
51+
52+
@marshmallow.post_load
53+
def post_load(self, data, **kwargs):
54+
del data["code"]
55+
return models.AdyenInitError(**data)
56+
57+
58+
class AdyenTimeoutSchema(ResponseMessageSchema):
59+
class Meta:
60+
unknown = marshmallow.EXCLUDE
61+
62+
@marshmallow.post_load
63+
def post_load(self, data, **kwargs):
64+
del data["code"]
65+
return models.AdyenTimeout(**data)
66+
67+
68+
class ApplicationDeactivatedSchema(ResponseMessageSchema):
69+
class Meta:
70+
unknown = marshmallow.EXCLUDE
71+
72+
@marshmallow.post_load
73+
def post_load(self, data, **kwargs):
74+
del data["code"]
75+
return models.ApplicationDeactivated(**data)
76+
77+
78+
class ApplicationNotFoundSchema(ResponseMessageSchema):
79+
class Meta:
80+
unknown = marshmallow.EXCLUDE
81+
82+
@marshmallow.post_load
83+
def post_load(self, data, **kwargs):
84+
del data["code"]
85+
return models.ApplicationNotFound(**data)
86+
87+
88+
class CartEmptiedDuringCheckoutSchema(ResponseMessageSchema):
89+
class Meta:
90+
unknown = marshmallow.EXCLUDE
91+
92+
@marshmallow.post_load
93+
def post_load(self, data, **kwargs):
94+
del data["code"]
95+
return models.CartEmptiedDuringCheckout(**data)
96+
97+
98+
class CartEmptySchema(ResponseMessageSchema):
99+
class Meta:
100+
unknown = marshmallow.EXCLUDE
101+
102+
@marshmallow.post_load
103+
def post_load(self, data, **kwargs):
104+
del data["code"]
105+
return models.CartEmpty(**data)
106+
107+
108+
class CartNotFoundSchema(ResponseMessageSchema):
109+
class Meta:
110+
unknown = marshmallow.EXCLUDE
111+
112+
@marshmallow.post_load
113+
def post_load(self, data, **kwargs):
114+
del data["code"]
115+
return models.CartNotFound(**data)
116+
117+
118+
class CheckoutCancelledSchema(ResponseMessageSchema):
119+
class Meta:
120+
unknown = marshmallow.EXCLUDE
121+
122+
@marshmallow.post_load
123+
def post_load(self, data, **kwargs):
124+
del data["code"]
125+
return models.CheckoutCancelled(**data)
126+
127+
128+
class CheckoutCompletedSchema(ResponseMessageSchema):
129+
class Meta:
130+
unknown = marshmallow.EXCLUDE
131+
132+
@marshmallow.post_load
133+
def post_load(self, data, **kwargs):
134+
del data["code"]
135+
return models.CheckoutCompleted(**data)
136+
137+
138+
class CheckoutLoadedSchema(ResponseMessageSchema):
139+
class Meta:
140+
unknown = marshmallow.EXCLUDE
141+
142+
@marshmallow.post_load
143+
def post_load(self, data, **kwargs):
144+
del data["code"]
145+
return models.CheckoutLoaded(**data)
146+
147+
148+
class CheckoutStartedSchema(ResponseMessageSchema):
149+
class Meta:
150+
unknown = marshmallow.EXCLUDE
151+
152+
@marshmallow.post_load
153+
def post_load(self, data, **kwargs):
154+
del data["code"]
155+
return models.CheckoutStarted(**data)
156+
157+
158+
class InitTimeoutSchema(ResponseMessageSchema):
159+
class Meta:
160+
unknown = marshmallow.EXCLUDE
161+
162+
@marshmallow.post_load
163+
def post_load(self, data, **kwargs):
164+
del data["code"]
165+
return models.InitTimeout(**data)
166+
167+
168+
class BadInputDataSchema(ResponseMessageSchema):
169+
class Meta:
170+
unknown = marshmallow.EXCLUDE
171+
172+
@marshmallow.post_load
173+
def post_load(self, data, **kwargs):
174+
del data["code"]
175+
return models.BadInputData(**data)
176+
177+
178+
class InvalidTokenSchema(ResponseMessageSchema):
179+
class Meta:
180+
unknown = marshmallow.EXCLUDE
181+
182+
@marshmallow.post_load
183+
def post_load(self, data, **kwargs):
184+
del data["code"]
185+
return models.InvalidToken(**data)
186+
187+
188+
class NoAllowedOriginsSchema(ResponseMessageSchema):
189+
class Meta:
190+
unknown = marshmallow.EXCLUDE
191+
192+
@marshmallow.post_load
193+
def post_load(self, data, **kwargs):
194+
del data["code"]
195+
return models.NoAllowedOrigins(**data)
196+
197+
198+
class NoPaymentMethodsSchema(ResponseMessageSchema):
199+
class Meta:
200+
unknown = marshmallow.EXCLUDE
201+
202+
@marshmallow.post_load
203+
def post_load(self, data, **kwargs):
204+
del data["code"]
205+
return models.NoPaymentMethods(**data)
206+
207+
208+
class NoShippingMethodsSchema(ResponseMessageSchema):
209+
class Meta:
210+
unknown = marshmallow.EXCLUDE
211+
212+
@marshmallow.post_load
213+
def post_load(self, data, **kwargs):
214+
del data["code"]
215+
return models.NoShippingMethods(**data)
216+
217+
218+
class OrderCreatedSchema(ResponseMessageSchema):
219+
class Meta:
220+
unknown = marshmallow.EXCLUDE
221+
222+
@marshmallow.post_load
223+
def post_load(self, data, **kwargs):
224+
del data["code"]
225+
return models.OrderCreated(**data)
226+
227+
228+
class SellerIsDeactivatedSchema(ResponseMessageSchema):
229+
class Meta:
230+
unknown = marshmallow.EXCLUDE
231+
232+
@marshmallow.post_load
233+
def post_load(self, data, **kwargs):
234+
del data["code"]
235+
return models.SellerIsDeactivated(**data)
236+
237+
238+
class SellerNotFoundSchema(ResponseMessageSchema):
239+
class Meta:
240+
unknown = marshmallow.EXCLUDE
241+
242+
@marshmallow.post_load
243+
def post_load(self, data, **kwargs):
244+
del data["code"]
245+
return models.SellerNotFound(**data)
246+
247+
248+
class ShippingAddressMissingSchema(ResponseMessageSchema):
249+
class Meta:
250+
unknown = marshmallow.EXCLUDE
251+
252+
@marshmallow.post_load
253+
def post_load(self, data, **kwargs):
254+
del data["code"]
255+
return models.ShippingAddressMissing(**data)
256+
257+
258+
class UnallowedOriginSchema(ResponseMessageSchema):
259+
class Meta:
260+
unknown = marshmallow.EXCLUDE
261+
262+
@marshmallow.post_load
263+
def post_load(self, data, **kwargs):
264+
del data["code"]
265+
return models.UnallowedOrigin(**data)
266+
267+
268+
class UnavailableLocaleSchema(ResponseMessageSchema):
269+
class Meta:
270+
unknown = marshmallow.EXCLUDE
271+
272+
@marshmallow.post_load
273+
def post_load(self, data, **kwargs):
274+
del data["code"]
275+
return models.UnavailableLocale(**data)

0 commit comments

Comments
 (0)