Example #1
0
class PaymentAddInterfaceInteractionActionSchema(PaymentUpdateActionSchema):
    "Marshmallow schema for :class:`commercetools.types.PaymentAddInterfaceInteractionAction`."
    type = marshmallow.fields.Nested(
        nested="commercetools.schemas._type.TypeResourceIdentifierSchema",
        unknown=marshmallow.EXCLUDE,
        allow_none=True,
    )
    fields = FieldContainerField(allow_none=True, missing=None)

    class Meta:
        unknown = marshmallow.EXCLUDE

    @marshmallow.post_load
    def post_load(self, data, **kwargs):
        del data["action"]
        return types.PaymentAddInterfaceInteractionAction(**data)
class CustomerGroupSetCustomTypeActionSchema(CustomerGroupUpdateActionSchema):
    "Marshmallow schema for :class:`commercetools.types.CustomerGroupSetCustomTypeAction`."
    type = marshmallow.fields.Nested(
        nested="commercetools.schemas._type.TypeReferenceSchema",
        unknown=marshmallow.EXCLUDE,
        allow_none=True,
        missing=None,
    )
    fields = FieldContainerField(allow_none=True, missing=None)

    class Meta:
        unknown = marshmallow.EXCLUDE

    @marshmallow.post_load
    def post_load(self, data):
        del data["action"]
        return types.CustomerGroupSetCustomTypeAction(**data)
class InventoryEntrySetCustomTypeActionSchema(InventoryEntryUpdateActionSchema
                                              ):
    "Marshmallow schema for :class:`commercetools.types.InventoryEntrySetCustomTypeAction`."
    type = marshmallow.fields.Nested(
        nested="commercetools.schemas._type.TypeResourceIdentifierSchema",
        unknown=marshmallow.EXCLUDE,
        allow_none=True,
        missing=None,
    )
    fields = FieldContainerField(allow_none=True, missing=None)

    class Meta:
        unknown = marshmallow.EXCLUDE

    @marshmallow.post_load
    def post_load(self, data):
        del data["action"]
        return types.InventoryEntrySetCustomTypeAction(**data)
class ShoppingListSetLineItemCustomTypeActionSchema(ShoppingListUpdateActionSchema):
    "Marshmallow schema for :class:`commercetools.types.ShoppingListSetLineItemCustomTypeAction`."
    line_item_id = marshmallow.fields.String(allow_none=True, data_key="lineItemId")
    type = marshmallow.fields.Nested(
        nested="commercetools.schemas._type.TypeResourceIdentifierSchema",
        unknown=marshmallow.EXCLUDE,
        allow_none=True,
        missing=None,
    )
    fields = FieldContainerField(allow_none=True, missing=None)

    class Meta:
        unknown = marshmallow.EXCLUDE

    @marshmallow.post_load
    def post_load(self, data):
        del data["action"]
        return types.ShoppingListSetLineItemCustomTypeAction(**data)