Skip to content

Commit 8c04d4e

Browse files
committed
Addded payload for soft deleting
1 parent 9930782 commit 8c04d4e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

esgf_playground_utils/models/kafka.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from datetime import datetime
66
from enum import Enum
7-
from typing import Literal, Union
7+
from typing import Any, Dict, Literal, Union
88

99
from pydantic import BaseModel
1010
from stac_pydantic.item import Item
@@ -52,6 +52,16 @@ class RevokePayload(_Payload):
5252
item_id: str
5353

5454

55+
class PartialUpdatePayload(_Payload):
56+
"""
57+
Model describing a ``PARTIAL_UPDATE`` payload. This must be sent as a ``PATCH`` request.
58+
"""
59+
60+
method: Literal["PATCH"]
61+
item: Dict[str, Any]
62+
item_id: str
63+
64+
5565
class UpdatePayload(_Payload):
5666
"""
5767
Model describing a ``UPDATE`` payload. This must be sent as a ``PATCH`` or ``PUT`` request.

test/functional_test/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
import unittest
66

7-
from pydantic import ValidationError
8-
97
from esgf_playground_utils.models.kafka import (
108
CreatePayload,
119
KafkaEvent,
1210
RevokePayload,
1311
UpdatePayload,
1412
)
13+
from pydantic import ValidationError
1514

1615

1716
class TestKafkaEvent(unittest.TestCase):

0 commit comments

Comments
 (0)