update v5 methods, tests

This commit is contained in:
Alex Lushpai 2020-08-20 14:41:28 +03:00
parent 942efd5b71
commit ad6d5a2501
10 changed files with 1536 additions and 1545 deletions

View file

@ -4,6 +4,7 @@ python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
before_install:
- pip install -r requirements.txt
script:

4
README
View file

@ -75,5 +75,5 @@ Documentation
- `English`_
- `Russian`_
.. _English: http://www.retailcrm.pro/docs/Developers/Index
.. _Russian: http://www.retailcrm.ru/docs/Developers/Index
.. _English: https://help.retailcrm.pro/Developers/Index
.. _Russian: https://help.retailcrm.ru/Developers/Index

View file

@ -77,5 +77,5 @@ result = client.task_create(task, site)
## Documentation
* [English](http://www.retailcrm.pro/docs/Developers/Index)
* [Russian](http://www.retailcrm.ru/docs/Developers/Index)
* [English](https://help.retailcrm.pro/Developers/Index)
* [Russian](https://help.retailcrm.ru/Developers/Index)

View file

@ -1,4 +1,6 @@
multidimensional-urlencode==0.0.4
nose==1.3.7
requests==2.20.0
coverage==4.5.4
requests==2.24.0
coverage==5.2.1
pook==1.0.1
setuptools==49.6.0

View file

@ -592,16 +592,16 @@ class Client(Base):
return self.post('/telephony/calls/upload')
def telephony_manager(self, phone, details=True, ignoreStatus=False):
def telephony_manager(self, phone, details=True, ignore_status=False):
"""
:param phone: string
:param details: string
:param ignoreStatus: string
:param ignore_status: string
:return: Response
"""
self.parameters['phone'] = phone
self.parameters['details'] = details
self.parameters['ignoreStatus'] = ignoreStatus
self.parameters['ignoreStatus'] = ignore_status
return self.get('/telephony/manager')
@ -658,5 +658,5 @@ class Client(Base):
"""
:return: Response
"""
return self.get('/statistic/update')

View file

@ -479,8 +479,12 @@ class Client(Base):
return self.post('/customers-corporate/' + str(address[uid_type]) + '/addresses/create')
def customer_corporate_addresses_edit(self, uid_corporate, address, uid_type='externalId', entity_by='externalId', site=None):
def customer_corporate_addresses_edit(self,
uid_corporate,
address,
uid_type='externalId',
entity_by='externalId',
site=None):
"""
:param address: object
:param uid_corporate: string
@ -493,14 +497,18 @@ class Client(Base):
if uid_type != 'externalId':
self.parameters['by'] = uid_type
if entity_by != 'externalId':
self.parameters['entityBy'] = entity_by
if site is not None:
self.parameters['site'] = site
return self.post('/customers-corporate/' + str(uid_corporate) + '/addresses/' + str(address[entity_by]) + '/edit')
return self.post('/customers-corporate/' +
str(uid_corporate) +
'/addresses/' +
str(address[entity_by]) +
'/edit')
def customer_corporate_companies(self, uid, uid_type='externalId', limit=20, page=1, filters=None, site=None):
"""
@ -542,7 +550,12 @@ class Client(Base):
return self.post('/customers-corporate/' + str(company[uid_type]) + '/companies/create')
def customer_corporate_companies_edit(self, uid_corporate, company, uid_type='externalId', entity_by='externalId', site=None):
def customer_corporate_companies_edit(self,
uid_corporate,
company,
uid_type='externalId',
entity_by='externalId',
site=None):
"""
:param company: object
:param uid_corporate: string
@ -555,14 +568,15 @@ class Client(Base):
if uid_type != 'externalId':
self.parameters['by'] = uid_type
if entity_by != 'externalId':
self.parameters['entityBy'] = entity_by
if site is not None:
self.parameters['site'] = site
return self.post('/customers-corporate/' + str(uid_corporate) + '/companies/' + str(company[entity_by]) + '/edit')
return self.post('/customers-corporate/' +
str(uid_corporate) + '/companies/' + str(company[entity_by]) + '/edit')
def customer_corporate_contacts(self, uid, uid_type='externalId', limit=20, page=1, filters=None, site=None):
"""
@ -604,8 +618,12 @@ class Client(Base):
return self.post('/customers-corporate/' + str(contact[uid_type]) + '/contacts/create')
def customer_corporate_contacts_edit(self, uid_corporate, contact, uid_type='externalId', entity_by='externalId', site=None):
def customer_corporate_contacts_edit(self,
uid_corporate,
contact,
uid_type='externalId',
entity_by='externalId',
site=None):
"""
:param contact: object
:param uid_corporate: string
@ -618,14 +636,15 @@ class Client(Base):
if uid_type != 'externalId':
self.parameters['by'] = uid_type
if entity_by != 'externalId':
self.parameters['entityBy'] = entity_by
if site is not None:
self.parameters['site'] = site
return self.post('/customers-corporate/' + str(uid_corporate) + '/contacts/' + str(contact[entity_by]) + '/edit')
return self.post('/customers-corporate/' +
str(uid_corporate) + '/contacts/' + str(contact[entity_by]) + '/edit')
def customer_corporate_edit(self, customer_corporate, uid_type='externalId', site=None):
"""
@ -713,7 +732,7 @@ class Client(Base):
self.parameters['page'] = page
return self.get('/files')
def files_upload(self, file, site=None):
"""
:param file: objects
@ -1007,21 +1026,21 @@ class Client(Base):
return self.post('/payment/check')
def payment_create_invoice(self, createInvoice):
def payment_create_invoice(self, create_invoice):
"""
:param createInvoice: object
:param create_invoice: object
:return: Response
"""
self.parameters['createInvoice'] = json.dumps(createInvoice)
self.parameters['createInvoice'] = json.dumps(create_invoice)
return self.post('/payment/create-invoice')
def payment_update_invoice(self, updateInvoice):
def payment_update_invoice(self, update_invoice):
"""
:param updateInvoice: object
:param update_invoice: object
:return: Response
"""
self.parameters['updateInvoice'] = json.dumps(updateInvoice)
self.parameters['updateInvoice'] = json.dumps(update_invoice)
return self.post('/payment/update-invoice')
@ -1355,9 +1374,8 @@ class Client(Base):
"""
if site is not None:
self.parameters['site'] = site
self.parameters['offers'] = json.dumps(offers)
self.parameters['offers'] = json.dumps(offers)
return self.post('/store/inventories/upload')
@ -1474,16 +1492,16 @@ class Client(Base):
return self.post('/telephony/calls/upload')
def telephony_manager(self, phone, details=True, ignoreStatus=True):
def telephony_manager(self, phone, details=True, ignore_status=True):
"""
:param phone: string
:param details: string
:param ignoreStatus: string
:return: Response
:param ignore_status: string
:return: Response
"""
self.parameters['phone'] = phone
self.parameters['details'] = details
self.parameters['ignoreStatus'] = ignoreStatus
self.parameters['ignoreStatus'] = ignore_status
return self.get('/telephony/manager')

View file

@ -15,7 +15,7 @@ def read(filename):
setup(
name='retailcrm',
version='5.0.3',
version='5.1.0',
description='retailCRM API client',
long_description=read('README'),
url='https://github.com/retailcrm/api-client-python',
@ -25,7 +25,7 @@ setup(
license='MIT',
packages=['retailcrm', 'retailcrm/versions'],
package_data={},
install_requires=['requests', 'multidimensional_urlencode', 'nose'],
install_requires=['requests', 'multidimensional_urlencode', 'nose', 'coverage', 'pook', 'setuptools'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
@ -38,6 +38,7 @@ setup(
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries :: Python Modules',
]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff