Updated all SDKs

This commit is contained in:
Eldad Fux committed 2020-01-28 15:16:33 +02:00
1 parent b5a73340c2
commit 007dfbe043
705 files changed
+163 -26466

No files matched your search

@@ -1,222 +0,0 @@
from ..service import Service
class Account(Service):
def __init__(self, client):
super(Account, self).__init__(client)
def get_account(self):
"""Get Account"""
params = {}
path = '/account'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_account(self, email, password, name=''):
"""Create Account"""
params = {}
path = '/account'
params['email'] = email
params['password'] = password
params['name'] = name
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def delete(self):
"""Delete Account"""
params = {}
path = '/account'
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def update_email(self, email, password):
"""Update Account Email"""
params = {}
path = '/account/email'
params['email'] = email
params['password'] = password
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def get_account_logs(self):
"""Get Account Logs"""
params = {}
path = '/account/logs'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_account_name(self, name):
"""Update Account Name"""
params = {}
path = '/account/name'
params['name'] = name
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def update_account_password(self, password, old_password):
"""Update Account Password"""
params = {}
path = '/account/password'
params['password'] = password
params['old-password'] = old_password
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def get_account_prefs(self):
"""Get Account Preferences"""
params = {}
path = '/account/prefs'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_prefs(self, prefs):
"""Update Account Preferences"""
params = {}
path = '/account/prefs'
params['prefs'] = prefs
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def create_account_recovery(self, email, url):
"""Password Recovery"""
params = {}
path = '/account/recovery'
params['email'] = email
params['url'] = url
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def update_account_recovery(self, user_id, secret, password_a, password_b):
"""Password Reset"""
params = {}
path = '/account/recovery'
params['userId'] = user_id
params['secret'] = secret
params['password-a'] = password_a
params['password-b'] = password_b
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def get_account_sessions(self):
"""Get Account Sessions"""
params = {}
path = '/account/sessions'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_account_session(self, email, password):
"""Create Account Session"""
params = {}
path = '/account/sessions'
params['email'] = email
params['password'] = password
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def delete_account_sessions(self):
"""Delete All Account Sessions"""
params = {}
path = '/account/sessions'
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def delete_account_current_session(self):
"""Delete Current Account Session"""
params = {}
path = '/account/sessions/current'
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def create_account_session_o_auth(self, provider, success, failure):
"""Create Account Session with OAuth"""
params = {}
path = '/account/sessions/oauth/{provider}'
path = path.replace('{provider}', provider)
params['success'] = success
params['failure'] = failure
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def delete_account_session(self, id):
"""Delete Account Session"""
params = {}
path = '/account/sessions/{id}'
path = path.replace('{id}', id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def create_account_verification(self, url):
"""Create Verification"""
params = {}
path = '/account/verification'
params['url'] = url
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def update_account_verification(self, user_id, secret, password_b):
"""Updated Verification"""
params = {}
path = '/account/verification'
params['userId'] = user_id
params['secret'] = secret
params['password-b'] = password_b
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
-120
View File
@@ -1,120 +0,0 @@
from ..service import Service
class Auth(Service):
def __init__(self, client):
super(Auth, self).__init__(client)
def login(self, email, password, success='', failure=''):
"""Login"""
params = {}
path = '/auth/login'
params['email'] = email
params['password'] = password
params['success'] = success
params['failure'] = failure
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def oauth(self, provider, success, failure):
"""Login with OAuth"""
params = {}
path = '/auth/login/oauth/{provider}'
path = path.replace('{provider}', provider)
params['success'] = success
params['failure'] = failure
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def logout(self):
"""Logout Current Session"""
params = {}
path = '/auth/logout'
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def logout_by_session(self, id):
"""Logout Specific Session"""
params = {}
path = '/auth/logout/{id}'
path = path.replace('{id}', id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def recovery(self, email, reset):
"""Password Recovery"""
params = {}
path = '/auth/recovery'
params['email'] = email
params['reset'] = reset
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def recovery_reset(self, user_id, token, password_a, password_b):
"""Password Reset"""
params = {}
path = '/auth/recovery/reset'
params['userId'] = user_id
params['token'] = token
params['password-a'] = password_a
params['password-b'] = password_b
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def register(self, email, password, confirm, success='', failure='', name=''):
"""Register"""
params = {}
path = '/auth/register'
params['email'] = email
params['password'] = password
params['confirm'] = confirm
params['success'] = success
params['failure'] = failure
params['name'] = name
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def confirm(self, user_id, token):
"""Confirmation"""
params = {}
path = '/auth/register/confirm'
params['userId'] = user_id
params['token'] = token
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def confirm_resend(self, confirm):
"""Resend Confirmation"""
params = {}
path = '/auth/register/confirm/resend'
params['confirm'] = confirm
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
@@ -1,381 +0,0 @@
from ..service import Service
class Projects(Service):
def __init__(self, client):
super(Projects, self).__init__(client)
def list_projects(self):
"""List Projects"""
params = {}
path = '/projects'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_project(self, name, team_id, description='', logo='', url='', legal_name='', legal_country='', legal_state='', legal_city='', legal_address='', legal_tax_id=''):
"""Create Project"""
params = {}
path = '/projects'
params['name'] = name
params['teamId'] = team_id
params['description'] = description
params['logo'] = logo
params['url'] = url
params['legalName'] = legal_name
params['legalCountry'] = legal_country
params['legalState'] = legal_state
params['legalCity'] = legal_city
params['legalAddress'] = legal_address
params['legalTaxId'] = legal_tax_id
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def get_project(self, project_id):
"""Get Project"""
params = {}
path = '/projects/{projectId}'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_project(self, project_id, name, description='', logo='', url='', legal_name='', legal_country='', legal_state='', legal_city='', legal_address='', legal_tax_id=''):
"""Update Project"""
params = {}
path = '/projects/{projectId}'
path = path.replace('{projectId}', project_id)
params['name'] = name
params['description'] = description
params['logo'] = logo
params['url'] = url
params['legalName'] = legal_name
params['legalCountry'] = legal_country
params['legalState'] = legal_state
params['legalCity'] = legal_city
params['legalAddress'] = legal_address
params['legalTaxId'] = legal_tax_id
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def delete_project(self, project_id):
"""Delete Project"""
params = {}
path = '/projects/{projectId}'
path = path.replace('{projectId}', project_id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def list_keys(self, project_id):
"""List Keys"""
params = {}
path = '/projects/{projectId}/keys'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_key(self, project_id, name, scopes):
"""Create Key"""
params = {}
path = '/projects/{projectId}/keys'
path = path.replace('{projectId}', project_id)
params['name'] = name
params['scopes'] = scopes
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def get_key(self, project_id, key_id):
"""Get Key"""
params = {}
path = '/projects/{projectId}/keys/{keyId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{keyId}', key_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_key(self, project_id, key_id, name, scopes):
"""Update Key"""
params = {}
path = '/projects/{projectId}/keys/{keyId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{keyId}', key_id)
params['name'] = name
params['scopes'] = scopes
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def delete_key(self, project_id, key_id):
"""Delete Key"""
params = {}
path = '/projects/{projectId}/keys/{keyId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{keyId}', key_id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def update_project_o_auth(self, project_id, provider, app_id='', secret=''):
"""Update Project OAuth"""
params = {}
path = '/projects/{projectId}/oauth'
path = path.replace('{projectId}', project_id)
params['provider'] = provider
params['appId'] = app_id
params['secret'] = secret
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)
def list_platforms(self, project_id):
"""List Platforms"""
params = {}
path = '/projects/{projectId}/platforms'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_platform(self, project_id, type, name, key='', store='', url=''):
"""Create Platform"""
params = {}
path = '/projects/{projectId}/platforms'
path = path.replace('{projectId}', project_id)
params['type'] = type
params['name'] = name
params['key'] = key
params['store'] = store
params['url'] = url
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def get_platform(self, project_id, platform_id):
"""Get Platform"""
params = {}
path = '/projects/{projectId}/platforms/{platformId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{platformId}', platform_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_platform(self, project_id, platform_id, name, key='', store='', url=''):
"""Update Platform"""
params = {}
path = '/projects/{projectId}/platforms/{platformId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{platformId}', platform_id)
params['name'] = name
params['key'] = key
params['store'] = store
params['url'] = url
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def delete_platform(self, project_id, platform_id):
"""Delete Platform"""
params = {}
path = '/projects/{projectId}/platforms/{platformId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{platformId}', platform_id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def list_tasks(self, project_id):
"""List Tasks"""
params = {}
path = '/projects/{projectId}/tasks'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_task(self, project_id, name, status, schedule, security, http_method, http_url, http_headers={}, http_user='', http_pass=''):
"""Create Task"""
params = {}
path = '/projects/{projectId}/tasks'
path = path.replace('{projectId}', project_id)
params['name'] = name
params['status'] = status
params['schedule'] = schedule
params['security'] = security
params['httpMethod'] = http_method
params['httpUrl'] = http_url
params['httpHeaders'] = http_headers
params['httpUser'] = http_user
params['httpPass'] = http_pass
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def get_task(self, project_id, task_id):
"""Get Task"""
params = {}
path = '/projects/{projectId}/tasks/{taskId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{taskId}', task_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_task(self, project_id, task_id, name, status, schedule, security, http_method, http_url, http_headers={}, http_user='', http_pass=''):
"""Update Task"""
params = {}
path = '/projects/{projectId}/tasks/{taskId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{taskId}', task_id)
params['name'] = name
params['status'] = status
params['schedule'] = schedule
params['security'] = security
params['httpMethod'] = http_method
params['httpUrl'] = http_url
params['httpHeaders'] = http_headers
params['httpUser'] = http_user
params['httpPass'] = http_pass
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def delete_task(self, project_id, task_id):
"""Delete Task"""
params = {}
path = '/projects/{projectId}/tasks/{taskId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{taskId}', task_id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def get_project_usage(self, project_id):
"""Get Project"""
params = {}
path = '/projects/{projectId}/usage'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def list_webhooks(self, project_id):
"""List Webhooks"""
params = {}
path = '/projects/{projectId}/webhooks'
path = path.replace('{projectId}', project_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def create_webhook(self, project_id, name, events, url, security, http_user='', http_pass=''):
"""Create Webhook"""
params = {}
path = '/projects/{projectId}/webhooks'
path = path.replace('{projectId}', project_id)
params['name'] = name
params['events'] = events
params['url'] = url
params['security'] = security
params['httpUser'] = http_user
params['httpPass'] = http_pass
return self.client.call('post', path, {
'content-type': 'application/json',
}, params)
def get_webhook(self, project_id, webhook_id):
"""Get Webhook"""
params = {}
path = '/projects/{projectId}/webhooks/{webhookId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{webhookId}', webhook_id)
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def update_webhook(self, project_id, webhook_id, name, events, url, security, http_user='', http_pass=''):
"""Update Webhook"""
params = {}
path = '/projects/{projectId}/webhooks/{webhookId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{webhookId}', webhook_id)
params['name'] = name
params['events'] = events
params['url'] = url
params['security'] = security
params['httpUser'] = http_user
params['httpPass'] = http_pass
return self.client.call('put', path, {
'content-type': 'application/json',
}, params)
def delete_webhook(self, project_id, webhook_id):
"""Delete Webhook"""
params = {}
path = '/projects/{projectId}/webhooks/{webhookId}'
path = path.replace('{projectId}', project_id)
path = path.replace('{webhookId}', webhook_id)
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
@@ -103,17 +103,3 @@ class Teams(Service):
return self.client.call('delete', path, {
'content-type': 'application/json',
}, params)
def update_team_membership_status(self, team_id, invite_id, user_id, secret):
"""Update Team Membership Status"""
params = {}
path = '/teams/{teamId}/memberships/{inviteId}/status'
path = path.replace('{teamId}', team_id)
path = path.replace('{inviteId}', invite_id)
params['userId'] = user_id
params['secret'] = secret
return self.client.call('patch', path, {
'content-type': 'application/json',
}, params)