-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API for
frontend-api
and checkout
- Loading branch information
1 parent
57a47bc
commit ccac1d8
Showing
26 changed files
with
2,590 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is automatically generated by the rmf-codegen project. | ||
# | ||
# The Python code generator is maintained by Lab Digital. If you want to | ||
# contribute to this project then please do not edit this file directly | ||
# but send a pull request to the Lab Digital fork of rmf-codegen at | ||
# https://github.com/labd/rmf-codegen | ||
from .client import Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is automatically generated by the rmf-codegen project. | ||
# | ||
# The Python code generator is maintained by Lab Digital. If you want to | ||
# contribute to this project then please do not edit this file directly | ||
# but send a pull request to the Lab Digital fork of rmf-codegen at | ||
# https://github.com/labd/rmf-codegen | ||
|
||
from commercetools.client import BaseClient | ||
|
||
|
||
class Client(BaseClient): | ||
def __init__(self, *args, **kwargs): | ||
kwargs.setdefault("url", "https://checkout.{region}.commercetools.com") | ||
super().__init__(self, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file is automatically generated by the rmf-codegen project. | ||
# | ||
# The Python code generator is maintained by Lab Digital. If you want to | ||
# contribute to this project then please do not edit this file directly | ||
# but send a pull request to the Lab Digital fork of rmf-codegen at | ||
# https://github.com/labd/rmf-codegen | ||
|
||
from .responses import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This file is automatically generated by the rmf-codegen project. | ||
# | ||
# The Python code generator is maintained by Lab Digital. If you want to | ||
# contribute to this project then please do not edit this file directly | ||
# but send a pull request to the Lab Digital fork of rmf-codegen at | ||
# https://github.com/labd/rmf-codegen | ||
|
||
|
||
class _BaseType: | ||
def __eq__(self, other): | ||
if other.__class__ is self.__class__: | ||
return self.__values__() == other.__values__() | ||
else: | ||
return NotImplemented | ||
|
||
def __ne__(self, other): | ||
result = self.__eq__(other) | ||
if result is NotImplemented: | ||
return NotImplemented | ||
else: | ||
return not result | ||
|
||
def __lt__(self, other): | ||
if other.__class__ is self.__class__: | ||
return self.__values__() < other.__values__() | ||
else: | ||
return NotImplemented | ||
|
||
def __le__(self, other): | ||
if other.__class__ is self.__class__: | ||
return self.__values__() <= other.__values__() | ||
else: | ||
return NotImplemented | ||
|
||
def __gt__(self, other): | ||
if other.__class__ is self.__class__: | ||
return self.__values__() > other.__values__() | ||
else: | ||
return NotImplemented | ||
|
||
def __ge__(self, other): | ||
if other.__class__ is self.__class__: | ||
return self.__values__() >= other.__values__() | ||
else: | ||
return NotImplemented | ||
|
||
def __values__(self): | ||
return tuple(self.__dict__.values()) | ||
|
||
def __hash__(self): | ||
return hash((self.__class__,) + self.__values__()) | ||
|
||
def __repr__(self): | ||
return "%s(%s)" % ( | ||
self.__class__.__name__, | ||
", ".join("%s=%r" % (k, v) for k, v in self.__dict__.items()), | ||
) |
275 changes: 275 additions & 0 deletions
275
src/commercetools/checkout/models/_schemas/responses.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,275 @@ | ||
# This file is automatically generated by the rmf-codegen project. | ||
# | ||
# The Python code generator is maintained by Lab Digital. If you want to | ||
# contribute to this project then please do not edit this file directly | ||
# but send a pull request to the Lab Digital fork of rmf-codegen at | ||
# https://github.com/labd/rmf-codegen | ||
import re | ||
import typing | ||
|
||
import marshmallow | ||
import marshmallow_enum | ||
|
||
from commercetools import helpers | ||
|
||
from ... import models | ||
|
||
# Fields | ||
|
||
|
||
# Marshmallow Schemas | ||
class ResponseMessageSchema(helpers.BaseSchema): | ||
code = marshmallow.fields.String(allow_none=True, load_default=None) | ||
type = marshmallow.fields.String(allow_none=True, load_default=None) | ||
message = marshmallow.fields.String(allow_none=True, load_default=None) | ||
payload = marshmallow.fields.Raw( | ||
allow_none=True, metadata={"omit_empty": True}, load_default=None | ||
) | ||
|
||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.ResponseMessage(**data) | ||
|
||
|
||
class AdyenBadConfigSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.AdyenBadConfig(**data) | ||
|
||
|
||
class AdyenInitErrorSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.AdyenInitError(**data) | ||
|
||
|
||
class AdyenTimeoutSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.AdyenTimeout(**data) | ||
|
||
|
||
class ApplicationDeactivatedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.ApplicationDeactivated(**data) | ||
|
||
|
||
class ApplicationNotFoundSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.ApplicationNotFound(**data) | ||
|
||
|
||
class CartEmptiedDuringCheckoutSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CartEmptiedDuringCheckout(**data) | ||
|
||
|
||
class CartEmptySchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CartEmpty(**data) | ||
|
||
|
||
class CartNotFoundSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CartNotFound(**data) | ||
|
||
|
||
class CheckoutCancelledSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CheckoutCancelled(**data) | ||
|
||
|
||
class CheckoutCompletedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CheckoutCompleted(**data) | ||
|
||
|
||
class CheckoutLoadedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CheckoutLoaded(**data) | ||
|
||
|
||
class CheckoutStartedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.CheckoutStarted(**data) | ||
|
||
|
||
class InitTimeoutSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.InitTimeout(**data) | ||
|
||
|
||
class BadInputDataSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.BadInputData(**data) | ||
|
||
|
||
class InvalidTokenSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.InvalidToken(**data) | ||
|
||
|
||
class NoAllowedOriginsSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.NoAllowedOrigins(**data) | ||
|
||
|
||
class NoPaymentMethodsSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.NoPaymentMethods(**data) | ||
|
||
|
||
class NoShippingMethodsSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.NoShippingMethods(**data) | ||
|
||
|
||
class OrderCreatedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.OrderCreated(**data) | ||
|
||
|
||
class SellerIsDeactivatedSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.SellerIsDeactivated(**data) | ||
|
||
|
||
class SellerNotFoundSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.SellerNotFound(**data) | ||
|
||
|
||
class ShippingAddressMissingSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.ShippingAddressMissing(**data) | ||
|
||
|
||
class UnallowedOriginSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.UnallowedOrigin(**data) | ||
|
||
|
||
class UnavailableLocaleSchema(ResponseMessageSchema): | ||
class Meta: | ||
unknown = marshmallow.EXCLUDE | ||
|
||
@marshmallow.post_load | ||
def post_load(self, data, **kwargs): | ||
del data["code"] | ||
return models.UnavailableLocale(**data) |
Oops, something went wrong.