Skip to content

Commit a096410

Browse files
committed
fix: parsing rules based on customer setup/feedback
1 parent ae6e3d5 commit a096410

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

docs/docs/design.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ There are three types of schema definitions, each one of them suffixed with thei
5555
- **Summary** is what is returned by the Gallagher API in operations such as [searches](https://gallaghersecurity.github.io/cc-rest-docs/ref/cardholders.html), these are generally a subset of the full object
5656
- **Detail** are the full object found at a particular `href`, they compound on the `Summary` schema and add additional attributes
5757
- **Responses** are resposnes sent back from the server, these will typically contain a set of `Summary` or `Detail` objects. When fetching _detailed_ responses for an object the server will often respond with a `Detail` object without a wrapper `Response` object.
58+
- **Payloads** are objects that are sent to the server as part of a `POST` or `PUT` operation, these are suffixed with **Payload**, some of these also offer `Builder` classes to assist with construction of the payload.
5859

5960
I additional we have classes that defined responses which are suffixed with **Response**, these wrap structures which returns `hrefs` for `next` and `previous` responses and usually have a collection to hold the response.
6061

gallagher/dto/detail/cardholder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CardholderPersonalDataField(
5353
value, which also is accessible using the key at the dictionary level.
5454
"""
5555
definition: PdfSummary
56-
value: str | HrefMixin
56+
value: str | HrefMixin | int | float | bool | None
5757
notifications: Optional[bool] = False # Local to the @Email field
5858

5959

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
""" Cardholder Update Builder exploration
2+
3+
"""
4+
from ..ref.card import CardTypeRef
5+
6+
from pydantic import BaseModel, URL
7+
8+
class CardholderUpdateBuilder:
9+
10+
def __init__(self):
11+
self.cards = []
12+
13+
def add_card(self, card: CardTypeRef):
14+
self.cards.append(card)
15+
16+
def remove_card(self, href: URL):
17+
pass

gallagher/dto/ref/card_type.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
from ..utils import (
55
AppBaseModel,
6-
IdentityMixin,
7-
HrefMixin,
86
OptionalHrefMixin,
97
)
108

119
class CardTypeRef(
1210
AppBaseModel,
13-
HrefMixin,
11+
OptionalHrefMixin,
1412
):
1513
""" Reference for a card type """
1614
name: str

0 commit comments

Comments
 (0)