python-amcards 1.7.4__tar.gz → 1.7.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amcards
3
- Version: 1.7.4
3
+ Version: 1.7.5
4
4
  Summary: A wrapper for the AMcards API.
5
5
  Home-page: https://github.com/simonesestili/python-amcards
6
6
  Author: Simone Sestili
@@ -888,7 +888,7 @@ class CampaignMultiResponse:
888
888
  """Represents AMcards' response for sending a drip campaign to multiple contacts."""
889
889
  def __init__(
890
890
  self,
891
- mailing_id: int,
891
+ mailing_id: Optional[int],
892
892
  contacts_scheduled_count: int,
893
893
  duplicate_contacts_count: int,
894
894
  contacts_scheduled_third_party_contact_ids: List[str],
@@ -903,13 +903,15 @@ class CampaignMultiResponse:
903
903
  __repr__ = helpers.repr
904
904
 
905
905
  @property
906
- def mailing_id(self) -> int:
907
- """Unique id for the :py:class:`mailing <amcards.models.Mailing>` created."""
906
+ def mailing_id(self) -> Optional[int]:
907
+ """Unique id for the :py:class:`mailing <amcards.models.Mailing>` created, if returned."""
908
908
  return self._mailing_id
909
909
 
910
910
  @property
911
- def mailing_link(self) -> str:
912
- """This is the link to the mailing list inside of AMcards.com."""
911
+ def mailing_link(self) -> Optional[str]:
912
+ """This is the link to the mailing list inside of AMcards.com, if available."""
913
+ if self._mailing_id is None:
914
+ return None
913
915
  return f'https://amcards.com/cards/history/?mailing={self._mailing_id}'
914
916
 
915
917
  @property
@@ -934,8 +936,9 @@ class CampaignMultiResponse:
934
936
 
935
937
  @classmethod
936
938
  def _from_json(cls, json: dict):
939
+ mailing_id = json.get('mailing_id')
937
940
  return cls(
938
- mailing_id=json['mailing_id'],
941
+ mailing_id=int(mailing_id) if mailing_id is not None else None,
939
942
  contacts_scheduled_count=json['contacts_scheduled_count'],
940
943
  duplicate_contacts_count=json['duplicate_contacts_count'],
941
944
  contacts_scheduled_third_party_contact_ids=json['contacts_scheduled_third_party_contact_ids'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amcards
3
- Version: 1.7.4
3
+ Version: 1.7.5
4
4
  Summary: A wrapper for the AMcards API.
5
5
  Home-page: https://github.com/simonesestili/python-amcards
6
6
  Author: Simone Sestili
@@ -7,7 +7,7 @@ def README():
7
7
 
8
8
  setup(
9
9
  name='python-amcards',
10
- version='1.7.4',
10
+ version='1.7.5',
11
11
  description='A wrapper for the AMcards API.',
12
12
  long_description=README(),
13
13
  long_description_content_type='text/x-rst',
File without changes
File without changes