sendinblue / APIv3-python-library

SendinBlue's python library for API v3
MIT License
82 stars 40 forks source link

get_sms_campaigns and get_email_campaigns gives error whenever there is no campaign. #51

Closed aakash2610 closed 3 years ago

aakash2610 commented 4 years ago

I am using SIB api for email and sms services. I am getting the following error whenever there are 0 campaigns (email or sms):

File "/Users/aakash/Desktop/experiments/repos/organonconnect/analytics/sib.py", line 94, in GetEmailCampaigns
    api_response = email_api_instance.get_email_campaigns()
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api/email_campaigns_api.py", line 550, in get_email_campaigns
    (data) = self.get_email_campaigns_with_http_info(**kwargs)  # noqa: E501
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api/email_campaigns_api.py", line 640, in get_email_campaigns_with_http_info
    collection_formats=collection_formats)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api_client.py", line 330, in call_api
    _preload_content, _request_timeout)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api_client.py", line 169, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api_client.py", line 241, in deserialize
    return self.__deserialize(data, response_type)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/api_client.py", line 626, in __deserialize_model
    instance = klass(**kwargs)
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/models/get_email_campaigns.py", line 52, in __init__
    self.count = count
  File "/Users/aakash/Desktop/experiments/repos/venv/lib/python3.7/site-packages/sib_api_v3_sdk/models/get_email_campaigns.py", line 96, in count
    raise ValueError("Invalid value for `count`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `count`, must not be `None`

Can anyone tell me how to solve this issue? or am I doing something wrong. Thanks in advance!!

ruudy-sib commented 3 years ago

Hi @aakash2610 The fix is done for get_email_campaigns and in progress for get_sms_campaigns. It will be fixed in the next version release. You can keep track of the updates from here.

Thanks