Skip to content

Commit

Permalink
Addded payload for soft deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
Edbo849 committed Sep 3, 2024
1 parent 9930782 commit 8c04d4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 11 additions & 1 deletion esgf_playground_utils/models/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from datetime import datetime
from enum import Enum
from typing import Literal, Union
from typing import Any, Dict, Literal, Union

from pydantic import BaseModel
from stac_pydantic.item import Item
Expand Down Expand Up @@ -52,6 +52,16 @@ class RevokePayload(_Payload):
item_id: str


class PartialUpdatePayload(_Payload):
"""
Model describing a ``PARTIAL_UPDATE`` payload. This must be sent as a ``PATCH`` request.
"""

method: Literal["PATCH"]
item: Dict[str, Any]
item_id: str


class UpdatePayload(_Payload):
"""
Model describing a ``UPDATE`` payload. This must be sent as a ``PATCH`` or ``PUT`` request.
Expand Down
3 changes: 1 addition & 2 deletions test/functional_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

import unittest

from pydantic import ValidationError

from esgf_playground_utils.models.kafka import (
CreatePayload,
KafkaEvent,
RevokePayload,
UpdatePayload,
)
from pydantic import ValidationError


class TestKafkaEvent(unittest.TestCase):
Expand Down

0 comments on commit 8c04d4e

Please sign in to comment.