python-amcards 1.7.4__py3-none-any.whl → 1.7.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amcards/models.py +18 -7
- {python_amcards-1.7.4.dist-info → python_amcards-1.7.6.dist-info}/METADATA +1 -1
- python_amcards-1.7.6.dist-info/RECORD +10 -0
- {python_amcards-1.7.4.dist-info → python_amcards-1.7.6.dist-info}/WHEEL +1 -1
- python_amcards-1.7.4.dist-info/RECORD +0 -10
- {python_amcards-1.7.4.dist-info → python_amcards-1.7.6.dist-info}/licenses/LICENSE +0 -0
- {python_amcards-1.7.4.dist-info → python_amcards-1.7.6.dist-info}/top_level.txt +0 -0
amcards/models.py
CHANGED
|
@@ -28,6 +28,7 @@ class User:
|
|
|
28
28
|
international_postage_cost: int,
|
|
29
29
|
domestic_postage_countries: set,
|
|
30
30
|
greeting_card_cost: int,
|
|
31
|
+
monthly_report_emails: List[str],
|
|
31
32
|
) -> None:
|
|
32
33
|
self._id = id
|
|
33
34
|
self._first_name = first_name
|
|
@@ -46,6 +47,7 @@ class User:
|
|
|
46
47
|
self._international_postage_cost = international_postage_cost
|
|
47
48
|
self._domestic_postage_countries = domestic_postage_countries
|
|
48
49
|
self._greeting_card_cost = greeting_card_cost
|
|
50
|
+
self._monthly_report_emails = monthly_report_emails
|
|
49
51
|
|
|
50
52
|
__repr__ = helpers.repr
|
|
51
53
|
|
|
@@ -135,6 +137,11 @@ class User:
|
|
|
135
137
|
"""User's base cost of a greeting card excluding postage."""
|
|
136
138
|
return self._greeting_card_cost
|
|
137
139
|
|
|
140
|
+
@property
|
|
141
|
+
def monthly_report_emails(self) -> List[str]:
|
|
142
|
+
"""Email addresses that receive monthly reports."""
|
|
143
|
+
return self._monthly_report_emails
|
|
144
|
+
|
|
138
145
|
@classmethod
|
|
139
146
|
def _from_json(cls, json: dict):
|
|
140
147
|
user_id = json['resource_uri']
|
|
@@ -157,7 +164,8 @@ class User:
|
|
|
157
164
|
domestic_postage_cost=json['postage']['domestic_cost'],
|
|
158
165
|
international_postage_cost=json['postage']['international_cost'],
|
|
159
166
|
domestic_postage_countries=set(json['postage']['domestic_countries']),
|
|
160
|
-
greeting_card_cost=json['product_pricing_info']['5x7greetingcard']
|
|
167
|
+
greeting_card_cost=json['product_pricing_info']['5x7greetingcard'],
|
|
168
|
+
monthly_report_emails=(json.get('monthly_report_emails') or []),
|
|
161
169
|
)
|
|
162
170
|
|
|
163
171
|
class Gift:
|
|
@@ -888,7 +896,7 @@ class CampaignMultiResponse:
|
|
|
888
896
|
"""Represents AMcards' response for sending a drip campaign to multiple contacts."""
|
|
889
897
|
def __init__(
|
|
890
898
|
self,
|
|
891
|
-
mailing_id: int,
|
|
899
|
+
mailing_id: Optional[int],
|
|
892
900
|
contacts_scheduled_count: int,
|
|
893
901
|
duplicate_contacts_count: int,
|
|
894
902
|
contacts_scheduled_third_party_contact_ids: List[str],
|
|
@@ -903,13 +911,15 @@ class CampaignMultiResponse:
|
|
|
903
911
|
__repr__ = helpers.repr
|
|
904
912
|
|
|
905
913
|
@property
|
|
906
|
-
def mailing_id(self) -> int:
|
|
907
|
-
"""Unique id for the :py:class:`mailing <amcards.models.Mailing>` created."""
|
|
914
|
+
def mailing_id(self) -> Optional[int]:
|
|
915
|
+
"""Unique id for the :py:class:`mailing <amcards.models.Mailing>` created, if returned."""
|
|
908
916
|
return self._mailing_id
|
|
909
917
|
|
|
910
918
|
@property
|
|
911
|
-
def mailing_link(self) -> str:
|
|
912
|
-
"""This is the link to the mailing list inside of AMcards.com."""
|
|
919
|
+
def mailing_link(self) -> Optional[str]:
|
|
920
|
+
"""This is the link to the mailing list inside of AMcards.com, if available."""
|
|
921
|
+
if self._mailing_id is None:
|
|
922
|
+
return None
|
|
913
923
|
return f'https://amcards.com/cards/history/?mailing={self._mailing_id}'
|
|
914
924
|
|
|
915
925
|
@property
|
|
@@ -934,8 +944,9 @@ class CampaignMultiResponse:
|
|
|
934
944
|
|
|
935
945
|
@classmethod
|
|
936
946
|
def _from_json(cls, json: dict):
|
|
947
|
+
mailing_id = json.get('mailing_id')
|
|
937
948
|
return cls(
|
|
938
|
-
mailing_id=
|
|
949
|
+
mailing_id=int(mailing_id) if mailing_id is not None else None,
|
|
939
950
|
contacts_scheduled_count=json['contacts_scheduled_count'],
|
|
940
951
|
duplicate_contacts_count=json['duplicate_contacts_count'],
|
|
941
952
|
contacts_scheduled_third_party_contact_ids=json['contacts_scheduled_third_party_contact_ids'],
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
amcards/__helpers.py,sha256=X-3dsizpSbJw1K6Gsq87Rf-pELACyWxWXElaz9zkz1c,6407
|
|
2
|
+
amcards/__init__.py,sha256=nl-oq4BKdYSQZPNbtraEMHFf_8MU8gSOlJZIYxKudcM,34
|
|
3
|
+
amcards/amcards.py,sha256=O0bepmrE6lf8TeNXOrQYziIhrO2vbgoY3SBBZ07rIto,69684
|
|
4
|
+
amcards/exceptions.py,sha256=UpAaepY_zl9NyR3LUBXl8mEi50vyIkih1sWOVRQzxsE,2119
|
|
5
|
+
amcards/models.py,sha256=bfJOxknM-ow9l7CwFUeDgDsZtsI_zVj5u2y16c3VTsA,34755
|
|
6
|
+
python_amcards-1.7.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
7
|
+
python_amcards-1.7.6.dist-info/METADATA,sha256=fqde0CcB_AZWTS9XedhGTKB5zPM__oEitzJebcOdzNo,3270
|
|
8
|
+
python_amcards-1.7.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
9
|
+
python_amcards-1.7.6.dist-info/top_level.txt,sha256=xst-AU0pzvWXz3DQR-QICIruzgcf4Bkt6FF_GldcIck,8
|
|
10
|
+
python_amcards-1.7.6.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
amcards/__helpers.py,sha256=X-3dsizpSbJw1K6Gsq87Rf-pELACyWxWXElaz9zkz1c,6407
|
|
2
|
-
amcards/__init__.py,sha256=nl-oq4BKdYSQZPNbtraEMHFf_8MU8gSOlJZIYxKudcM,34
|
|
3
|
-
amcards/amcards.py,sha256=O0bepmrE6lf8TeNXOrQYziIhrO2vbgoY3SBBZ07rIto,69684
|
|
4
|
-
amcards/exceptions.py,sha256=UpAaepY_zl9NyR3LUBXl8mEi50vyIkih1sWOVRQzxsE,2119
|
|
5
|
-
amcards/models.py,sha256=Tfcj7_7UshNcAV6OyBxVyzwpX5G9ViiYLohQqCDmTz4,34212
|
|
6
|
-
python_amcards-1.7.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
7
|
-
python_amcards-1.7.4.dist-info/METADATA,sha256=qJ4rBLMdzJDyp06DIJGLzka8LKlebRNMI4VwqwUnfVs,3270
|
|
8
|
-
python_amcards-1.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
-
python_amcards-1.7.4.dist-info/top_level.txt,sha256=xst-AU0pzvWXz3DQR-QICIruzgcf4Bkt6FF_GldcIck,8
|
|
10
|
-
python_amcards-1.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|