code
stringlengths 501
5.19M
| package
stringlengths 2
81
| path
stringlengths 9
304
| filename
stringlengths 4
145
|
---|---|---|---|
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.variable_groups.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__code = None
self.__status = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/variable_groups/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class VariableGroup(object):
def __init__(self):
"""Creates an instance of VariableGroup"""
self.__display_label = None
self.__api_name = None
self.__name = None
self.__description = None
self.__id = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/variable_groups/variable_group.py | variable_group.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
class VariableGroupsOperations(object):
def __init__(self):
"""Creates an instance of VariableGroupsOperations"""
pass
def get_variable_groups(self):
"""
The method to get variable groups
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/variable_groups'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.variable_groups.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_variable_group_by_id(self, id):
"""
The method to get variable group by id
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/variable_groups/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.variable_groups.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_variable_group_by_api_name(self, api_name):
"""
The method to get variable group by api name
Parameters:
api_name (string) : A string representing the api_name
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/variable_groups/'
api_path = api_path + str(api_name)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.variable_groups.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json') | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/variable_groups/variable_groups_operations.py | variable_groups_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.bulk_read.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__data = None
self.__info = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def get_info(self):
"""
The method to get the info
Returns:
dict: An instance of dict
"""
return self.__info
def set_info(self, info):
"""
The method to set the value to info
Parameters:
info (dict) : An instance of dict
"""
if info is not None and not isinstance(info, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: info EXPECTED TYPE: dict', None, None)
self.__info = info
self.__key_modified['info'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__data = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.bulk_read.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler
from zcrmsdk.src.com.zoho.crm.api.bulk_read.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .action_handler import ActionHandler
class APIException(ResponseHandler, ActionResponse, ActionHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class CallBack(object):
def __init__(self):
"""Creates an instance of CallBack"""
self.__url = None
self.__method = None
self.__key_modified = dict()
def get_url(self):
"""
The method to get the url
Returns:
string: A string representing the url
"""
return self.__url
def set_url(self, url):
"""
The method to set the value to url
Parameters:
url (string) : A string representing the url
"""
if url is not None and not isinstance(url, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None)
self.__url = url
self.__key_modified['url'] = 1
def get_method(self):
"""
The method to get the method
Returns:
Choice: An instance of Choice
"""
return self.__method
def set_method(self, method):
"""
The method to set the value to method
Parameters:
method (Choice) : An instance of Choice
"""
if method is not None and not isinstance(method, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: method EXPECTED TYPE: Choice', None, None)
self.__method = method
self.__key_modified['method'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/call_back.py | call_back.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class Criteria(object):
def __init__(self):
"""Creates an instance of Criteria"""
self.__api_name = None
self.__value = None
self.__group_operator = None
self.__group = None
self.__comparator = None
self.__key_modified = dict()
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_value(self):
"""
The method to get the value
Returns:
Object: A Object representing the value
"""
return self.__value
def set_value(self, value):
"""
The method to set the value to value
Parameters:
value (Object) : A Object representing the value
"""
self.__value = value
self.__key_modified['value'] = 1
def get_group_operator(self):
"""
The method to get the group_operator
Returns:
Choice: An instance of Choice
"""
return self.__group_operator
def set_group_operator(self, group_operator):
"""
The method to set the value to group_operator
Parameters:
group_operator (Choice) : An instance of Choice
"""
if group_operator is not None and not isinstance(group_operator, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: group_operator EXPECTED TYPE: Choice', None, None)
self.__group_operator = group_operator
self.__key_modified['group_operator'] = 1
def get_group(self):
"""
The method to get the group
Returns:
list: An instance of list
"""
return self.__group
def set_group(self, group):
"""
The method to set the value to group
Parameters:
group (list) : An instance of list
"""
if group is not None and not isinstance(group, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: group EXPECTED TYPE: list', None, None)
self.__group = group
self.__key_modified['group'] = 1
def get_comparator(self):
"""
The method to get the comparator
Returns:
Choice: An instance of Choice
"""
return self.__comparator
def set_comparator(self, comparator):
"""
The method to set the value to comparator
Parameters:
comparator (Choice) : An instance of Choice
"""
if comparator is not None and not isinstance(comparator, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: comparator EXPECTED TYPE: Choice', None, None)
self.__comparator = comparator
self.__key_modified['comparator'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/criteria.py | criteria.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import StreamWrapper, Constants
from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import StreamWrapper, Constants
from .response_handler import ResponseHandler
class FileBodyWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of FileBodyWrapper"""
super().__init__()
self.__file = None
self.__key_modified = dict()
def get_file(self):
"""
The method to get the file
Returns:
StreamWrapper: An instance of StreamWrapper
"""
return self.__file
def set_file(self, file):
"""
The method to set the value to file
Parameters:
file (StreamWrapper) : An instance of StreamWrapper
"""
if file is not None and not isinstance(file, StreamWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file EXPECTED TYPE: StreamWrapper', None, None)
self.__file = file
self.__key_modified['file'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/file_body_wrapper.py | file_body_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
class BulkReadOperations(object):
def __init__(self):
"""Creates an instance of BulkReadOperations"""
pass
def get_bulk_read_job_details(self, job_id):
"""
The method to get bulk read job details
Parameters:
job_id (int) : An int representing the job_id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(job_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: job_id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/bulk/v2/read/'
api_path = api_path + str(job_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def download_result(self, job_id):
"""
The method to download result
Parameters:
job_id (int) : An int representing the job_id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(job_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: job_id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/bulk/v2/read/'
api_path = api_path + str(job_id)
api_path = api_path + '/result'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/x-download')
def create_bulk_read_job(self, request):
"""
The method to create bulk read job
Parameters:
request (RequestWrapper) : An instance of RequestWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.request_wrapper import RequestWrapper
except Exception:
from .request_wrapper import RequestWrapper
if request is not None and not isinstance(request, RequestWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: RequestWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/bulk/v2/read'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json') | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/bulk_read_operations.py | bulk_read_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class JobDetail(object):
def __init__(self):
"""Creates an instance of JobDetail"""
self.__id = None
self.__operation = None
self.__state = None
self.__query = None
self.__created_by = None
self.__created_time = None
self.__result = None
self.__file_type = None
self.__key_modified = dict()
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_operation(self):
"""
The method to get the operation
Returns:
string: A string representing the operation
"""
return self.__operation
def set_operation(self, operation):
"""
The method to set the value to operation
Parameters:
operation (string) : A string representing the operation
"""
if operation is not None and not isinstance(operation, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: operation EXPECTED TYPE: str', None, None)
self.__operation = operation
self.__key_modified['operation'] = 1
def get_state(self):
"""
The method to get the state
Returns:
Choice: An instance of Choice
"""
return self.__state
def set_state(self, state):
"""
The method to set the value to state
Parameters:
state (Choice) : An instance of Choice
"""
if state is not None and not isinstance(state, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: state EXPECTED TYPE: Choice', None, None)
self.__state = state
self.__key_modified['state'] = 1
def get_query(self):
"""
The method to get the query
Returns:
Query: An instance of Query
"""
return self.__query
def set_query(self, query):
"""
The method to set the value to query
Parameters:
query (Query) : An instance of Query
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.query import Query
except Exception:
from .query import Query
if query is not None and not isinstance(query, Query):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: query EXPECTED TYPE: Query', None, None)
self.__query = query
self.__key_modified['query'] = 1
def get_created_by(self):
"""
The method to get the created_by
Returns:
User: An instance of User
"""
return self.__created_by
def set_created_by(self, created_by):
"""
The method to set the value to created_by
Parameters:
created_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if created_by is not None and not isinstance(created_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_by EXPECTED TYPE: User', None, None)
self.__created_by = created_by
self.__key_modified['created_by'] = 1
def get_created_time(self):
"""
The method to get the created_time
Returns:
datetime: An instance of datetime
"""
return self.__created_time
def set_created_time(self, created_time):
"""
The method to set the value to created_time
Parameters:
created_time (datetime) : An instance of datetime
"""
from datetime import datetime
if created_time is not None and not isinstance(created_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: datetime', None, None)
self.__created_time = created_time
self.__key_modified['created_time'] = 1
def get_result(self):
"""
The method to get the result
Returns:
Result: An instance of Result
"""
return self.__result
def set_result(self, result):
"""
The method to set the value to result
Parameters:
result (Result) : An instance of Result
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.result import Result
except Exception:
from .result import Result
if result is not None and not isinstance(result, Result):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: result EXPECTED TYPE: Result', None, None)
self.__result = result
self.__key_modified['result'] = 1
def get_file_type(self):
"""
The method to get the file_type
Returns:
string: A string representing the file_type
"""
return self.__file_type
def set_file_type(self, file_type):
"""
The method to set the value to file_type
Parameters:
file_type (string) : A string representing the file_type
"""
if file_type is not None and not isinstance(file_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_type EXPECTED TYPE: str', None, None)
self.__file_type = file_type
self.__key_modified['file_type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/job_detail.py | job_detail.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class RequestWrapper(object):
def __init__(self):
"""Creates an instance of RequestWrapper"""
self.__callback = None
self.__query = None
self.__file_type = None
self.__key_modified = dict()
def get_callback(self):
"""
The method to get the callback
Returns:
CallBack: An instance of CallBack
"""
return self.__callback
def set_callback(self, callback):
"""
The method to set the value to callback
Parameters:
callback (CallBack) : An instance of CallBack
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.call_back import CallBack
except Exception:
from .call_back import CallBack
if callback is not None and not isinstance(callback, CallBack):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: callback EXPECTED TYPE: CallBack', None, None)
self.__callback = callback
self.__key_modified['callback'] = 1
def get_query(self):
"""
The method to get the query
Returns:
Query: An instance of Query
"""
return self.__query
def set_query(self, query):
"""
The method to set the value to query
Parameters:
query (Query) : An instance of Query
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.query import Query
except Exception:
from .query import Query
if query is not None and not isinstance(query, Query):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: query EXPECTED TYPE: Query', None, None)
self.__query = query
self.__key_modified['query'] = 1
def get_file_type(self):
"""
The method to get the file_type
Returns:
Choice: An instance of Choice
"""
return self.__file_type
def set_file_type(self, file_type):
"""
The method to set the value to file_type
Parameters:
file_type (Choice) : An instance of Choice
"""
if file_type is not None and not isinstance(file_type, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_type EXPECTED TYPE: Choice', None, None)
self.__file_type = file_type
self.__key_modified['file_type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/request_wrapper.py | request_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Query(object):
def __init__(self):
"""Creates an instance of Query"""
self.__module = None
self.__cvid = None
self.__fields = None
self.__page = None
self.__criteria = None
self.__key_modified = dict()
def get_module(self):
"""
The method to get the module
Returns:
string: A string representing the module
"""
return self.__module
def set_module(self, module):
"""
The method to set the value to module
Parameters:
module (string) : A string representing the module
"""
if module is not None and not isinstance(module, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module EXPECTED TYPE: str', None, None)
self.__module = module
self.__key_modified['module'] = 1
def get_cvid(self):
"""
The method to get the cvid
Returns:
string: A string representing the cvid
"""
return self.__cvid
def set_cvid(self, cvid):
"""
The method to set the value to cvid
Parameters:
cvid (string) : A string representing the cvid
"""
if cvid is not None and not isinstance(cvid, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: cvid EXPECTED TYPE: str', None, None)
self.__cvid = cvid
self.__key_modified['cvid'] = 1
def get_fields(self):
"""
The method to get the fields
Returns:
list: An instance of list
"""
return self.__fields
def set_fields(self, fields):
"""
The method to set the value to fields
Parameters:
fields (list) : An instance of list
"""
if fields is not None and not isinstance(fields, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fields EXPECTED TYPE: list', None, None)
self.__fields = fields
self.__key_modified['fields'] = 1
def get_page(self):
"""
The method to get the page
Returns:
int: An int representing the page
"""
return self.__page
def set_page(self, page):
"""
The method to set the value to page
Parameters:
page (int) : An int representing the page
"""
if page is not None and not isinstance(page, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: page EXPECTED TYPE: int', None, None)
self.__page = page
self.__key_modified['page'] = 1
def get_criteria(self):
"""
The method to get the criteria
Returns:
Criteria: An instance of Criteria
"""
return self.__criteria
def set_criteria(self, criteria):
"""
The method to set the value to criteria
Parameters:
criteria (Criteria) : An instance of Criteria
"""
try:
from zcrmsdk.src.com.zoho.crm.api.bulk_read.criteria import Criteria
except Exception:
from .criteria import Criteria
if criteria is not None and not isinstance(criteria, Criteria):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: criteria EXPECTED TYPE: Criteria', None, None)
self.__criteria = criteria
self.__key_modified['criteria'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/query.py | query.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.bulk_read.action_response import ActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
class SuccessResponse(ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Result(object):
def __init__(self):
"""Creates an instance of Result"""
self.__page = None
self.__count = None
self.__download_url = None
self.__per_page = None
self.__more_records = None
self.__key_modified = dict()
def get_page(self):
"""
The method to get the page
Returns:
int: An int representing the page
"""
return self.__page
def set_page(self, page):
"""
The method to set the value to page
Parameters:
page (int) : An int representing the page
"""
if page is not None and not isinstance(page, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: page EXPECTED TYPE: int', None, None)
self.__page = page
self.__key_modified['page'] = 1
def get_count(self):
"""
The method to get the count
Returns:
int: An int representing the count
"""
return self.__count
def set_count(self, count):
"""
The method to set the value to count
Parameters:
count (int) : An int representing the count
"""
if count is not None and not isinstance(count, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: count EXPECTED TYPE: int', None, None)
self.__count = count
self.__key_modified['count'] = 1
def get_download_url(self):
"""
The method to get the download_url
Returns:
string: A string representing the download_url
"""
return self.__download_url
def set_download_url(self, download_url):
"""
The method to set the value to download_url
Parameters:
download_url (string) : A string representing the download_url
"""
if download_url is not None and not isinstance(download_url, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: download_url EXPECTED TYPE: str', None, None)
self.__download_url = download_url
self.__key_modified['download_url'] = 1
def get_per_page(self):
"""
The method to get the per_page
Returns:
int: An int representing the per_page
"""
return self.__per_page
def set_per_page(self, per_page):
"""
The method to set the value to per_page
Parameters:
per_page (int) : An int representing the per_page
"""
if per_page is not None and not isinstance(per_page, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: per_page EXPECTED TYPE: int', None, None)
self.__per_page = per_page
self.__key_modified['per_page'] = 1
def get_more_records(self):
"""
The method to get the more_records
Returns:
bool: A bool representing the more_records
"""
return self.__more_records
def set_more_records(self, more_records):
"""
The method to set the value to more_records
Parameters:
more_records (bool) : A bool representing the more_records
"""
if more_records is not None and not isinstance(more_records, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: more_records EXPECTED TYPE: bool', None, None)
self.__more_records = more_records
self.__key_modified['more_records'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/bulk_read/result.py | result.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.query.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__data = None
self.__info = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def get_info(self):
"""
The method to get the info
Returns:
Info: An instance of Info
"""
return self.__info
def set_info(self, info):
"""
The method to set the value to info
Parameters:
info (Info) : An instance of Info
"""
try:
from zcrmsdk.src.com.zoho.crm.api.record import Info
except Exception:
from ..record import Info
if info is not None and not isinstance(info, Info):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: info EXPECTED TYPE: Info', None, None)
self.__info = info
self.__key_modified['info'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/query/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.query.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/query/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class BodyWrapper(object):
def __init__(self):
"""Creates an instance of BodyWrapper"""
self.__select_query = None
self.__key_modified = dict()
def get_select_query(self):
"""
The method to get the select_query
Returns:
string: A string representing the select_query
"""
return self.__select_query
def set_select_query(self, select_query):
"""
The method to set the value to select_query
Parameters:
select_query (string) : A string representing the select_query
"""
if select_query is not None and not isinstance(select_query, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: select_query EXPECTED TYPE: str', None, None)
self.__select_query = select_query
self.__key_modified['select_query'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/query/body_wrapper.py | body_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Field(object):
def __init__(self):
"""Creates an instance of Field"""
self.__system_mandatory = None
self.__webhook = None
self.__private = None
self.__layouts = None
self.__content = None
self.__column_name = None
self.__type = None
self.__transition_sequence = None
self.__personality_name = None
self.__message = None
self.__mandatory = None
self.__criteria = None
self.__related_details = None
self.__json_type = None
self.__crypt = None
self.__field_label = None
self.__tooltip = None
self.__created_source = None
self.__field_read_only = None
self.__display_label = None
self.__read_only = None
self.__association_details = None
self.__quick_sequence_number = None
self.__businesscard_supported = None
self.__multi_module_lookup = None
self.__currency = None
self.__id = None
self.__custom_field = None
self.__lookup = None
self.__visible = None
self.__length = None
self.__view_type = None
self.__subform = None
self.__api_name = None
self.__unique = None
self.__history_tracking = None
self.__data_type = None
self.__formula = None
self.__decimal_place = None
self.__mass_update = None
self.__blueprint_supported = None
self.__multiselectlookup = None
self.__pick_list_values = None
self.__auto_number = None
self.__default_value = None
self.__section_id = None
self.__validation_rule = None
self.__convert_mapping = None
self.__key_modified = dict()
def get_system_mandatory(self):
"""
The method to get the system_mandatory
Returns:
bool: A bool representing the system_mandatory
"""
return self.__system_mandatory
def set_system_mandatory(self, system_mandatory):
"""
The method to set the value to system_mandatory
Parameters:
system_mandatory (bool) : A bool representing the system_mandatory
"""
if system_mandatory is not None and not isinstance(system_mandatory, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: system_mandatory EXPECTED TYPE: bool', None, None)
self.__system_mandatory = system_mandatory
self.__key_modified['system_mandatory'] = 1
def get_webhook(self):
"""
The method to get the webhook
Returns:
bool: A bool representing the webhook
"""
return self.__webhook
def set_webhook(self, webhook):
"""
The method to set the value to webhook
Parameters:
webhook (bool) : A bool representing the webhook
"""
if webhook is not None and not isinstance(webhook, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: webhook EXPECTED TYPE: bool', None, None)
self.__webhook = webhook
self.__key_modified['webhook'] = 1
def get_private(self):
"""
The method to get the private
Returns:
Private: An instance of Private
"""
return self.__private
def set_private(self, private):
"""
The method to set the value to private
Parameters:
private (Private) : An instance of Private
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.private import Private
except Exception:
from .private import Private
if private is not None and not isinstance(private, Private):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: private EXPECTED TYPE: Private', None, None)
self.__private = private
self.__key_modified['private'] = 1
def get_layouts(self):
"""
The method to get the layouts
Returns:
Layout: An instance of Layout
"""
return self.__layouts
def set_layouts(self, layouts):
"""
The method to set the value to layouts
Parameters:
layouts (Layout) : An instance of Layout
"""
try:
from zcrmsdk.src.com.zoho.crm.api.layouts import Layout
except Exception:
from ..layouts import Layout
if layouts is not None and not isinstance(layouts, Layout):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: layouts EXPECTED TYPE: Layout', None, None)
self.__layouts = layouts
self.__key_modified['layouts'] = 1
def get_content(self):
"""
The method to get the content
Returns:
string: A string representing the content
"""
return self.__content
def set_content(self, content):
"""
The method to set the value to content
Parameters:
content (string) : A string representing the content
"""
if content is not None and not isinstance(content, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: content EXPECTED TYPE: str', None, None)
self.__content = content
self.__key_modified['content'] = 1
def get_column_name(self):
"""
The method to get the column_name
Returns:
string: A string representing the column_name
"""
return self.__column_name
def set_column_name(self, column_name):
"""
The method to set the value to column_name
Parameters:
column_name (string) : A string representing the column_name
"""
if column_name is not None and not isinstance(column_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: column_name EXPECTED TYPE: str', None, None)
self.__column_name = column_name
self.__key_modified['column_name'] = 1
def get_type(self):
"""
The method to get the type
Returns:
string: A string representing the type
"""
return self.__type
def set_type(self, type):
"""
The method to set the value to type
Parameters:
type (string) : A string representing the type
"""
if type is not None and not isinstance(type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None)
self.__type = type
self.__key_modified['_type'] = 1
def get_transition_sequence(self):
"""
The method to get the transition_sequence
Returns:
int: An int representing the transition_sequence
"""
return self.__transition_sequence
def set_transition_sequence(self, transition_sequence):
"""
The method to set the value to transition_sequence
Parameters:
transition_sequence (int) : An int representing the transition_sequence
"""
if transition_sequence is not None and not isinstance(transition_sequence, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: transition_sequence EXPECTED TYPE: int', None, None)
self.__transition_sequence = transition_sequence
self.__key_modified['transition_sequence'] = 1
def get_personality_name(self):
"""
The method to get the personality_name
Returns:
string: A string representing the personality_name
"""
return self.__personality_name
def set_personality_name(self, personality_name):
"""
The method to set the value to personality_name
Parameters:
personality_name (string) : A string representing the personality_name
"""
if personality_name is not None and not isinstance(personality_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: personality_name EXPECTED TYPE: str', None, None)
self.__personality_name = personality_name
self.__key_modified['personality_name'] = 1
def get_message(self):
"""
The method to get the message
Returns:
string: A string representing the message
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (string) : A string representing the message
"""
if message is not None and not isinstance(message, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: str', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_mandatory(self):
"""
The method to get the mandatory
Returns:
bool: A bool representing the mandatory
"""
return self.__mandatory
def set_mandatory(self, mandatory):
"""
The method to set the value to mandatory
Parameters:
mandatory (bool) : A bool representing the mandatory
"""
if mandatory is not None and not isinstance(mandatory, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: mandatory EXPECTED TYPE: bool', None, None)
self.__mandatory = mandatory
self.__key_modified['mandatory'] = 1
def get_criteria(self):
"""
The method to get the criteria
Returns:
Criteria: An instance of Criteria
"""
return self.__criteria
def set_criteria(self, criteria):
"""
The method to set the value to criteria
Parameters:
criteria (Criteria) : An instance of Criteria
"""
try:
from zcrmsdk.src.com.zoho.crm.api.customviews import Criteria
except Exception:
from ..custom_views import Criteria
if criteria is not None and not isinstance(criteria, Criteria):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: criteria EXPECTED TYPE: Criteria', None, None)
self.__criteria = criteria
self.__key_modified['criteria'] = 1
def get_related_details(self):
"""
The method to get the related_details
Returns:
RelatedDetails: An instance of RelatedDetails
"""
return self.__related_details
def set_related_details(self, related_details):
"""
The method to set the value to related_details
Parameters:
related_details (RelatedDetails) : An instance of RelatedDetails
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.related_details import RelatedDetails
except Exception:
from .related_details import RelatedDetails
if related_details is not None and not isinstance(related_details, RelatedDetails):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: related_details EXPECTED TYPE: RelatedDetails', None, None)
self.__related_details = related_details
self.__key_modified['related_details'] = 1
def get_json_type(self):
"""
The method to get the json_type
Returns:
string: A string representing the json_type
"""
return self.__json_type
def set_json_type(self, json_type):
"""
The method to set the value to json_type
Parameters:
json_type (string) : A string representing the json_type
"""
if json_type is not None and not isinstance(json_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: json_type EXPECTED TYPE: str', None, None)
self.__json_type = json_type
self.__key_modified['json_type'] = 1
def get_crypt(self):
"""
The method to get the crypt
Returns:
Crypt: An instance of Crypt
"""
return self.__crypt
def set_crypt(self, crypt):
"""
The method to set the value to crypt
Parameters:
crypt (Crypt) : An instance of Crypt
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.crypt import Crypt
except Exception:
from .crypt import Crypt
if crypt is not None and not isinstance(crypt, Crypt):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: crypt EXPECTED TYPE: Crypt', None, None)
self.__crypt = crypt
self.__key_modified['crypt'] = 1
def get_field_label(self):
"""
The method to get the field_label
Returns:
string: A string representing the field_label
"""
return self.__field_label
def set_field_label(self, field_label):
"""
The method to set the value to field_label
Parameters:
field_label (string) : A string representing the field_label
"""
if field_label is not None and not isinstance(field_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: field_label EXPECTED TYPE: str', None, None)
self.__field_label = field_label
self.__key_modified['field_label'] = 1
def get_tooltip(self):
"""
The method to get the tooltip
Returns:
ToolTip: An instance of ToolTip
"""
return self.__tooltip
def set_tooltip(self, tooltip):
"""
The method to set the value to tooltip
Parameters:
tooltip (ToolTip) : An instance of ToolTip
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.tool_tip import ToolTip
except Exception:
from .tool_tip import ToolTip
if tooltip is not None and not isinstance(tooltip, ToolTip):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: tooltip EXPECTED TYPE: ToolTip', None, None)
self.__tooltip = tooltip
self.__key_modified['tooltip'] = 1
def get_created_source(self):
"""
The method to get the created_source
Returns:
string: A string representing the created_source
"""
return self.__created_source
def set_created_source(self, created_source):
"""
The method to set the value to created_source
Parameters:
created_source (string) : A string representing the created_source
"""
if created_source is not None and not isinstance(created_source, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_source EXPECTED TYPE: str', None, None)
self.__created_source = created_source
self.__key_modified['created_source'] = 1
def get_field_read_only(self):
"""
The method to get the field_read_only
Returns:
bool: A bool representing the field_read_only
"""
return self.__field_read_only
def set_field_read_only(self, field_read_only):
"""
The method to set the value to field_read_only
Parameters:
field_read_only (bool) : A bool representing the field_read_only
"""
if field_read_only is not None and not isinstance(field_read_only, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: field_read_only EXPECTED TYPE: bool', None, None)
self.__field_read_only = field_read_only
self.__key_modified['field_read_only'] = 1
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_read_only(self):
"""
The method to get the read_only
Returns:
bool: A bool representing the read_only
"""
return self.__read_only
def set_read_only(self, read_only):
"""
The method to set the value to read_only
Parameters:
read_only (bool) : A bool representing the read_only
"""
if read_only is not None and not isinstance(read_only, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: read_only EXPECTED TYPE: bool', None, None)
self.__read_only = read_only
self.__key_modified['read_only'] = 1
def get_association_details(self):
"""
The method to get the association_details
Returns:
AssociationDetails: An instance of AssociationDetails
"""
return self.__association_details
def set_association_details(self, association_details):
"""
The method to set the value to association_details
Parameters:
association_details (AssociationDetails) : An instance of AssociationDetails
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.association_details import AssociationDetails
except Exception:
from .association_details import AssociationDetails
if association_details is not None and not isinstance(association_details, AssociationDetails):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: association_details EXPECTED TYPE: AssociationDetails', None, None)
self.__association_details = association_details
self.__key_modified['association_details'] = 1
def get_quick_sequence_number(self):
"""
The method to get the quick_sequence_number
Returns:
int: An int representing the quick_sequence_number
"""
return self.__quick_sequence_number
def set_quick_sequence_number(self, quick_sequence_number):
"""
The method to set the value to quick_sequence_number
Parameters:
quick_sequence_number (int) : An int representing the quick_sequence_number
"""
if quick_sequence_number is not None and not isinstance(quick_sequence_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: quick_sequence_number EXPECTED TYPE: int', None, None)
self.__quick_sequence_number = quick_sequence_number
self.__key_modified['quick_sequence_number'] = 1
def get_businesscard_supported(self):
"""
The method to get the businesscard_supported
Returns:
bool: A bool representing the businesscard_supported
"""
return self.__businesscard_supported
def set_businesscard_supported(self, businesscard_supported):
"""
The method to set the value to businesscard_supported
Parameters:
businesscard_supported (bool) : A bool representing the businesscard_supported
"""
if businesscard_supported is not None and not isinstance(businesscard_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: businesscard_supported EXPECTED TYPE: bool', None, None)
self.__businesscard_supported = businesscard_supported
self.__key_modified['businesscard_supported'] = 1
def get_multi_module_lookup(self):
"""
The method to get the multi_module_lookup
Returns:
dict: An instance of dict
"""
return self.__multi_module_lookup
def set_multi_module_lookup(self, multi_module_lookup):
"""
The method to set the value to multi_module_lookup
Parameters:
multi_module_lookup (dict) : An instance of dict
"""
if multi_module_lookup is not None and not isinstance(multi_module_lookup, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: multi_module_lookup EXPECTED TYPE: dict', None, None)
self.__multi_module_lookup = multi_module_lookup
self.__key_modified['multi_module_lookup'] = 1
def get_currency(self):
"""
The method to get the currency
Returns:
Currency: An instance of Currency
"""
return self.__currency
def set_currency(self, currency):
"""
The method to set the value to currency
Parameters:
currency (Currency) : An instance of Currency
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.currency import Currency
except Exception:
from .currency import Currency
if currency is not None and not isinstance(currency, Currency):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: currency EXPECTED TYPE: Currency', None, None)
self.__currency = currency
self.__key_modified['currency'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_custom_field(self):
"""
The method to get the custom_field
Returns:
bool: A bool representing the custom_field
"""
return self.__custom_field
def set_custom_field(self, custom_field):
"""
The method to set the value to custom_field
Parameters:
custom_field (bool) : A bool representing the custom_field
"""
if custom_field is not None and not isinstance(custom_field, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: custom_field EXPECTED TYPE: bool', None, None)
self.__custom_field = custom_field
self.__key_modified['custom_field'] = 1
def get_lookup(self):
"""
The method to get the lookup
Returns:
Module: An instance of Module
"""
return self.__lookup
def set_lookup(self, lookup):
"""
The method to set the value to lookup
Parameters:
lookup (Module) : An instance of Module
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.module import Module
except Exception:
from .module import Module
if lookup is not None and not isinstance(lookup, Module):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: lookup EXPECTED TYPE: Module', None, None)
self.__lookup = lookup
self.__key_modified['lookup'] = 1
def get_visible(self):
"""
The method to get the visible
Returns:
bool: A bool representing the visible
"""
return self.__visible
def set_visible(self, visible):
"""
The method to set the value to visible
Parameters:
visible (bool) : A bool representing the visible
"""
if visible is not None and not isinstance(visible, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: visible EXPECTED TYPE: bool', None, None)
self.__visible = visible
self.__key_modified['visible'] = 1
def get_length(self):
"""
The method to get the length
Returns:
int: An int representing the length
"""
return self.__length
def set_length(self, length):
"""
The method to set the value to length
Parameters:
length (int) : An int representing the length
"""
if length is not None and not isinstance(length, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: length EXPECTED TYPE: int', None, None)
self.__length = length
self.__key_modified['length'] = 1
def get_view_type(self):
"""
The method to get the view_type
Returns:
ViewType: An instance of ViewType
"""
return self.__view_type
def set_view_type(self, view_type):
"""
The method to set the value to view_type
Parameters:
view_type (ViewType) : An instance of ViewType
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.view_type import ViewType
except Exception:
from .view_type import ViewType
if view_type is not None and not isinstance(view_type, ViewType):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: view_type EXPECTED TYPE: ViewType', None, None)
self.__view_type = view_type
self.__key_modified['view_type'] = 1
def get_subform(self):
"""
The method to get the subform
Returns:
Module: An instance of Module
"""
return self.__subform
def set_subform(self, subform):
"""
The method to set the value to subform
Parameters:
subform (Module) : An instance of Module
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.module import Module
except Exception:
from .module import Module
if subform is not None and not isinstance(subform, Module):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: subform EXPECTED TYPE: Module', None, None)
self.__subform = subform
self.__key_modified['subform'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_unique(self):
"""
The method to get the unique
Returns:
Unique: An instance of Unique
"""
return self.__unique
def set_unique(self, unique):
"""
The method to set the value to unique
Parameters:
unique (Unique) : An instance of Unique
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.unique import Unique
except Exception:
from .unique import Unique
if unique is not None and not isinstance(unique, Unique):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: unique EXPECTED TYPE: Unique', None, None)
self.__unique = unique
self.__key_modified['unique'] = 1
def get_history_tracking(self):
"""
The method to get the history_tracking
Returns:
bool: A bool representing the history_tracking
"""
return self.__history_tracking
def set_history_tracking(self, history_tracking):
"""
The method to set the value to history_tracking
Parameters:
history_tracking (bool) : A bool representing the history_tracking
"""
if history_tracking is not None and not isinstance(history_tracking, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: history_tracking EXPECTED TYPE: bool', None, None)
self.__history_tracking = history_tracking
self.__key_modified['history_tracking'] = 1
def get_data_type(self):
"""
The method to get the data_type
Returns:
string: A string representing the data_type
"""
return self.__data_type
def set_data_type(self, data_type):
"""
The method to set the value to data_type
Parameters:
data_type (string) : A string representing the data_type
"""
if data_type is not None and not isinstance(data_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data_type EXPECTED TYPE: str', None, None)
self.__data_type = data_type
self.__key_modified['data_type'] = 1
def get_formula(self):
"""
The method to get the formula
Returns:
Formula: An instance of Formula
"""
return self.__formula
def set_formula(self, formula):
"""
The method to set the value to formula
Parameters:
formula (Formula) : An instance of Formula
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.formula import Formula
except Exception:
from .formula import Formula
if formula is not None and not isinstance(formula, Formula):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: formula EXPECTED TYPE: Formula', None, None)
self.__formula = formula
self.__key_modified['formula'] = 1
def get_decimal_place(self):
"""
The method to get the decimal_place
Returns:
int: An int representing the decimal_place
"""
return self.__decimal_place
def set_decimal_place(self, decimal_place):
"""
The method to set the value to decimal_place
Parameters:
decimal_place (int) : An int representing the decimal_place
"""
if decimal_place is not None and not isinstance(decimal_place, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: decimal_place EXPECTED TYPE: int', None, None)
self.__decimal_place = decimal_place
self.__key_modified['decimal_place'] = 1
def get_mass_update(self):
"""
The method to get the mass_update
Returns:
bool: A bool representing the mass_update
"""
return self.__mass_update
def set_mass_update(self, mass_update):
"""
The method to set the value to mass_update
Parameters:
mass_update (bool) : A bool representing the mass_update
"""
if mass_update is not None and not isinstance(mass_update, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: mass_update EXPECTED TYPE: bool', None, None)
self.__mass_update = mass_update
self.__key_modified['mass_update'] = 1
def get_blueprint_supported(self):
"""
The method to get the blueprint_supported
Returns:
bool: A bool representing the blueprint_supported
"""
return self.__blueprint_supported
def set_blueprint_supported(self, blueprint_supported):
"""
The method to set the value to blueprint_supported
Parameters:
blueprint_supported (bool) : A bool representing the blueprint_supported
"""
if blueprint_supported is not None and not isinstance(blueprint_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: blueprint_supported EXPECTED TYPE: bool', None, None)
self.__blueprint_supported = blueprint_supported
self.__key_modified['blueprint_supported'] = 1
def get_multiselectlookup(self):
"""
The method to get the multiselectlookup
Returns:
MultiSelectLookup: An instance of MultiSelectLookup
"""
return self.__multiselectlookup
def set_multiselectlookup(self, multiselectlookup):
"""
The method to set the value to multiselectlookup
Parameters:
multiselectlookup (MultiSelectLookup) : An instance of MultiSelectLookup
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.multi_select_lookup import MultiSelectLookup
except Exception:
from .multi_select_lookup import MultiSelectLookup
if multiselectlookup is not None and not isinstance(multiselectlookup, MultiSelectLookup):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: multiselectlookup EXPECTED TYPE: MultiSelectLookup', None, None)
self.__multiselectlookup = multiselectlookup
self.__key_modified['multiselectlookup'] = 1
def get_pick_list_values(self):
"""
The method to get the pick_list_values
Returns:
list: An instance of list
"""
return self.__pick_list_values
def set_pick_list_values(self, pick_list_values):
"""
The method to set the value to pick_list_values
Parameters:
pick_list_values (list) : An instance of list
"""
if pick_list_values is not None and not isinstance(pick_list_values, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pick_list_values EXPECTED TYPE: list', None, None)
self.__pick_list_values = pick_list_values
self.__key_modified['pick_list_values'] = 1
def get_auto_number(self):
"""
The method to get the auto_number
Returns:
AutoNumber: An instance of AutoNumber
"""
return self.__auto_number
def set_auto_number(self, auto_number):
"""
The method to set the value to auto_number
Parameters:
auto_number (AutoNumber) : An instance of AutoNumber
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.auto_number import AutoNumber
except Exception:
from .auto_number import AutoNumber
if auto_number is not None and not isinstance(auto_number, AutoNumber):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: auto_number EXPECTED TYPE: AutoNumber', None, None)
self.__auto_number = auto_number
self.__key_modified['auto_number'] = 1
def get_default_value(self):
"""
The method to get the default_value
Returns:
string: A string representing the default_value
"""
return self.__default_value
def set_default_value(self, default_value):
"""
The method to set the value to default_value
Parameters:
default_value (string) : A string representing the default_value
"""
if default_value is not None and not isinstance(default_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: default_value EXPECTED TYPE: str', None, None)
self.__default_value = default_value
self.__key_modified['default_value'] = 1
def get_section_id(self):
"""
The method to get the section_id
Returns:
int: An int representing the section_id
"""
return self.__section_id
def set_section_id(self, section_id):
"""
The method to set the value to section_id
Parameters:
section_id (int) : An int representing the section_id
"""
if section_id is not None and not isinstance(section_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: section_id EXPECTED TYPE: int', None, None)
self.__section_id = section_id
self.__key_modified['section_id'] = 1
def get_validation_rule(self):
"""
The method to get the validation_rule
Returns:
dict: An instance of dict
"""
return self.__validation_rule
def set_validation_rule(self, validation_rule):
"""
The method to set the value to validation_rule
Parameters:
validation_rule (dict) : An instance of dict
"""
if validation_rule is not None and not isinstance(validation_rule, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: validation_rule EXPECTED TYPE: dict', None, None)
self.__validation_rule = validation_rule
self.__key_modified['validation_rule'] = 1
def get_convert_mapping(self):
"""
The method to get the convert_mapping
Returns:
dict: An instance of dict
"""
return self.__convert_mapping
def set_convert_mapping(self, convert_mapping):
"""
The method to set the value to convert_mapping
Parameters:
convert_mapping (dict) : An instance of dict
"""
if convert_mapping is not None and not isinstance(convert_mapping, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: convert_mapping EXPECTED TYPE: dict', None, None)
self.__convert_mapping = convert_mapping
self.__key_modified['convert_mapping'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/field.py | field.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.fields.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__fields = None
self.__key_modified = dict()
def get_fields(self):
"""
The method to get the fields
Returns:
list: An instance of list
"""
return self.__fields
def set_fields(self, fields):
"""
The method to set the value to fields
Parameters:
fields (list) : An instance of list
"""
if fields is not None and not isinstance(fields, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fields EXPECTED TYPE: list', None, None)
self.__fields = fields
self.__key_modified['fields'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class AssociationDetails(object):
def __init__(self):
"""Creates an instance of AssociationDetails"""
self.__lookup_field = None
self.__related_field = None
self.__key_modified = dict()
def get_lookup_field(self):
"""
The method to get the lookup_field
Returns:
LookupField: An instance of LookupField
"""
return self.__lookup_field
def set_lookup_field(self, lookup_field):
"""
The method to set the value to lookup_field
Parameters:
lookup_field (LookupField) : An instance of LookupField
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.lookup_field import LookupField
except Exception:
from .lookup_field import LookupField
if lookup_field is not None and not isinstance(lookup_field, LookupField):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: lookup_field EXPECTED TYPE: LookupField', None, None)
self.__lookup_field = lookup_field
self.__key_modified['lookup_field'] = 1
def get_related_field(self):
"""
The method to get the related_field
Returns:
LookupField: An instance of LookupField
"""
return self.__related_field
def set_related_field(self, related_field):
"""
The method to set the value to related_field
Parameters:
related_field (LookupField) : An instance of LookupField
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.lookup_field import LookupField
except Exception:
from .lookup_field import LookupField
if related_field is not None and not isinstance(related_field, LookupField):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: related_field EXPECTED TYPE: LookupField', None, None)
self.__related_field = related_field
self.__key_modified['related_field'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/association_details.py | association_details.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Private(object):
def __init__(self):
"""Creates an instance of Private"""
self.__restricted = None
self.__export = None
self.__type = None
self.__key_modified = dict()
def get_restricted(self):
"""
The method to get the restricted
Returns:
bool: A bool representing the restricted
"""
return self.__restricted
def set_restricted(self, restricted):
"""
The method to set the value to restricted
Parameters:
restricted (bool) : A bool representing the restricted
"""
if restricted is not None and not isinstance(restricted, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: restricted EXPECTED TYPE: bool', None, None)
self.__restricted = restricted
self.__key_modified['restricted'] = 1
def get_export(self):
"""
The method to get the export
Returns:
bool: A bool representing the export
"""
return self.__export
def set_export(self, export):
"""
The method to set the value to export
Parameters:
export (bool) : A bool representing the export
"""
if export is not None and not isinstance(export, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: export EXPECTED TYPE: bool', None, None)
self.__export = export
self.__key_modified['export'] = 1
def get_type(self):
"""
The method to get the type
Returns:
string: A string representing the type
"""
return self.__type
def set_type(self, type):
"""
The method to set the value to type
Parameters:
type (string) : A string representing the type
"""
if type is not None and not isinstance(type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None)
self.__type = type
self.__key_modified['type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/private.py | private.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Currency(object):
def __init__(self):
"""Creates an instance of Currency"""
self.__rounding_option = None
self.__precision = None
self.__key_modified = dict()
def get_rounding_option(self):
"""
The method to get the rounding_option
Returns:
string: A string representing the rounding_option
"""
return self.__rounding_option
def set_rounding_option(self, rounding_option):
"""
The method to set the value to rounding_option
Parameters:
rounding_option (string) : A string representing the rounding_option
"""
if rounding_option is not None and not isinstance(rounding_option, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: rounding_option EXPECTED TYPE: str', None, None)
self.__rounding_option = rounding_option
self.__key_modified['rounding_option'] = 1
def get_precision(self):
"""
The method to get the precision
Returns:
int: An int representing the precision
"""
return self.__precision
def set_precision(self, precision):
"""
The method to set the value to precision
Parameters:
precision (int) : An int representing the precision
"""
if precision is not None and not isinstance(precision, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: precision EXPECTED TYPE: int', None, None)
self.__precision = precision
self.__key_modified['precision'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/currency.py | currency.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class RelatedDetails(object):
def __init__(self):
"""Creates an instance of RelatedDetails"""
self.__display_label = None
self.__api_name = None
self.__module = None
self.__id = None
self.__type = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_module(self):
"""
The method to get the module
Returns:
Module: An instance of Module
"""
return self.__module
def set_module(self, module):
"""
The method to set the value to module
Parameters:
module (Module) : An instance of Module
"""
try:
from zcrmsdk.src.com.zoho.crm.api.fields.module import Module
except Exception:
from .module import Module
if module is not None and not isinstance(module, Module):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module EXPECTED TYPE: Module', None, None)
self.__module = module
self.__key_modified['module'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_type(self):
"""
The method to get the type
Returns:
string: A string representing the type
"""
return self.__type
def set_type(self, type):
"""
The method to set the value to type
Parameters:
type (string) : A string representing the type
"""
if type is not None and not isinstance(type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None)
self.__type = type
self.__key_modified['_type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/related_details.py | related_details.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Formula(object):
def __init__(self):
"""Creates an instance of Formula"""
self.__return_type = None
self.__expression = None
self.__key_modified = dict()
def get_return_type(self):
"""
The method to get the return_type
Returns:
string: A string representing the return_type
"""
return self.__return_type
def set_return_type(self, return_type):
"""
The method to set the value to return_type
Parameters:
return_type (string) : A string representing the return_type
"""
if return_type is not None and not isinstance(return_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: return_type EXPECTED TYPE: str', None, None)
self.__return_type = return_type
self.__key_modified['return_type'] = 1
def get_expression(self):
"""
The method to get the expression
Returns:
string: A string representing the expression
"""
return self.__expression
def set_expression(self, expression):
"""
The method to set the value to expression
Parameters:
expression (string) : A string representing the expression
"""
if expression is not None and not isinstance(expression, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expression EXPECTED TYPE: str', None, None)
self.__expression = expression
self.__key_modified['expression'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/formula.py | formula.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class ViewType(object):
def __init__(self):
"""Creates an instance of ViewType"""
self.__view = None
self.__edit = None
self.__create = None
self.__quick_create = None
self.__key_modified = dict()
def get_view(self):
"""
The method to get the view
Returns:
bool: A bool representing the view
"""
return self.__view
def set_view(self, view):
"""
The method to set the value to view
Parameters:
view (bool) : A bool representing the view
"""
if view is not None and not isinstance(view, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: view EXPECTED TYPE: bool', None, None)
self.__view = view
self.__key_modified['view'] = 1
def get_edit(self):
"""
The method to get the edit
Returns:
bool: A bool representing the edit
"""
return self.__edit
def set_edit(self, edit):
"""
The method to set the value to edit
Parameters:
edit (bool) : A bool representing the edit
"""
if edit is not None and not isinstance(edit, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: edit EXPECTED TYPE: bool', None, None)
self.__edit = edit
self.__key_modified['edit'] = 1
def get_create(self):
"""
The method to get the create
Returns:
bool: A bool representing the create
"""
return self.__create
def set_create(self, create):
"""
The method to set the value to create
Parameters:
create (bool) : A bool representing the create
"""
if create is not None and not isinstance(create, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: create EXPECTED TYPE: bool', None, None)
self.__create = create
self.__key_modified['create'] = 1
def get_quick_create(self):
"""
The method to get the quick_create
Returns:
bool: A bool representing the quick_create
"""
return self.__quick_create
def set_quick_create(self, quick_create):
"""
The method to set the value to quick_create
Parameters:
quick_create (bool) : A bool representing the quick_create
"""
if quick_create is not None and not isinstance(quick_create, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: quick_create EXPECTED TYPE: bool', None, None)
self.__quick_create = quick_create
self.__key_modified['quick_create'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/view_type.py | view_type.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Crypt(object):
def __init__(self):
"""Creates an instance of Crypt"""
self.__mode = None
self.__column = None
self.__encfldids = None
self.__notify = None
self.__table = None
self.__status = None
self.__key_modified = dict()
def get_mode(self):
"""
The method to get the mode
Returns:
string: A string representing the mode
"""
return self.__mode
def set_mode(self, mode):
"""
The method to set the value to mode
Parameters:
mode (string) : A string representing the mode
"""
if mode is not None and not isinstance(mode, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: mode EXPECTED TYPE: str', None, None)
self.__mode = mode
self.__key_modified['mode'] = 1
def get_column(self):
"""
The method to get the column
Returns:
string: A string representing the column
"""
return self.__column
def set_column(self, column):
"""
The method to set the value to column
Parameters:
column (string) : A string representing the column
"""
if column is not None and not isinstance(column, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: column EXPECTED TYPE: str', None, None)
self.__column = column
self.__key_modified['column'] = 1
def get_encfldids(self):
"""
The method to get the encfldids
Returns:
list: An instance of list
"""
return self.__encfldids
def set_encfldids(self, encfldids):
"""
The method to set the value to encfldids
Parameters:
encfldids (list) : An instance of list
"""
if encfldids is not None and not isinstance(encfldids, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: encfldids EXPECTED TYPE: list', None, None)
self.__encfldids = encfldids
self.__key_modified['encFldIds'] = 1
def get_notify(self):
"""
The method to get the notify
Returns:
string: A string representing the notify
"""
return self.__notify
def set_notify(self, notify):
"""
The method to set the value to notify
Parameters:
notify (string) : A string representing the notify
"""
if notify is not None and not isinstance(notify, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: notify EXPECTED TYPE: str', None, None)
self.__notify = notify
self.__key_modified['notify'] = 1
def get_table(self):
"""
The method to get the table
Returns:
string: A string representing the table
"""
return self.__table
def set_table(self, table):
"""
The method to set the value to table
Parameters:
table (string) : A string representing the table
"""
if table is not None and not isinstance(table, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: table EXPECTED TYPE: str', None, None)
self.__table = table
self.__key_modified['table'] = 1
def get_status(self):
"""
The method to get the status
Returns:
int: An int representing the status
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (int) : An int representing the status
"""
if status is not None and not isinstance(status, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: int', None, None)
self.__status = status
self.__key_modified['status'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/crypt.py | crypt.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.fields.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class LookupField(object):
def __init__(self):
"""Creates an instance of LookupField"""
self.__id = None
self.__name = None
self.__key_modified = dict()
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/lookup_field.py | lookup_field.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class ToolTip(object):
def __init__(self):
"""Creates an instance of ToolTip"""
self.__name = None
self.__value = None
self.__key_modified = dict()
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_value(self):
"""
The method to get the value
Returns:
string: A string representing the value
"""
return self.__value
def set_value(self, value):
"""
The method to set the value to value
Parameters:
value (string) : A string representing the value
"""
if value is not None and not isinstance(value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: value EXPECTED TYPE: str', None, None)
self.__value = value
self.__key_modified['value'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/tool_tip.py | tool_tip.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Unique(object):
def __init__(self):
"""Creates an instance of Unique"""
self.__casesensitive = None
self.__key_modified = dict()
def get_casesensitive(self):
"""
The method to get the casesensitive
Returns:
string: A string representing the casesensitive
"""
return self.__casesensitive
def set_casesensitive(self, casesensitive):
"""
The method to set the value to casesensitive
Parameters:
casesensitive (string) : A string representing the casesensitive
"""
if casesensitive is not None and not isinstance(casesensitive, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: casesensitive EXPECTED TYPE: str', None, None)
self.__casesensitive = casesensitive
self.__key_modified['casesensitive'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/unique.py | unique.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class PickListValue(object):
def __init__(self):
"""Creates an instance of PickListValue"""
self.__display_value = None
self.__sequence_number = None
self.__expected_data_type = None
self.__maps = None
self.__actual_value = None
self.__sys_ref_name = None
self.__type = None
self.__key_modified = dict()
def get_display_value(self):
"""
The method to get the display_value
Returns:
string: A string representing the display_value
"""
return self.__display_value
def set_display_value(self, display_value):
"""
The method to set the value to display_value
Parameters:
display_value (string) : A string representing the display_value
"""
if display_value is not None and not isinstance(display_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_value EXPECTED TYPE: str', None, None)
self.__display_value = display_value
self.__key_modified['display_value'] = 1
def get_sequence_number(self):
"""
The method to get the sequence_number
Returns:
int: An int representing the sequence_number
"""
return self.__sequence_number
def set_sequence_number(self, sequence_number):
"""
The method to set the value to sequence_number
Parameters:
sequence_number (int) : An int representing the sequence_number
"""
if sequence_number is not None and not isinstance(sequence_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sequence_number EXPECTED TYPE: int', None, None)
self.__sequence_number = sequence_number
self.__key_modified['sequence_number'] = 1
def get_expected_data_type(self):
"""
The method to get the expected_data_type
Returns:
string: A string representing the expected_data_type
"""
return self.__expected_data_type
def set_expected_data_type(self, expected_data_type):
"""
The method to set the value to expected_data_type
Parameters:
expected_data_type (string) : A string representing the expected_data_type
"""
if expected_data_type is not None and not isinstance(expected_data_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expected_data_type EXPECTED TYPE: str', None, None)
self.__expected_data_type = expected_data_type
self.__key_modified['expected_data_type'] = 1
def get_maps(self):
"""
The method to get the maps
Returns:
list: An instance of list
"""
return self.__maps
def set_maps(self, maps):
"""
The method to set the value to maps
Parameters:
maps (list) : An instance of list
"""
if maps is not None and not isinstance(maps, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: maps EXPECTED TYPE: list', None, None)
self.__maps = maps
self.__key_modified['maps'] = 1
def get_actual_value(self):
"""
The method to get the actual_value
Returns:
string: A string representing the actual_value
"""
return self.__actual_value
def set_actual_value(self, actual_value):
"""
The method to set the value to actual_value
Parameters:
actual_value (string) : A string representing the actual_value
"""
if actual_value is not None and not isinstance(actual_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: actual_value EXPECTED TYPE: str', None, None)
self.__actual_value = actual_value
self.__key_modified['actual_value'] = 1
def get_sys_ref_name(self):
"""
The method to get the sys_ref_name
Returns:
string: A string representing the sys_ref_name
"""
return self.__sys_ref_name
def set_sys_ref_name(self, sys_ref_name):
"""
The method to set the value to sys_ref_name
Parameters:
sys_ref_name (string) : A string representing the sys_ref_name
"""
if sys_ref_name is not None and not isinstance(sys_ref_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sys_ref_name EXPECTED TYPE: str', None, None)
self.__sys_ref_name = sys_ref_name
self.__key_modified['sys_ref_name'] = 1
def get_type(self):
"""
The method to get the type
Returns:
string: A string representing the type
"""
return self.__type
def set_type(self, type):
"""
The method to set the value to type
Parameters:
type (string) : A string representing the type
"""
if type is not None and not isinstance(type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None)
self.__type = type
self.__key_modified['type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/pick_list_value.py | pick_list_value.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.parameter_map import ParameterMap
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
from zcrmsdk.src.com.zoho.crm.api.param import Param
except Exception:
from ..exception import SDKException
from ..parameter_map import ParameterMap
from ..util import APIResponse, CommonAPIHandler, Constants
from ..param import Param
class FieldsOperations(object):
def __init__(self, module=None):
"""
Creates an instance of FieldsOperations with the given parameters
Parameters:
module (string) : A string representing the module
"""
if module is not None and not isinstance(module, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module EXPECTED TYPE: str', None, None)
self.__module = module
def get_fields(self, param_instance=None):
"""
The method to get fields
Parameters:
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/fields'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_param(Param('module', 'com.zoho.crm.api.Fields.GetFieldsParam'), self.__module)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.fields.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_field(self, id):
"""
The method to get field
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/fields/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_param(Param('module', 'com.zoho.crm.api.Fields.GetFieldParam'), self.__module)
try:
from zcrmsdk.src.com.zoho.crm.api.fields.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
class GetFieldsParam(object):
type = Param('type', 'com.zoho.crm.api.Fields.GetFieldsParam')
class GetFieldParam(object):
pass | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/fields_operations.py | fields_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Module(object):
def __init__(self):
"""Creates an instance of Module"""
self.__layout = None
self.__display_label = None
self.__api_name = None
self.__module = None
self.__id = None
self.__module_name = None
self.__key_modified = dict()
def get_layout(self):
"""
The method to get the layout
Returns:
Layout: An instance of Layout
"""
return self.__layout
def set_layout(self, layout):
"""
The method to set the value to layout
Parameters:
layout (Layout) : An instance of Layout
"""
try:
from zcrmsdk.src.com.zoho.crm.api.layouts import Layout
except Exception:
from ..layouts import Layout
if layout is not None and not isinstance(layout, Layout):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: layout EXPECTED TYPE: Layout', None, None)
self.__layout = layout
self.__key_modified['layout'] = 1
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_module(self):
"""
The method to get the module
Returns:
string: A string representing the module
"""
return self.__module
def set_module(self, module):
"""
The method to set the value to module
Parameters:
module (string) : A string representing the module
"""
if module is not None and not isinstance(module, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module EXPECTED TYPE: str', None, None)
self.__module = module
self.__key_modified['module'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_module_name(self):
"""
The method to get the module_name
Returns:
string: A string representing the module_name
"""
return self.__module_name
def set_module_name(self, module_name):
"""
The method to set the value to module_name
Parameters:
module_name (string) : A string representing the module_name
"""
if module_name is not None and not isinstance(module_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_name EXPECTED TYPE: str', None, None)
self.__module_name = module_name
self.__key_modified['module_name'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/module.py | module.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class AutoNumber(object):
def __init__(self):
"""Creates an instance of AutoNumber"""
self.__prefix = None
self.__suffix = None
self.__start_number = None
self.__key_modified = dict()
def get_prefix(self):
"""
The method to get the prefix
Returns:
string: A string representing the prefix
"""
return self.__prefix
def set_prefix(self, prefix):
"""
The method to set the value to prefix
Parameters:
prefix (string) : A string representing the prefix
"""
if prefix is not None and not isinstance(prefix, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: prefix EXPECTED TYPE: str', None, None)
self.__prefix = prefix
self.__key_modified['prefix'] = 1
def get_suffix(self):
"""
The method to get the suffix
Returns:
string: A string representing the suffix
"""
return self.__suffix
def set_suffix(self, suffix):
"""
The method to set the value to suffix
Parameters:
suffix (string) : A string representing the suffix
"""
if suffix is not None and not isinstance(suffix, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: suffix EXPECTED TYPE: str', None, None)
self.__suffix = suffix
self.__key_modified['suffix'] = 1
def get_start_number(self):
"""
The method to get the start_number
Returns:
int: An int representing the start_number
"""
return self.__start_number
def set_start_number(self, start_number):
"""
The method to set the value to start_number
Parameters:
start_number (int) : An int representing the start_number
"""
if start_number is not None and not isinstance(start_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: start_number EXPECTED TYPE: int', None, None)
self.__start_number = start_number
self.__key_modified['start_number'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/auto_number.py | auto_number.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class MultiSelectLookup(object):
def __init__(self):
"""Creates an instance of MultiSelectLookup"""
self.__display_label = None
self.__linking_module = None
self.__lookup_apiname = None
self.__api_name = None
self.__connectedlookup_apiname = None
self.__id = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_linking_module(self):
"""
The method to get the linking_module
Returns:
string: A string representing the linking_module
"""
return self.__linking_module
def set_linking_module(self, linking_module):
"""
The method to set the value to linking_module
Parameters:
linking_module (string) : A string representing the linking_module
"""
if linking_module is not None and not isinstance(linking_module, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: linking_module EXPECTED TYPE: str', None, None)
self.__linking_module = linking_module
self.__key_modified['linking_module'] = 1
def get_lookup_apiname(self):
"""
The method to get the lookup_apiname
Returns:
string: A string representing the lookup_apiname
"""
return self.__lookup_apiname
def set_lookup_apiname(self, lookup_apiname):
"""
The method to set the value to lookup_apiname
Parameters:
lookup_apiname (string) : A string representing the lookup_apiname
"""
if lookup_apiname is not None and not isinstance(lookup_apiname, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: lookup_apiname EXPECTED TYPE: str', None, None)
self.__lookup_apiname = lookup_apiname
self.__key_modified['lookup_apiname'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_connectedlookup_apiname(self):
"""
The method to get the connectedlookup_apiname
Returns:
string: A string representing the connectedlookup_apiname
"""
return self.__connectedlookup_apiname
def set_connectedlookup_apiname(self, connectedlookup_apiname):
"""
The method to set the value to connectedlookup_apiname
Parameters:
connectedlookup_apiname (string) : A string representing the connectedlookup_apiname
"""
if connectedlookup_apiname is not None and not isinstance(connectedlookup_apiname, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: connectedlookup_apiname EXPECTED TYPE: str', None, None)
self.__connectedlookup_apiname = connectedlookup_apiname
self.__key_modified['connectedlookup_apiname'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/fields/multi_select_lookup.py | multi_select_lookup.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.profiles.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__profiles = None
self.__key_modified = dict()
def get_profiles(self):
"""
The method to get the profiles
Returns:
list: An instance of list
"""
return self.__profiles
def set_profiles(self, profiles):
"""
The method to set the value to profiles
Parameters:
profiles (list) : An instance of list
"""
if profiles is not None and not isinstance(profiles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: profiles EXPECTED TYPE: list', None, None)
self.__profiles = profiles
self.__key_modified['profiles'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Section(object):
def __init__(self):
"""Creates an instance of Section"""
self.__name = None
self.__categories = None
self.__key_modified = dict()
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_categories(self):
"""
The method to get the categories
Returns:
list: An instance of list
"""
return self.__categories
def set_categories(self, categories):
"""
The method to set the value to categories
Parameters:
categories (list) : An instance of list
"""
if categories is not None and not isinstance(categories, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: categories EXPECTED TYPE: list', None, None)
self.__categories = categories
self.__key_modified['categories'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/section.py | section.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.profiles.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class PermissionDetail(object):
def __init__(self):
"""Creates an instance of PermissionDetail"""
self.__display_label = None
self.__module = None
self.__name = None
self.__id = None
self.__enabled = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_module(self):
"""
The method to get the module
Returns:
string: A string representing the module
"""
return self.__module
def set_module(self, module):
"""
The method to set the value to module
Parameters:
module (string) : A string representing the module
"""
if module is not None and not isinstance(module, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module EXPECTED TYPE: str', None, None)
self.__module = module
self.__key_modified['module'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_enabled(self):
"""
The method to get the enabled
Returns:
bool: A bool representing the enabled
"""
return self.__enabled
def set_enabled(self, enabled):
"""
The method to set the value to enabled
Parameters:
enabled (bool) : A bool representing the enabled
"""
if enabled is not None and not isinstance(enabled, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: enabled EXPECTED TYPE: bool', None, None)
self.__enabled = enabled
self.__key_modified['enabled'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/permission_detail.py | permission_detail.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Category(object):
def __init__(self):
"""Creates an instance of Category"""
self.__display_label = None
self.__permissions_details = None
self.__name = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_permissions_details(self):
"""
The method to get the permissions_details
Returns:
list: An instance of list
"""
return self.__permissions_details
def set_permissions_details(self, permissions_details):
"""
The method to set the value to permissions_details
Parameters:
permissions_details (list) : An instance of list
"""
if permissions_details is not None and not isinstance(permissions_details, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permissions_details EXPECTED TYPE: list', None, None)
self.__permissions_details = permissions_details
self.__key_modified['permissions_details'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/category.py | category.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
from zcrmsdk.src.com.zoho.crm.api.header import Header
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
from ..header import Header
class ProfilesOperations(object):
def __init__(self, if_modified_since=None):
"""
Creates an instance of ProfilesOperations with the given parameters
Parameters:
if_modified_since (datetime) : An instance of datetime
"""
from datetime import datetime
if if_modified_since is not None and not isinstance(if_modified_since, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: if_modified_since EXPECTED TYPE: datetime', None, None)
self.__if_modified_since = if_modified_since
def get_profiles(self):
"""
The method to get profiles
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/profiles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_header(Header('If-Modified-Since', 'com.zoho.crm.api.Profiles.GetProfilesHeader'), self.__if_modified_since)
try:
from zcrmsdk.src.com.zoho.crm.api.profiles.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_profile(self, id):
"""
The method to get profile
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/settings/profiles/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_header(Header('If-Modified-Since', 'com.zoho.crm.api.Profiles.GetProfileHeader'), self.__if_modified_since)
try:
from zcrmsdk.src.com.zoho.crm.api.profiles.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
class GetProfilesHeader(object):
pass
class GetProfileHeader(object):
pass | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/profiles_operations.py | profiles_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Profile(object):
def __init__(self):
"""Creates an instance of Profile"""
self.__display_label = None
self.__created_time = None
self.__modified_time = None
self.__permissions_details = None
self.__name = None
self.__modified_by = None
self.__default = None
self.__description = None
self.__id = None
self.__category = None
self.__created_by = None
self.__sections = None
self.__delete = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_created_time(self):
"""
The method to get the created_time
Returns:
datetime: An instance of datetime
"""
return self.__created_time
def set_created_time(self, created_time):
"""
The method to set the value to created_time
Parameters:
created_time (datetime) : An instance of datetime
"""
from datetime import datetime
if created_time is not None and not isinstance(created_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: datetime', None, None)
self.__created_time = created_time
self.__key_modified['created_time'] = 1
def get_modified_time(self):
"""
The method to get the modified_time
Returns:
datetime: An instance of datetime
"""
return self.__modified_time
def set_modified_time(self, modified_time):
"""
The method to set the value to modified_time
Parameters:
modified_time (datetime) : An instance of datetime
"""
from datetime import datetime
if modified_time is not None and not isinstance(modified_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_time EXPECTED TYPE: datetime', None, None)
self.__modified_time = modified_time
self.__key_modified['modified_time'] = 1
def get_permissions_details(self):
"""
The method to get the permissions_details
Returns:
list: An instance of list
"""
return self.__permissions_details
def set_permissions_details(self, permissions_details):
"""
The method to set the value to permissions_details
Parameters:
permissions_details (list) : An instance of list
"""
if permissions_details is not None and not isinstance(permissions_details, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permissions_details EXPECTED TYPE: list', None, None)
self.__permissions_details = permissions_details
self.__key_modified['permissions_details'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_modified_by(self):
"""
The method to get the modified_by
Returns:
User: An instance of User
"""
return self.__modified_by
def set_modified_by(self, modified_by):
"""
The method to set the value to modified_by
Parameters:
modified_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if modified_by is not None and not isinstance(modified_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_by EXPECTED TYPE: User', None, None)
self.__modified_by = modified_by
self.__key_modified['modified_by'] = 1
def get_default(self):
"""
The method to get the default
Returns:
bool: A bool representing the default
"""
return self.__default
def set_default(self, default):
"""
The method to set the value to default
Parameters:
default (bool) : A bool representing the default
"""
if default is not None and not isinstance(default, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: default EXPECTED TYPE: bool', None, None)
self.__default = default
self.__key_modified['default'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_category(self):
"""
The method to get the category
Returns:
bool: A bool representing the category
"""
return self.__category
def set_category(self, category):
"""
The method to set the value to category
Parameters:
category (bool) : A bool representing the category
"""
if category is not None and not isinstance(category, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: category EXPECTED TYPE: bool', None, None)
self.__category = category
self.__key_modified['category'] = 1
def get_created_by(self):
"""
The method to get the created_by
Returns:
User: An instance of User
"""
return self.__created_by
def set_created_by(self, created_by):
"""
The method to set the value to created_by
Parameters:
created_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if created_by is not None and not isinstance(created_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_by EXPECTED TYPE: User', None, None)
self.__created_by = created_by
self.__key_modified['created_by'] = 1
def get_sections(self):
"""
The method to get the sections
Returns:
list: An instance of list
"""
return self.__sections
def set_sections(self, sections):
"""
The method to set the value to sections
Parameters:
sections (list) : An instance of list
"""
if sections is not None and not isinstance(sections, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sections EXPECTED TYPE: list', None, None)
self.__sections = sections
self.__key_modified['sections'] = 1
def get_delete(self):
"""
The method to get the delete
Returns:
bool: A bool representing the delete
"""
return self.__delete
def set_delete(self, delete):
"""
The method to set the value to delete
Parameters:
delete (bool) : A bool representing the delete
"""
if delete is not None and not isinstance(delete, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: delete EXPECTED TYPE: bool', None, None)
self.__delete = delete
self.__key_modified['_delete'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/profiles/profile.py | profile.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_action_handler import RecordActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .record_action_handler import RecordActionHandler
class RecordActionWrapper(RecordActionHandler):
def __init__(self):
"""Creates an instance of RecordActionWrapper"""
super().__init__()
self.__data = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/record_action_wrapper.py | record_action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__contact_roles = None
self.__key_modified = dict()
def get_contact_roles(self):
"""
The method to get the contact_roles
Returns:
list: An instance of list
"""
return self.__contact_roles
def set_contact_roles(self, contact_roles):
"""
The method to set the value to contact_roles
Parameters:
contact_roles (list) : An instance of list
"""
if contact_roles is not None and not isinstance(contact_roles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_roles EXPECTED TYPE: list', None, None)
self.__contact_roles = contact_roles
self.__key_modified['contact_roles'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__contact_roles = None
self.__key_modified = dict()
def get_contact_roles(self):
"""
The method to get the contact_roles
Returns:
list: An instance of list
"""
return self.__contact_roles
def set_contact_roles(self, contact_roles):
"""
The method to set the value to contact_roles
Parameters:
contact_roles (list) : An instance of list
"""
if contact_roles is not None and not isinstance(contact_roles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_roles EXPECTED TYPE: list', None, None)
self.__contact_roles = contact_roles
self.__key_modified['contact_roles'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.parameter_map import ParameterMap
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Utility, Constants
from zcrmsdk.src.com.zoho.crm.api.param import Param
except Exception:
from ..exception import SDKException
from ..parameter_map import ParameterMap
from ..util import APIResponse, CommonAPIHandler, Utility, Constants
from ..param import Param
class ContactRolesOperations(object):
def __init__(self):
"""Creates an instance of ContactRolesOperations"""
pass
def get_contact_roles(self):
"""
The method to get contact roles
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def create_contact_roles(self, request):
"""
The method to create contact roles
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def update_contact_roles(self, request):
"""
The method to update contact roles
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def delete_contact_roles(self, param_instance=None):
"""
The method to delete contact roles
Parameters:
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_contact_role(self, id):
"""
The method to get contact role
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def update_contact_role(self, id, request):
"""
The method to update contact role
Parameters:
id (int) : An int representing the id
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def delete_contact_role(self, id):
"""
The method to delete contact role
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Contacts/roles/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_all_contact_roles_of_deal(self, deal_id, param_instance=None):
"""
The method to get all contact roles of deal
Parameters:
deal_id (int) : An int representing the deal_id
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(deal_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deal_id EXPECTED TYPE: int', None, None)
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Deals/'
api_path = api_path + str(deal_id)
api_path = api_path + '/Contact_Roles'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_param(param_instance)
handler_instance.set_module_api_name("Contacts")
Utility.get_fields("Contacts", handler_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_response_handler import RecordResponseHandler
except Exception:
from .record_response_handler import RecordResponseHandler
return handler_instance.api_call(RecordResponseHandler.__module__, 'application/json')
def get_contact_role_of_deal(self, contact_id, deal_id):
"""
The method to get contact role of deal
Parameters:
contact_id (int) : An int representing the contact_id
deal_id (int) : An int representing the deal_id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(contact_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_id EXPECTED TYPE: int', None, None)
if not isinstance(deal_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deal_id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Deals/'
api_path = api_path + str(deal_id)
api_path = api_path + '/Contact_Roles/'
api_path = api_path + str(contact_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_module_api_name("Contacts")
Utility.get_fields("Contacts", handler_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_response_handler import RecordResponseHandler
except Exception:
from .record_response_handler import RecordResponseHandler
return handler_instance.api_call(RecordResponseHandler.__module__, 'application/json')
def add_contact_role_to_deal(self, contact_id, deal_id, request):
"""
The method to add contact role to deal
Parameters:
contact_id (int) : An int representing the contact_id
deal_id (int) : An int representing the deal_id
request (RecordBodyWrapper) : An instance of RecordBodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_body_wrapper import RecordBodyWrapper
except Exception:
from .record_body_wrapper import RecordBodyWrapper
if not isinstance(contact_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_id EXPECTED TYPE: int', None, None)
if not isinstance(deal_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deal_id EXPECTED TYPE: int', None, None)
if request is not None and not isinstance(request, RecordBodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: RecordBodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Deals/'
api_path = api_path + str(deal_id)
api_path = api_path + '/Contact_Roles/'
api_path = api_path + str(contact_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_action_handler import RecordActionHandler
except Exception:
from .record_action_handler import RecordActionHandler
return handler_instance.api_call(RecordActionHandler.__module__, 'application/json')
def remove_contact_role_from_deal(self, contact_id, deal_id):
"""
The method to remove contact role from deal
Parameters:
contact_id (int) : An int representing the contact_id
deal_id (int) : An int representing the deal_id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(contact_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_id EXPECTED TYPE: int', None, None)
if not isinstance(deal_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deal_id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2/Deals/'
api_path = api_path + str(deal_id)
api_path = api_path + '/Contact_Roles/'
api_path = api_path + str(contact_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
try:
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_action_handler import RecordActionHandler
except Exception:
from .record_action_handler import RecordActionHandler
return handler_instance.api_call(RecordActionHandler.__module__, 'application/json')
class DeleteContactRolesParam(object):
ids = Param('ids', 'com.zoho.crm.api.ContactRoles.DeleteContactRolesParam')
class GetAllContactRolesOfDealParam(object):
ids = Param('ids', 'com.zoho.crm.api.ContactRoles.GetAllContactRolesOfDealParam') | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/contact_roles_operations.py | contact_roles_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class ContactRoleWrapper(object):
def __init__(self):
"""Creates an instance of ContactRoleWrapper"""
self.__contact_role = None
self.__key_modified = dict()
def get_contact_role(self):
"""
The method to get the contact_role
Returns:
string: A string representing the contact_role
"""
return self.__contact_role
def set_contact_role(self, contact_role):
"""
The method to set the value to contact_role
Parameters:
contact_role (string) : A string representing the contact_role
"""
if contact_role is not None and not isinstance(contact_role, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_role EXPECTED TYPE: str', None, None)
self.__contact_role = contact_role
self.__key_modified['Contact_Role'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/contact_role_wrapper.py | contact_role_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.contact_roles.response_handler import ResponseHandler
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_response_handler import RecordResponseHandler
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_action_handler import RecordActionHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .record_response_handler import RecordResponseHandler
from .action_handler import ActionHandler
from .record_action_handler import RecordActionHandler
class APIException(ResponseHandler, ActionResponse, ActionHandler, RecordResponseHandler, RecordActionHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class ContactRole(object):
def __init__(self):
"""Creates an instance of ContactRole"""
self.__id = None
self.__name = None
self.__sequence_number = None
self.__key_modified = dict()
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_sequence_number(self):
"""
The method to get the sequence_number
Returns:
int: An int representing the sequence_number
"""
return self.__sequence_number
def set_sequence_number(self, sequence_number):
"""
The method to set the value to sequence_number
Parameters:
sequence_number (int) : An int representing the sequence_number
"""
if sequence_number is not None and not isinstance(sequence_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sequence_number EXPECTED TYPE: int', None, None)
self.__sequence_number = sequence_number
self.__key_modified['sequence_number'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/contact_role.py | contact_role.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.record_response_handler import RecordResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .record_response_handler import RecordResponseHandler
class RecordResponseWrapper(RecordResponseHandler):
def __init__(self):
"""Creates an instance of RecordResponseWrapper"""
super().__init__()
self.__data = None
self.__info = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def get_info(self):
"""
The method to get the info
Returns:
Info: An instance of Info
"""
return self.__info
def set_info(self, info):
"""
The method to set the value to info
Parameters:
info (Info) : An instance of Info
"""
try:
from zcrmsdk.src.com.zoho.crm.api.record import Info
except Exception:
from ..record import Info
if info is not None and not isinstance(info, Info):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: info EXPECTED TYPE: Info', None, None)
self.__info = info
self.__key_modified['info'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/record_response_wrapper.py | record_response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class BodyWrapper(object):
def __init__(self):
"""Creates an instance of BodyWrapper"""
self.__contact_roles = None
self.__key_modified = dict()
def get_contact_roles(self):
"""
The method to get the contact_roles
Returns:
list: An instance of list
"""
return self.__contact_roles
def set_contact_roles(self, contact_roles):
"""
The method to set the value to contact_roles
Parameters:
contact_roles (list) : An instance of list
"""
if contact_roles is not None and not isinstance(contact_roles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contact_roles EXPECTED TYPE: list', None, None)
self.__contact_roles = contact_roles
self.__key_modified['contact_roles'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/body_wrapper.py | body_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_response import ActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
class SuccessResponse(ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/contact_roles/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.territories.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__territories = None
self.__key_modified = dict()
def get_territories(self):
"""
The method to get the territories
Returns:
list: An instance of list
"""
return self.__territories
def set_territories(self, territories):
"""
The method to set the value to territories
Parameters:
territories (list) : An instance of list
"""
if territories is not None and not isinstance(territories, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: territories EXPECTED TYPE: list', None, None)
self.__territories = territories
self.__key_modified['territories'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/territories/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Territory(object):
def __init__(self):
"""Creates an instance of Territory"""
self.__created_time = None
self.__modified_time = None
self.__manager = None
self.__parent_id = None
self.__criteria = None
self.__name = None
self.__modified_by = None
self.__description = None
self.__id = None
self.__created_by = None
self.__key_modified = dict()
def get_created_time(self):
"""
The method to get the created_time
Returns:
datetime: An instance of datetime
"""
return self.__created_time
def set_created_time(self, created_time):
"""
The method to set the value to created_time
Parameters:
created_time (datetime) : An instance of datetime
"""
from datetime import datetime
if created_time is not None and not isinstance(created_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: datetime', None, None)
self.__created_time = created_time
self.__key_modified['created_time'] = 1
def get_modified_time(self):
"""
The method to get the modified_time
Returns:
datetime: An instance of datetime
"""
return self.__modified_time
def set_modified_time(self, modified_time):
"""
The method to set the value to modified_time
Parameters:
modified_time (datetime) : An instance of datetime
"""
from datetime import datetime
if modified_time is not None and not isinstance(modified_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_time EXPECTED TYPE: datetime', None, None)
self.__modified_time = modified_time
self.__key_modified['modified_time'] = 1
def get_manager(self):
"""
The method to get the manager
Returns:
User: An instance of User
"""
return self.__manager
def set_manager(self, manager):
"""
The method to set the value to manager
Parameters:
manager (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if manager is not None and not isinstance(manager, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: manager EXPECTED TYPE: User', None, None)
self.__manager = manager
self.__key_modified['manager'] = 1
def get_parent_id(self):
"""
The method to get the parent_id
Returns:
string: A string representing the parent_id
"""
return self.__parent_id
def set_parent_id(self, parent_id):
"""
The method to set the value to parent_id
Parameters:
parent_id (string) : A string representing the parent_id
"""
if parent_id is not None and not isinstance(parent_id, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: parent_id EXPECTED TYPE: str', None, None)
self.__parent_id = parent_id
self.__key_modified['parent_id'] = 1
def get_criteria(self):
"""
The method to get the criteria
Returns:
Criteria: An instance of Criteria
"""
return self.__criteria
def set_criteria(self, criteria):
"""
The method to set the value to criteria
Parameters:
criteria (Criteria) : An instance of Criteria
"""
try:
from zcrmsdk.src.com.zoho.crm.api.customviews import Criteria
except Exception:
from ..custom_views import Criteria
if criteria is not None and not isinstance(criteria, Criteria):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: criteria EXPECTED TYPE: Criteria', None, None)
self.__criteria = criteria
self.__key_modified['criteria'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_modified_by(self):
"""
The method to get the modified_by
Returns:
User: An instance of User
"""
return self.__modified_by
def set_modified_by(self, modified_by):
"""
The method to set the value to modified_by
Parameters:
modified_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if modified_by is not None and not isinstance(modified_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_by EXPECTED TYPE: User', None, None)
self.__modified_by = modified_by
self.__key_modified['modified_by'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_created_by(self):
"""
The method to get the created_by
Returns:
User: An instance of User
"""
return self.__created_by
def set_created_by(self, created_by):
"""
The method to set the value to created_by
Parameters:
created_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if created_by is not None and not isinstance(created_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_by EXPECTED TYPE: User', None, None)
self.__created_by = created_by
self.__key_modified['created_by'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/territories/territory.py | territory.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.territories.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__code = None
self.__status = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-0 | /zohocrmsdk2_0-5.1.0.tar.gz/zohocrmsdk2_0-5.1.0/zcrmsdk/src/com/zoho/crm/api/territories/api_exception.py | api_exception.py |
License
=======
Copyright (c) 2021, ZOHO CORPORATION PRIVATE LIMITED
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# ZOHO CRM PYTHON SDK 2.1 for API version 2.1
## Table Of Contents
* [Overview](#overview)
* [Registering a Zoho Client](#registering-a-zoho-client)
* [Environmental Setup](#environmental-setup)
* [Including the SDK in your project](#including-the-sdk-in-your-project)
* [Persistence](#token-persistence)
* [DataBase Persistence](#database-persistence)
* [File Persistence](#file-persistence)
* [Custom Persistence](#custom-persistence)
* [Configuration](#configuration)
* [Initialization](#initializing-the-application)
* [Class Hierarchy](#class-hierarchy)
* [Responses And Exceptions](#responses-and-exceptions)
* [Threading](#threading-in-the-python-sdk)
* [Multithreading in a Multi-User App](#multithreading-in-a-multi-user-app)
* [Multi-threading in a Single User App](#multi-threading-in-a-single-user-app)
* [Sample Code](#sdk-sample-code)
## Overview
Zoho CRM PYTHON SDK offers a way to create client Python applications that can be integrated with Zoho CRM.
## Registering a Zoho Client
Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:
- Visit this page [https://api-console.zoho.com](https://api-console.zoho.com)
- Click on `ADD CLIENT`.
- Choose the `Client Type`.
- Enter **Client Name**, **Client Domain** or **Homepage URL** and **Authorized Redirect URIs** then click `CREATE`.
- Your Client app will be created.
- Select the created OAuth client.
- Generate grant token by providing the necessary scopes, time duration (the duration for which the generated token is valid) and Scope Description.
## Environmental Setup
Python SDK is installable through **pip**. **pip** is a tool for dependency management in Python. SDK expects the following from the client app.
- Client app must have Python(version 3 and above)
- Python SDK must be installed into client app through **pip**.
## Including the SDK in your project
- Install **Python** from [python.org](https://www.python.org/downloads/) (if not installed).
- Install **Python SDK**
- Navigate to the workspace of your client app.
- Run the command below:
```sh
pip install zohocrmsdk2_1==1.x.x
```
- The Python SDK will be installed in your client application.
## Token Persistence
Token persistence refers to storing and utilizing the authentication tokens that are provided by Zoho. There are three ways provided by the SDK in which persistence can be utilized. They are DataBase Persistence, File Persistence and Custom Persistence.
### Table of Contents
- [DataBase Persistence](#database-persistence)
- [File Persistence](#file-persistence)
- [Custom Persistence](#custom-persistence)
### Implementing OAuth Persistence
Once the application is authorized, OAuth access and refresh tokens can be used for subsequent user data requests to Zoho CRM. Hence, they need to be persisted by the client app.
The persistence is achieved by writing an implementation of the inbuilt Abstract Base Class **[TokenStore](zcrmsdk/src/com/zoho/api/authenticator/store/token_store.py)**, which has the following callback methods.
- **get_token(self, user, [token](zcrmsdk/src/com/zoho/api/authenticator/token.py))** - invoked before firing a request to fetch the saved tokens. This method should return implementation of inbuilt **Token Class** object for the library to process it.
- **save_token(self, user, [token](zcrmsdk/src/com/zoho/api/authenticator/token.py))** - invoked after fetching access and refresh tokens from Zoho.
- **delete_token(self, [token](zcrmsdk/src/com/zoho/api/authenticator/token.py))** - invoked before saving the latest tokens.
- **get_tokens(self)** - The method to get the all the stored tokens.
- **delete_tokens(self)** - The method to delete all the stored tokens.
- **get_token_by_id(self, id, token)** - The method to retrieve the user's token details based on unique ID.
Note:
- user is an instance of UserSignature Class.
- token is an instance of Token Class.
### DataBase Persistence
In case the user prefers to use default DataBase persistence, **MySQL** can be used.
- The database name should be **zohooauth**.
- There must be a table name **oauthtoken** with the following columns.
- id int(11)
- user_mail varchar(255)
- client_id varchar(255)
- client_secret varchar(255)
- refresh_token varchar(255)
- access_token varchar(255)
- grant_token varchar(255)
- expiry_time varchar(20)
- redirect_url varchar(255)
Note:
- Custom database name and table name can be set in DBStore instance.
#### MySQL Query
```sql
CREATE TABLE oauthtoken (
id varchar(255) NOT NULL,
user_mail varchar(255) NOT NULL,
client_id varchar(255),
client_secret varchar(255),
refresh_token varchar(255),
access_token varchar(255),
grant_token varchar(255),
expiry_time varchar(20),
redirect_url varchar(255),
primary key (id)
)
```
#### Create DBStore object
```python
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore
"""
DBStore takes the following parameters
1 -> DataBase host name. Default value "localhost"
2 -> DataBase name. Default value "zohooauth"
3 -> DataBase user name. Default value "root"
4 -> DataBase password. Default value ""
5 -> DataBase port number. Default value "3306"
6-> DataBase table name . Default value "oauthtoken"
"""
store = DBStore()
store = DBStore(host='host_name', database_name='database_name', user_name='user_name', password='password', port_number='port_number', table_name = "table_name")
```
### File Persistence
In case of File Persistence, the user can persist tokens in the local drive, by providing the absolute file path to the FileStore object.
- The File contains
- id
- user_mail
- client_id
- client_secret
- refresh_token
- access_token
- grant_token
- expiry_time
- redirect_url
#### Create FileStore object
```python
from zcrmsdk.src.com.zoho.api.authenticator.store import FileStore
"""
FileStore takes the following parameter
1 -> Absolute file path of the file to persist tokens
"""
store = FileStore(file_path='/Users/username/Documents/python_sdk_token.txt')
```
### Custom Persistence
To use Custom Persistence, you must implement **[TokenStore](zcrmsdk/src/com/zoho/api/authenticator/store/token_store.py)** and override the methods.
```python
from zcrmsdk.src.com.zoho.api.authenticator.store import TokenStore
class CustomStore(TokenStore):
def __init__(self):
pass
def get_token(self, user, token):
"""
Parameters:
user (UserSignature) : A UserSignature class instance.
token (Token) : A Token (zcrmsdk.src.com.zoho.api.authenticator.OAuthToken) class instance
"""
# Add code to get the token
return None
def save_token(self, user, token):
"""
Parameters:
user (UserSignature) : A UserSignature class instance.
token (Token) : A Token (zcrmsdk.src.com.zoho.api.authenticator.OAuthToken) class instance
"""
# Add code to save the token
def delete_token(self, token):
"""
Parameters:
token (Token) : A Token (zcrmsdk.src.com.zoho.api.authenticator.OAuthToken) class instance
"""
# Add code to delete the token
def get_tokens(self):
"""
Returns:
list: List of stored tokens
"""
# Add code to get all the stored tokens
def delete_tokens(self):
# Add code to delete all the stored tokens
def get_token_by_id(id, token):
"""
The method to get id token details.
Parameters:
id (String) : A String id.
token (Token) : A Token class instance.
Returns:
Token : A Token class instance representing the id token details.
"""
```
## Configuration
Before you get started with creating your Python application, you need to register your client and authenticate the app with Zoho.
| Mandatory Keys | Optional Keys |
| :---------------- | :------------ |
| user | logger |
| environment | store |
| token | sdk_config |
| | proxy |
| | resource_path |
----
- Create an instance of **UserSignature** Class that identifies the current user.
```python
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
# Create an UserSignature instance that takes user Email as parameter
user = UserSignature(email='[email protected]')
```
- Configure the API environment which decides the domain and the URL to make API calls.
```python
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter
"""
Configure the environment
which is of the pattern Domain.Environment
Available Domains: USDataCenter, EUDataCenter, INDataCenter, CNDataCenter, AUDataCenter
Available Environments: PRODUCTION(), DEVELOPER(), SANDBOX()
"""
environment = USDataCenter.PRODUCTION()
```
- Create an instance of **OAuthToken** with the information that you get after registering your Zoho client.
```python
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
"""
Create a Token instance that takes the following parameters
1 -> OAuth client id.
2 -> OAuth client secret.
3 -> Grant token.
4 -> Refresh token.
5 -> OAuth redirect URL. Default value is None
6 -> id
7 -> Access token
"""
token = OAuthToken(client_id='clientId', client_secret='clientSecret', grant_token='grant_token', refresh_token="refresh_token", redirect_url='redirectURL', id="id", access_token="access_token")
```
- Create an instance of **Logger** Class to log exception and API information. By default, the SDK constructs a Logger instance with level - INFO and file_path - (sdk_logs.log, created in the current working directory)
```python
from zcrmsdk.src.com.zoho.api.logger import Logger
"""
Create an instance of Logger Class that takes two parameters
1 -> Level of the log messages to be logged. Can be configured by typing Logger.Levels "." and choose any level from the list displayed.
2 -> Absolute file path, where messages need to be logged.
"""
logger = Logger.get_instance(level=Logger.Levels.INFO, file_path="/Users/user_name/Documents/python_sdk_log.log")
```
- Create an instance of **TokenStore** to persist tokens, used for authenticating all the requests. By default, the SDK creates the sdk_tokens.txt created in the current working directory) to persist the tokens.
```python
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore, FileStore
"""
DBStore takes the following parameters
1 -> DataBase host name. Default value "localhost"
2 -> DataBase name. Default value "zohooauth"
3 -> DataBase user name. Default value "root"
4 -> DataBase password. Default value ""
5 -> DataBase port number. Default value "3306"
6 -> DataBase table name. Default value "oauthtoken"
"""
store = DBStore()
#store = DBStore(host='host_name', database_name='database_name', user_name='user_name', password='password', port_number='port_number', table_name = "table_name")
"""
FileStore takes the following parameter
1 -> Absolute file path of the file to persist tokens
"""
#store = FileStore(file_path='/Users/username/Documents/python_sdk_tokens.txt')
```
- Create an instance of SDKConfig containing SDK configurations.
```python
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
"""
By default, the SDK creates the SDKConfig instance
auto_refresh_fields (Default value is False)
if True - all the modules' fields will be auto-refreshed in the background, every hour.
if False - the fields will not be auto-refreshed in the background. The user can manually delete the file(s) or refresh the fields using methods from ModuleFieldsHandler(zcrmsdk/src/com/zoho/crm/api/util/module_fields_handler.py)
pick_list_validation (Default value is True)
A boolean field that validates user input for a pick list field and allows or disallows the addition of a new value to the list.
if True - the SDK validates the input. If the value does not exist in the pick list, the SDK throws an error.
if False - the SDK does not validate the input and makes the API request with the user’s input to the pick list
connect_timeout (Default value is None)
A Float field to set connect timeout
read_timeout (Default value is None)
A Float field to set read timeout
"""
config = SDKConfig(auto_refresh_fields=True, pick_list_validation=False, connect_timeout=None, read_timeout=None)
```
- The path containing the absolute directory path to store user specific files containing module fields information. By default, the SDK stores the user-specific files within a folder in the current working directory.
```python
resource_path = '/Users/user_name/Documents/python-app'
```
- Create an instance of RequestProxy containing the proxy properties of the user.
```python
from zcrmsdk.src.com.zoho.crm.api.request_proxy import RequestProxy
"""
RequestProxy takes the following parameters
1 -> Host
2 -> Port Number
3 -> User Name. Default value is None
4 -> Password. Default value is an empty string
"""
request_proxy = RequestProxy(host='proxyHost', port=80)
request_proxy = RequestProxy(host='proxyHost', port=80, user='userName', password='password')
```
## Initializing the Application
Initialize the SDK using the following code.
```python
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore, FileStore
from zcrmsdk.src.com.zoho.api.logger import Logger
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
class SDKInitializer(object):
@staticmethod
def initialize():
"""
Create an instance of Logger Class that takes two parameters
1 -> Level of the log messages to be logged. Can be configured by typing Logger.Levels "." and choose any level from the list displayed.
2 -> Absolute file path, where messages need to be logged.
"""
logger = Logger.get_instance(level=Logger.Levels.INFO, file_path='/Users/user_name/Documents/python_sdk_log.log')
# Create an UserSignature instance that takes user Email as parameter
user = UserSignature(email='[email protected]')
"""
Configure the environment
which is of the pattern Domain.Environment
Available Domains: USDataCenter, EUDataCenter, INDataCenter, CNDataCenter, AUDataCenter
Available Environments: PRODUCTION(), DEVELOPER(), SANDBOX()
"""
environment = USDataCenter.PRODUCTION()
"""
Create a Token instance that takes the following parameters
1 -> OAuth client id.
2 -> OAuth client secret.
3 -> Grant token.
4 -> Refresh token.
5 -> OAuth redirect URL.
6 -> id
"""
token = OAuthToken(client_id='clientId', client_secret='clientSecret', grant_token='grant_token', refresh_token="refresh_token", redirect_url='redirectURL', id="id")
"""
Create an instance of TokenStore
1 -> Absolute file path of the file to persist tokens
"""
store = FileStore(file_path='/Users/username/Documents/python_sdk_tokens.txt')
"""
Create an instance of TokenStore
1 -> DataBase host name. Default value "localhost"
2 -> DataBase name. Default value "zohooauth"
3 -> DataBase user name. Default value "root"
4 -> DataBase password. Default value ""
5 -> DataBase port number. Default value "3306"
6-> DataBase table name . Default value "oauthtoken"
"""
store = DBStore()
store = DBStore(host='host_name', database_name='database_name', user_name='user_name', password='password',port_number='port_number', table_name = "table_name")
"""
auto_refresh_fields (Default value is False)
if True - all the modules' fields will be auto-refreshed in the background, every hour.
if False - the fields will not be auto-refreshed in the background. The user can manually delete the file(s) or refresh the fields using methods from ModuleFieldsHandler(zcrmsdk/src/com/zoho/crm/api/util/module_fields_handler.py)
pick_list_validation (Default value is True)
A boolean field that validates user input for a pick list field and allows or disallows the addition of a new value to the list.
if True - the SDK validates the input. If the value does not exist in the pick list, the SDK throws an error.
if False - the SDK does not validate the input and makes the API request with the user’s input to the pick list
connect_timeout (Default value is None)
A Float field to set connect timeout
read_timeout (Default value is None)
A Float field to set read timeout
"""
config = SDKConfig(auto_refresh_fields=True, pick_list_validation=False, connect_timeout=None, read_timeout=None)
"""
The path containing the absolute directory path (in the key resource_path) to store user-specific files containing information about fields in modules.
"""
resource_path = '/Users/user_name/Documents/python-app'
"""
Create an instance of RequestProxy class that takes the following parameters
1 -> Host
2 -> Port Number
3 -> User Name. Default value is None
4 -> Password. Default value is None
"""
request_proxy = RequestProxy(host='host', port=8080)
request_proxy = RequestProxy(host='host', port=8080, user='user', password='password')
"""
Call the static initialize method of Initializer class that takes the following arguments
1 -> UserSignature instance
2 -> Environment instance
3 -> Token instance
4 -> TokenStore instance
5 -> SDKConfig instance
6 -> resource_path
7 -> Logger instance. Default value is None
8 -> RequestProxy instance. Default value is None
"""
Initializer.initialize(user=user, environment=environment, token=token, store=store, sdk_config=config, resource_path=resource_path, logger=logger, proxy=request_proxy)
SDKInitializer.initialize()
```
- You can now access the functionalities of the SDK. Refer to the sample codes to make various API calls through the SDK.
## Class Hierarchy

## Responses and Exceptions
All SDK methods return an instance of the APIResponse class.
After a successful API request, the **get_object()** method returns an instance of the **ResponseWrapper** (for **GET**) or the **ActionWrapper** (for **POST, PUT, DELETE**)
Whenever the API returns an error response, the **get_object()** returns an instance of **APIException** class.
**ResponseWrapper** (for **GET** requests) and **ActionWrapper** (for **POST, PUT, DELETE** requests) are the expected objects for Zoho CRM APIs’ responses
However, some specific operations have different expected objects, such as the following:
- Operations involving records in Tags
- **RecordActionWrapper**
- Getting Record Count for a specific Tag operation
- **CountWrapper**
- Operations involving BaseCurrency
- **BaseCurrencyActionWrapper**
- Lead convert operation
- **ConvertActionWrapper**
- Retrieving Deleted records operation
- **DeletedRecordsWrapper**
- Record image download operation
- **FileBodyWrapper**
- MassUpdate record operations
- **MassUpdateActionWrapper**
- **MassUpdateResponseWrapper**
### GET Requests
- The **get_object()** returns an instance of one of the following classes, based on the return type.
- For **application/json** responses
- **ResponseWrapper**
- **CountWrapper**
- **DeletedRecordsWrapper**
- **MassUpdateResponseWrapper**
- **APIException**
- For **file download** responses
- **FileBodyWrapper**
- **APIException**
### POST, PUT, DELETE Requests
- The **getObject()** returns an instance of one of the following classes
- **ActionWrapper**
- **RecordActionWrapper**
- **BaseCurrencyActionWrapper**
- **MassUpdateActionWrapper**
- **ConvertActionWrapper**
- **APIException**
- These wrapper classes may contain one or a list of instances of the following classes, depending on the response.
- **SuccessResponse Class**, if the request was successful.
- **APIException Class**, if the request was erroneous.
For example, when you insert two records, and one of them was inserted successfully while the other one failed, the ActionWrapper will contain one instance each of the SuccessResponse and APIException classes.
All other exceptions such as SDK anomalies and other unexpected behaviours are thrown under the SDKException class.
## Threading in the Python SDK
Threads in a Python program help you achieve parallelism. By using multiple threads, you can make a Python program run faster and do multiple things simultaneously.
The **Python SDK** (from version 3.x.x) supports both single-user and multi-user app.
### Multithreading in a Multi-user App
Multi-threading for multi-users is achieved using Initializer's static **switch_user()** method.
switch_user() takes the value initialized previously for user, enviroment, token and sdk_config incase None is passed (or default value is passed). In case of request_proxy, if intended, the value has to be passed again else None(default value) will be taken.
```python
# without proxy
Initializer.switch_user(user=user, environment=environment, token=token, sdk_config=sdk_config_instance)
# with proxy
Initializer.switch_user(user=user, environment=environment, token=token, sdk_config=sdk_config_instance, proxy=request_proxy)
```
Here is a sample code to depict multi-threading for a multi-user app.
```python
import threading
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter, EUDataCenter
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore
from zcrmsdk.src.com.zoho.api.logger import Logger
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.crm.api.record import *
from zcrmsdk.src.com.zoho.crm.api.request_proxy import RequestProxy
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
class MultiThread(threading.Thread):
def __init__(self, environment, token, user, module_api_name, sdk_config, proxy=None):
super().__init__()
self.environment = environment
self.token = token
self.user = user
self.module_api_name = module_api_name
self.sdk_config = sdk_config
self.proxy = proxy
def run(self):
try:
Initializer.switch_user(user=self.user, environment=self.environment, token=self.token, sdk_config=self.sdk_config, proxy=self.proxy)
print('Getting records for User: ' + Initializer.get_initializer().user.get_email())
response = RecordOperations().get_records(self.module_api_name)
if response is not None:
# Get the status code from response
print('Status Code: ' + str(response.get_status_code()))
if response.get_status_code() in [204, 304]:
print('No Content' if response.get_status_code() == 204 else 'Not Modified')
return
# Get object from response
response_object = response.get_object()
if response_object is not None:
# Check if expected ResponseWrapper instance is received.
if isinstance(response_object, ResponseWrapper):
# Get the list of obtained Record instances
record_list = response_object.get_data()
for record in record_list:
for key, value in record.get_key_values().items():
print(key + " : " + str(value))
# Check if the request returned an exception
elif isinstance(response_object, APIException):
# Get the Status
print("Status: " + response_object.get_status().get_value())
# Get the Code
print("Code: " + response_object.get_code().get_value())
print("Details")
# Get the details dict
details = response_object.get_details()
for key, value in details.items():
print(key + ' : ' + str(value))
# Get the Message
print("Message: " + response_object.get_message().get_value())
except Exception as e:
print(e)
@staticmethod
def call():
logger = Logger.get_instance(level=Logger.Levels.INFO, file_path="/Users/user_name/Documents/python_sdk_log.log")
user1 = UserSignature(email="[email protected]")
token1 = OAuthToken(client_id="clientId1", client_secret="clientSecret1", grant_token="Grant Token", refresh_token="refresh_token", id="id")
environment1 = USDataCenter.PRODUCTION()
store = DBStore()
sdk_config_1 = SDKConfig(auto_refresh_fields=True, pick_list_validation=False)
resource_path = '/Users/user_name/Documents/python-app'
user1_module_api_name = 'Leads'
user2_module_api_name = 'Contacts'
environment2 = EUDataCenter.SANDBOX()
user2 = UserSignature(email="[email protected]")
sdk_config_2 = SDKConfig(auto_refresh_fields=False, pick_list_validation=True)
token2 = OAuthToken(client_id="clientId2", client_secret="clientSecret2",grant_token="GRANT Token", refresh_token="refresh_token", redirect_url="redirectURL", id="id")
request_proxy_user_2 = RequestProxy("host", 8080)
Initializer.initialize(user=user1, environment=environment1, token=token1, store=store, sdk_config=sdk_config_1, resource_path=resource_path, logger=logger)
t1 = MultiThread(environment1, token1, user1, user1_module_api_name, sdk_config_1)
t2 = MultiThread(environment2, token2, user2, user2_module_api_name, sdk_config_2, request_proxy_user_2)
t1.start()
t2.start()
t1.join()
t2.join()
MultiThread.call()
```
- The program execution starts from **call()**.
- The details of **user1** are given in the variables user1, token1, environment1.
- Similarly, the details of another user **user2** are given in the variables user2, token2, environment2.
- For each user, an instance of **MultiThread class** is created.
- When the **start()** is called which in-turn invokes the **run()**, the details of user1 are passed to the **switch_user** method through the **MultiThread object**. Therefore, this creates a thread for user1.
- Similarly, When the **start()** is invoked again, the details of user2 are passed to the **switch_user** function through the **MultiThread object**. Therefore, this creates a thread for user2.
### Multi-threading in a Single User App
Here is a sample code to depict multi-threading for a single-user app.
```python
import threading
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore
from zcrmsdk.src.com.zoho.api.logger import Logger
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
from zcrmsdk.src.com.zoho.crm.api.record import *
class MultiThread(threading.Thread):
def __init__(self, module_api_name):
super().__init__()
self.module_api_name = module_api_name
def run(self):
try:
print("Calling Get Records for module: " + self.module_api_name)
response = RecordOperations().get_records(self.module_api_name)
if response is not None:
# Get the status code from response
print('Status Code: ' + str(response.get_status_code()))
if response.get_status_code() in [204, 304]:
print('No Content' if response.get_status_code() == 204 else 'Not Modified')
return
# Get object from response
response_object = response.get_object()
if response_object is not None:
# Check if expected ResponseWrapper instance is received.
if isinstance(response_object, ResponseWrapper):
# Get the list of obtained Record instances
record_list = response_object.get_data()
for record in record_list:
for key, value in record.get_key_values().items():
print(key + " : " + str(value))
# Check if the request returned an exception
elif isinstance(response_object, APIException):
# Get the Status
print("Status: " + response_object.get_status().get_value())
# Get the Code
print("Code: " + response_object.get_code().get_value())
print("Details")
# Get the details dict
details = response_object.get_details()
for key, value in details.items():
print(key + ' : ' + str(value))
# Get the Message
print("Message: " + response_object.get_message().get_value())
except Exception as e:
print(e)
@staticmethod
def call():
logger = Logger.get_instance(level=Logger.Levels.INFO, file_path="/Users/user_name/Documents/python_sdk_log.log")
user = UserSignature(email="[email protected]")
token = OAuthToken(client_id="clientId", client_secret="clientSecret", grant_token="grant_token", refresh_token="refresh_token", redirect_url="redirectURL", id="id")
environment = USDataCenter.PRODUCTION()
store = DBStore()
sdk_config = SDKConfig()
resource_path = '/Users/user_name/Documents/python-app'
Initializer.initialize(user=user, environment=environment, token=token, store=store, sdk_config=sdk_config, resource_path=resource_path, logger=logger)
t1 = MultiThread('Leads')
t2 = MultiThread('Quotes')
t1.start()
t2.start()
t1.join()
t2.join()
MultiThread.call()
```
- The program execution starts from **call()** where the SDK is initialized with the details of the user.
- When the **start()** is called which in-turn invokes the run(), the module_api_name is switched through the MultiThread object. Therefore, this creates a thread for the particular MultiThread instance.
## SDK Sample code
```python
from datetime import datetime
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore
from zcrmsdk.src.com.zoho.api.logger import Logger
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.crm.api.record import *
from zcrmsdk.src.com.zoho.crm.api import HeaderMap, ParameterMap
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
class Record(object):
def __init__(self):
pass
@staticmethod
def get_records():
"""
Create an instance of Logger Class that takes two parameters
1 -> Level of the log messages to be logged. Can be configured by typing Logger.Levels "." and choose any level from the list displayed.
2 -> Absolute file path, where messages need to be logged.
"""
logger = Logger.get_instance(level=Logger.Levels.INFO,
file_path="/Users/user_name/Documents/python_sdk_log.log")
# Create an UserSignature instance that takes user Email as parameter
user = UserSignature(email="[email protected]")
"""
Configure the environment
which is of the pattern Domain.Environment
Available Domains: USDataCenter, EUDataCenter, INDataCenter, CNDataCenter, AUDataCenter
Available Environments: PRODUCTION(), DEVELOPER(), SANDBOX()
"""
environment = USDataCenter.PRODUCTION()
"""
Create a Token instance that takes the following parameters
1 -> OAuth client id.
2 -> OAuth client secret.
3 -> Grant token.
4 -> Refresh token.
5 -> OAuth redirect URL.
6 -> id
"""
token = OAuthToken(client_id="clientId", client_secret="clientSecret", grant_token="grant_token", refresh_token="refresh_token", redirect_url="redirectURL", id="id")
"""
Create an instance of TokenStore
1 -> DataBase host name. Default value "localhost"
2 -> DataBase name. Default value "zohooauth"
3 -> DataBase user name. Default value "root"
4 -> DataBase password. Default value ""
5 -> DataBase port number. Default value "3306"
6-> DataBase table name . Default value "oauthtoken"
"""
store = DBStore()
"""
auto_refresh_fields (Default value is False)
if True - all the modules' fields will be auto-refreshed in the background, every hour.
if False - the fields will not be auto-refreshed in the background. The user can manually delete the file(s) or refresh the fields using methods from ModuleFieldsHandler(zcrmsdk/src/com/zoho/crm/api/util/module_fields_handler.py)
pick_list_validation (Default value is True)
A boolean field that validates user input for a pick list field and allows or disallows the addition of a new value to the list.
if True - the SDK validates the input. If the value does not exist in the pick list, the SDK throws an error.
if False - the SDK does not validate the input and makes the API request with the user’s input to the pick list
connect_timeout (Default value is None)
A Float field to set connect timeout
read_timeout (Default value is None)
A Float field to set read timeout
"""
config = SDKConfig(auto_refresh_fields=True, pick_list_validation=False, connect_timeout=None, read_timeout=None)
"""
The path containing the absolute directory path (in the key resource_path) to store user-specific files containing information about fields in modules.
"""
resource_path = '/Users/user_name/Documents/python-app'
"""
Call the static initialize method of Initializer class that takes the following arguments
1 -> UserSignature instance
2 -> Environment instance
3 -> Token instance
4 -> TokenStore instance
5 -> SDKConfig instance
6 -> resource_path
7 -> Logger instance
"""
Initializer.initialize(user=user, environment=environment, token=token, store=store, sdk_config=config, resource_path=resource_path, logger=logger)
try:
module_api_name = 'Leads'
param_instance = ParameterMap()
param_instance.add(GetRecordsParam.converted, 'both')
param_instance.add(GetRecordsParam.cvid, '12712717217218')
header_instance = HeaderMap()
header_instance.add(GetRecordsHeader.if_modified_since, datetime.now())
response = RecordOperations().get_records(module_api_name, param_instance, header_instance)
if response is not None:
# Get the status code from response
print('Status Code: ' + str(response.get_status_code()))
if response.get_status_code() in [204, 304]:
print('No Content' if response.get_status_code() == 204 else 'Not Modified')
return
# Get object from response
response_object = response.get_object()
if response_object is not None:
# Check if expected ResponseWrapper instance is received.
if isinstance(response_object, ResponseWrapper):
# Get the list of obtained Record instances
record_list = response_object.get_data()
for record in record_list:
# Get the ID of each Record
print("Record ID: " + record.get_id())
# Get the createdBy User instance of each Record
created_by = record.get_created_by()
# Check if created_by is not None
if created_by is not None:
# Get the Name of the created_by User
print("Record Created By - Name: " + created_by.get_name())
# Get the ID of the created_by User
print("Record Created By - ID: " + created_by.get_id())
# Get the Email of the created_by User
print("Record Created By - Email: " + created_by.get_email())
# Get the CreatedTime of each Record
print("Record CreatedTime: " + str(record.get_created_time()))
if record.get_modified_time() is not None:
# Get the ModifiedTime of each Record
print("Record ModifiedTime: " + str(record.get_modified_time()))
# Get the modified_by User instance of each Record
modified_by = record.get_modified_by()
# Check if modified_by is not None
if modified_by is not None:
# Get the Name of the modified_by User
print("Record Modified By - Name: " + modified_by.get_name())
# Get the ID of the modified_by User
print("Record Modified By - ID: " + modified_by.get_id())
# Get the Email of the modified_by User
print("Record Modified By - Email: " + modified_by.get_email())
# Get the list of obtained Tag instance of each Record
tags = record.get_tag()
if tags is not None:
for tag in tags:
# Get the Name of each Tag
print("Record Tag Name: " + tag.get_name())
# Get the Id of each Tag
print("Record Tag ID: " + tag.get_id())
# To get particular field value
print("Record Field Value: " + str(record.get_key_value('Last_Name')))
print('Record KeyValues: ')
for key, value in record.get_key_values().items():
print(key + " : " + str(value))
# Check if the request returned an exception
elif isinstance(response_object, APIException):
# Get the Status
print("Status: " + response_object.get_status().get_value())
# Get the Code
print("Code: " + response_object.get_code().get_value())
print("Details")
# Get the details dict
details = response_object.get_details()
for key, value in details.items():
print(key + ' : ' + str(value))
# Get the Message
print("Message: " + response_object.get_message().get_value())
except Exception as e:
print(e)
Record.get_records()
```
| zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/README.md | README.md |
try:
import threading
import logging
import enum
import json
import time
import requests
from .token import Token
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from ...crm.api.util import APIHTTPConnector
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from ...crm.api.util.constants import Constants
except Exception as e:
import threading
import logging
import enum
import json
import time
import requests
from .token import Token
from zcrmsdk.src.com.zoho.crm.api.initializer import Initializer
from ...crm.api.util import APIHTTPConnector
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from ...crm.api.util.constants import Constants
class OAuthToken(Token):
"""
This class maintains the tokens and authenticates every request.
"""
logger = logging.getLogger('SDKLogger')
lock = threading.Lock()
def __init__(self, client_id=None, client_secret=None, grant_token=None, refresh_token=None, redirect_url=None, id=None, access_token=None):
"""
Creates an OAuthToken class instance with the specified parameters.
Parameters:
client_id (str) : A string containing the OAuth client id.
client_secret (str) : A string containing the OAuth client secret.
grant_token (str) : A string containing the GRANT token.
refresh_token (str) : A string containing the REFRESH token.
redirect_url (str) : A string containing the OAuth redirect URL. Default value is None
id (str) : A string containing the Id. Default value is None
"""
error = {}
if grant_token is None and refresh_token is None and id is None and access_token is None:
raise SDKException(code=Constants.MANDATORY_VALUE_ERROR, message=Constants.MANDATORY_KEY_ERROR, details=Constants.OAUTH_MANDATORY_KEYS)
if id is None and access_token is None:
if not isinstance(client_id, str):
error[Constants.FIELD] = Constants.CLIENT_ID
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if not isinstance(client_secret, str):
error[Constants.FIELD] = Constants.CLIENT_SECRET
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if grant_token is not None and not isinstance(grant_token, str):
error[Constants.FIELD] = Constants.GRANT_TOKEN
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if refresh_token is not None and not isinstance(refresh_token, str):
error[Constants.FIELD] = Constants.REFRESH_TOKEN
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if redirect_url is not None and not isinstance(redirect_url, str):
error[Constants.FIELD] = Constants.REDIRECT_URI
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if id is not None and not isinstance(id, str):
error[Constants.FIELD] = Constants.ID
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
if access_token is not None and not isinstance(access_token, str):
error[Constants.FIELD] = Constants.ACCESS_TOKEN
error[Constants.EXPECTED_TYPE] = Constants.STRING
error[Constants.CLASS] = OAuthToken.__name__
raise SDKException(code=Constants.TOKEN_ERROR, details=error)
self.__client_id = client_id
self.__client_secret = client_secret
self.__redirect_url = redirect_url
self.__grant_token = grant_token
self.__refresh_token = refresh_token
self.__id = id
self.__access_token = access_token
self.__expires_in = None
self.__user_mail = None
def get_client_id(self):
"""
This is a getter method to get __client_id.
Returns:
string: A string representing __client_id
"""
return self.__client_id
def get_client_secret(self):
"""
This is a getter method to get __client_secret.
Returns:
string: A string representing __client_secret
"""
return self.__client_secret
def get_redirect_url(self):
"""
This is a getter method to get __redirect_url.
Returns:
string: A string representing __redirect_url
"""
return self.__redirect_url
def get_grant_token(self):
"""
This is a getter method to get __grant_token.
Returns:
string: A string representing __grant_token
"""
return self.__grant_token
def get_refresh_token(self):
"""
This is a getter method to get __refresh_token.
Returns:
string: A string representing __refresh_token
"""
return self.__refresh_token
def get_access_token(self):
"""
This is a getter method to get __access_token.
Returns:
string: A string representing __access_token
"""
return self.__access_token
def get_id(self):
"""
This is a getter method to get __id.
Returns:
string: A string representing __id
"""
return self.__id
def get_expires_in(self):
"""
This is a getter method to get __expires_in.
Returns:
string: A string representing __expires_in
"""
return self.__expires_in
def get_user_mail(self):
"""
This is a getter method to get __user_mail.
Returns:
string: A string representing __user_mail
"""
return self.__user_mail
def set_grant_token(self, grant_token):
"""
This is a setter method to set __grant_token.
"""
self.__grant_token = grant_token
def set_refresh_token(self, refresh_token):
"""
This is a setter method to set __refresh_token.
"""
self.__refresh_token = refresh_token
def set_redirect_url(self, redirect_url):
"""
This is a setter method to set __redirect_url.
"""
self.__redirect_url = redirect_url
def set_access_token(self, access_token):
"""
This is a setter method to set __access_token.
"""
self.__access_token = access_token
def set_client_id(self, client_id):
"""
This is a setter method to set __client_id.
"""
self.__client_id = client_id
def set_client_secret(self, client_secret):
"""
This is a setter method to set __client_secret.
"""
self.__client_secret = client_secret
def set_id(self, id):
"""
This is a setter method to set __id.
"""
self.__id = id
def set_expires_in(self, expires_in):
"""
This is a setter method to set __expires_in.
"""
self.__expires_in = expires_in
def set_user_mail(self, user_mail):
"""
This is a setter method to set __user_mail.
"""
self.__user_mail = user_mail
def authenticate(self, url_connection):
with OAuthToken.lock:
initializer = Initializer.get_initializer()
store = initializer.store
user = initializer.user
if self.__access_token is None:
if self.__id is not None:
oauth_token = initializer.store.get_token_by_id(self.__id, self)
else:
oauth_token = initializer.store.get_token(user, self)
else:
oauth_token = self
if oauth_token is None:
token = self.generate_access_token(user, store).get_access_token() if (
self.__refresh_token is None) else self.refresh_access_token(user, store).get_access_token()
elif oauth_token.get_expires_in() is not None and int(oauth_token.get_expires_in()) - int(time.time() * 1000) < 5000:
OAuthToken.logger.info(Constants.REFRESH_TOKEN_MESSAGE)
token = oauth_token.refresh_access_token(user, store).get_access_token()
else:
token = oauth_token.get_access_token()
url_connection.add_header(Constants.AUTHORIZATION, Constants.OAUTH_HEADER_PREFIX + token)
def refresh_access_token(self, user, store):
try:
url = Initializer.get_initializer().environment.accounts_url
body = {
Constants.REFRESH_TOKEN: self.__refresh_token,
Constants.CLIENT_ID: self.__client_id,
Constants.CLIENT_SECRET: self.__client_secret,
Constants.GRANT_TYPE: Constants.REFRESH_TOKEN
}
response = requests.post(url, data=body, params=None, headers=None, allow_redirects=False).json()
self.parse_response(response)
if self.__id is None:
self.generate_id()
store.save_token(user, self)
except SDKException as ex:
raise ex
except Exception as ex:
raise SDKException(code=Constants.SAVE_TOKEN_ERROR, cause=ex)
return self
def generate_access_token(self, user, store):
try:
url = Initializer.get_initializer().environment.accounts_url
body = {
Constants.CLIENT_ID: self.__client_id,
Constants.CLIENT_SECRET: self.__client_secret,
Constants.REDIRECT_URI: self.__redirect_url if self.__redirect_url is not None else None,
Constants.GRANT_TYPE: Constants.GRANT_TYPE_AUTH_CODE,
Constants.CODE: self.__grant_token
}
headers = dict()
headers[Constants.USER_AGENT_KEY] = Constants.USER_AGENT
response = requests.post(url, data=body, params=None, headers=headers, allow_redirects=True).json()
self.parse_response(response)
self.generate_id()
store.save_token(user, self)
except SDKException as ex:
raise ex
except Exception as ex:
raise SDKException(code=Constants.SAVE_TOKEN_ERROR, cause=ex)
return self
def parse_response(self, response):
response_json = dict(response)
if Constants.ACCESS_TOKEN not in response_json:
raise SDKException(code=Constants.INVALID_TOKEN_ERROR, message=str(response_json.get(Constants.ERROR_KEY))if Constants.ERROR_KEY in response_json else Constants.NO_ACCESS_TOKEN_ERROR)
self.__access_token = response_json.get(Constants.ACCESS_TOKEN)
self.__expires_in = str(int(time.time() * 1000) + self.get_token_expires_in(response=response_json))
if Constants.REFRESH_TOKEN in response_json:
self.__refresh_token = response_json.get(Constants.REFRESH_TOKEN)
return self
@staticmethod
def get_token_expires_in(response):
return int(response[Constants.EXPIRES_IN]) if Constants.EXPIRES_IN_SEC in response else int(
response[Constants.EXPIRES_IN]) * 1000
def generate_id(self):
id = ""
email = str(Initializer.get_initializer().user.get_email())
environment = str(Initializer.get_initializer().environment.name)
id += Constants.PYTHON + email[0:email.find(Constants.AT)] + Constants.UNDERSCORE
id += environment + Constants.UNDERSCORE + self.__refresh_token[len(self.__refresh_token)-4:]
self.__id = id
return self.__id
def remove(self):
try:
Initializer.get_initializer().store.delete_token(self)
return True
except Exception:
return False | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/api/authenticator/oauth_token.py | oauth_token.py |
try:
import os
import csv
from zcrmsdk.src.com.zoho.api.authenticator.store.token_store import TokenStore
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from ....crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
except Exception as e:
import os
import csv
from .token_store import TokenStore
from ..oauth_token import OAuthToken
from ....crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
class FileStore(TokenStore):
"""
The class to store user token details to the file.
"""
def __init__(self, file_path):
"""
Creates an FileStore class instance with the specified parameters.
Parameters:
file_path (str) : A string containing the absolute file path of the file to store tokens
"""
self.file_path = file_path
self.headers = [Constants.ID, Constants.USER_MAIL, Constants.CLIENT_ID, Constants.CLIENT_SECRET, Constants.REFRESH_TOKEN, Constants.ACCESS_TOKEN, Constants.GRANT_TOKEN, Constants.EXPIRY_TIME, Constants.REDIRECT_URI]
if (os.path.exists(file_path) and os.stat(file_path).st_size == 0) or not os.path.exists(file_path):
with open(self.file_path, mode='w') as token_file:
csv_writer = csv.writer(token_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_writer.writerow(self.headers)
def get_token(self, user, token):
try:
if isinstance(token, OAuthToken):
with open(self.file_path, mode='r') as f:
data = csv.reader(f, delimiter=',')
next(data, None)
for next_record in data:
if len(next_record) == 0:
continue
if self.check_token_exists(user.get_email(), token, next_record):
grant_token = next_record[6] if next_record[6] is not None and len(
next_record[6]) > 0 else None
redirect_url = next_record[8] if next_record[8] is not None and len(
next_record[8]) > 0 else None
oauthtoken = token
oauthtoken.set_id(next_record[0])
oauthtoken.set_user_mail(next_record[1])
oauthtoken.set_client_id(next_record[2])
oauthtoken.set_client_secret(next_record[3])
oauthtoken.set_refresh_token(next_record[4])
oauthtoken.set_access_token(next_record[5])
oauthtoken.set_grant_token(grant_token)
oauthtoken.set_expires_in(next_record[7])
oauthtoken.set_redirect_url(redirect_url)
return oauthtoken
except IOError as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKEN_FILE_ERROR, cause=ex)
return None
def save_token(self, user, token):
if isinstance(token, OAuthToken):
token.set_user_mail(user.get_email())
self.delete_token(token)
try:
with open(self.file_path, mode='a+') as f:
csv_writer = csv.writer(f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_writer.writerow([token.get_id(), user.get_email(), token.get_client_id(), token.get_client_secret(), token.get_refresh_token(), token.get_access_token(), token.get_grant_token(), token.get_expires_in(), token.get_redirect_url()])
except IOError as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.SAVE_TOKEN_FILE_ERROR, cause=ex)
def delete_token(self, token):
lines = list()
if isinstance(token, OAuthToken):
try:
with open(self.file_path, mode='r') as f:
data = csv.reader(f, delimiter=',')
for next_record in data:
if len(next_record) == 0:
continue
lines.append(next_record)
if self.check_token_exists(token.get_user_mail(), token, next_record):
lines.remove(next_record)
with open(self.file_path, mode='w') as f:
csv_writer = csv.writer(f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_writer.writerows(lines)
except IOError as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.DELETE_TOKEN_FILE_ERROR, cause=ex)
def get_tokens(self):
tokens = []
try:
with open(self.file_path, mode='r') as f:
data = csv.reader(f, delimiter=',')
next(data, None)
for next_record in data:
if len(next_record) == 0:
continue
grant_token = next_record[6] if next_record[6] is not None and len(
next_record[6]) > 0 else None
redirect_url = next_record[8] if next_record[8] is not None and len(
next_record[8]) > 0 else None
token = OAuthToken(client_id=next_record[2], client_secret=next_record[3], grant_token=grant_token, refresh_token=next_record[4])
token.set_id(next_record[0])
token.set_user_mail(next_record[1])
token.set_access_token(next_record[5])
token.set_expires_in(next_record[7])
token.set_redirect_url(redirect_url)
tokens.append(token)
return tokens
except Exception as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKENS_FILE_ERROR, cause=ex)
def delete_tokens(self):
try:
with open(self.file_path, mode='w') as token_file:
csv_writer = csv.writer(token_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csv_writer.writerow(self.headers)
except Exception as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.DELETE_TOKENS_FILE_ERROR, cause=ex)
def get_token_by_id(self, id, token):
try:
if isinstance(token, OAuthToken):
is_row_present = False
with open(self.file_path, mode='r') as f:
data = csv.reader(f, delimiter=',')
next(data, None)
for next_record in data:
if len(next_record) == 0:
continue
if next_record[0] == id:
is_row_present = True
grant_token = next_record[6] if next_record[6] is not None and len(
next_record[6]) > 0 else None
redirect_url = next_record[8] if next_record[8] is not None and len(
next_record[8]) > 0 else None
oauthtoken = token
oauthtoken.set_id(next_record[0])
oauthtoken.set_user_mail(next_record[1])
oauthtoken.set_client_id(next_record[2])
oauthtoken.set_client_secret(next_record[3])
oauthtoken.set_refresh_token(next_record[4])
oauthtoken.set_access_token(next_record[5])
oauthtoken.set_grant_token(grant_token)
oauthtoken.set_expires_in(next_record[7])
oauthtoken.set_redirect_url(redirect_url)
return oauthtoken
if not is_row_present:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKEN_BY_ID_FILE_ERROR)
except IOError as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKEN_BY_ID_FILE_ERROR, cause=ex)
return None
@staticmethod
def check_token_exists(email, token, row):
if email is None:
raise SDKException(Constants.USER_MAIL_NULL_ERROR, Constants.USER_MAIL_NULL_ERROR_MESSAGE)
client_id = token.get_client_id()
grant_token = token.get_grant_token()
refresh_token = token.get_refresh_token()
token_check = grant_token == row[6] if grant_token is not None else refresh_token == row[4]
if row[1] == email and row[2] == client_id and token_check:
return True
return False | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/api/authenticator/store/file_store.py | file_store.py |
try:
import mysql.connector
from mysql.connector import Error
from zcrmsdk.src.com.zoho.api.authenticator.store.token_store import TokenStore
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
except Exception as e:
import mysql.connector
from mysql.connector import Error
from .token_store import TokenStore
from ..oauth_token import OAuthToken
from ....crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
class DBStore(TokenStore):
"""
This class to store user token details to the MySQL DataBase.
"""
def __init__(self, host=Constants.MYSQL_HOST, database_name=Constants.MYSQL_DATABASE_NAME,
user_name=Constants.MYSQL_USER_NAME, password="", port_number=Constants.MYSQL_PORT_NUMBER,
table_name=Constants.MYSQL_TABLE_NAME):
"""
Creates a DBStore class instance with the specified parameters.
Parameters:
host (str) : A string containing the DataBase host name. Default value is localhost
database_name (str) : A string containing the DataBase name. Default value is zohooauth
user_name (str) : A string containing the DataBase user name. Default value is root
password (str) : A string containing the DataBase password. Default value is an empty string
port_number (str) : A string containing the DataBase port number. Default value is 3306
"""
self.__host = host
self.__database_name = database_name
self.__user_name = user_name
self.__password = password
self.__port_number = port_number
self.__table_name = table_name
def get_host(self):
"""
This is a getter method to get __host.
Returns:
string: A string representing __host
"""
return self.__host
def get_database_name(self):
"""
This is a getter method to get __database_name.
Returns:
string: A string representing __database_name
"""
return self.__database_name
def get_user_name(self):
"""
This is a getter method to get __user_name.
Returns:
string: A string representing __user_name
"""
return self.__user_name
def get_password(self):
"""
This is a getter method to get __password.
Returns:
string: A string representing __password
"""
return self.__password
def get_port_number(self):
"""
This is a getter method to get __port_number.
Returns:
string: A string representing __port_number
"""
return self.__port_number
def get_table_name(self):
"""
This is a getter method to get __table_name.
Returns:
string: A string representing __table_name
"""
return self.__table_name
def get_token(self, user, token):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
try:
if isinstance(token, OAuthToken):
cursor = connection.cursor()
query = self.construct_dbquery(user.get_email(), token, False)
cursor.execute(query)
result = cursor.fetchone()
if result is not None:
oauthtoken = token
oauthtoken.set_id(result[0])
oauthtoken.set_user_mail(result[1])
oauthtoken.set_client_id(result[2])
oauthtoken.set_client_secret(result[3])
oauthtoken.set_refresh_token(result[4])
oauthtoken.set_access_token(result[5])
oauthtoken.set_grant_token(result[6])
oauthtoken.set_expires_in(str(result[7]))
oauthtoken.set_redirect_url(result[8])
return oauthtoken
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKEN_DB_ERROR, cause=ex)
def save_token(self, user, token):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
try:
if isinstance(token, OAuthToken):
token.set_user_mail(user.get_email())
self.delete_token(token)
cursor = connection.cursor()
query = "insert into " + self.__table_name + " (id,user_mail,client_id,client_secret,refresh_token,access_token,grant_token,expiry_time,redirect_url) values (%s,%s,%s,%s,%s,%s,%s,%s,%s);"
val = (token.get_id(), user.get_email(), token.get_client_id(), token.get_client_secret(), token.get_refresh_token(), token.get_access_token(), token.get_grant_token(), token.get_expires_in(), token.get_redirect_url())
cursor.execute(query, val)
connection.commit()
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.SAVE_TOKEN_DB_ERROR, cause=ex)
def delete_token(self, token):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
try:
if isinstance(token, OAuthToken):
cursor = connection.cursor()
query = self.construct_dbquery(token.get_user_mail(), token, True)
cursor.execute(query)
connection.commit()
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.DELETE_TOKEN_DB_ERROR, cause=ex)
def get_tokens(self):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
tokens = []
try:
cursor = connection.cursor()
query = 'select * from ' + self.__table_name + ";"
cursor.execute(query)
results = cursor.fetchall()
for result in results:
token = OAuthToken(client_id=result[2], client_secret=result[3], refresh_token=result[4], grant_token=result[6])
token.set_id(result[0])
token.set_user_mail(result[1])
token.set_access_token(result[5])
token.set_expires_in(str(result[7]))
token.set_redirect_url(result[8])
tokens.append(token)
return tokens
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKENS_DB_ERROR, cause=ex)
def delete_tokens(self):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
try:
cursor = connection.cursor()
query = 'delete from ' + self.__table_name + ";"
cursor.execute(query)
connection.commit()
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.DELETE_TOKENS_DB_ERROR, cause=ex)
def get_token_by_id(self, id, token):
cursor = None
try:
connection = mysql.connector.connect(host=self.__host, database=self.__database_name, user=self.__user_name, password=self.__password, port=self.__port_number)
try:
if isinstance(token, OAuthToken):
query = "select * from " + self.__table_name + " where id='" + id + "'"
oauthtoken = token
cursor = connection.cursor()
cursor.execute(query)
results = cursor.fetchall()
for result in results:
if result[0] == id:
oauthtoken.set_id(result[0])
oauthtoken.set_user_mail(result[1])
oauthtoken.set_client_id(result[2])
oauthtoken.set_client_secret(result[3])
oauthtoken.set_refresh_token(result[4])
oauthtoken.set_access_token(result[5])
oauthtoken.set_grant_token(result[6])
oauthtoken.set_expires_in(str(result[7]))
oauthtoken.set_redirect_url(result[8])
return oauthtoken
except Error as ex:
raise ex
finally:
cursor.close() if cursor is not None else None
connection.close() if connection is not None else None
except Error as ex:
raise SDKException(code=Constants.TOKEN_STORE, message=Constants.GET_TOKEN_BY_ID_DB_ERROR, cause=ex)
def construct_dbquery(self, email, token, is_delete):
if email is None:
raise SDKException(Constants.USER_MAIL_NULL_ERROR, Constants.USER_MAIL_NULL_ERROR_MESSAGE)
query = "delete from " if is_delete is True else "select * from "
query += self.__table_name + " where user_mail ='" + email + "' and client_id='" + token.get_client_id() + "' and "
if token.get_grant_token() is not None:
query += "grant_token='" + token.get_grant_token() + "'"
else:
query += "refresh_token='" + token.get_refresh_token() + "'"
return query | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/api/authenticator/store/db_store.py | db_store.py |
try:
import logging
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
from ...crm.api.util.constants import Constants
except:
from ...crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
class Logger(object):
"""
This class represents the Logger level and the file path.
"""
def __init__(self, level, file_path=None):
self.__level = level
self.__file_path = file_path
def get_level(self):
"""
This is a getter method to get __level.
Returns:
string: A enum representing __level
"""
return self.__level
def get_file_path(self):
"""
This is a getter method to get __file_path.
Returns:
string: A string representing __file_path
"""
return self.__file_path
@staticmethod
def get_instance(level, file_path=None):
"""
Creates an Logger class instance with the specified log level and file path.
:param level: A Levels class instance containing the log level.
:param file_path: A str containing the log file path.
:return: A Logger class instance.
"""
return Logger(level=level, file_path=file_path)
import enum
class Levels(enum.Enum):
"""
This class represents the possible logger levels
"""
CRITICAL = logging.CRITICAL
ERROR = logging.ERROR
WARNING = logging.WARNING
INFO = logging.INFO
DEBUG = logging.DEBUG
NOTSET = logging.NOTSET
class SDKLogger(object):
"""
The class to initialize the SDK logger.
"""
def __init__(self, logger_instance):
logger = logging.getLogger('SDKLogger')
logger_level = logger_instance.get_level()
logger_file_path = logger_instance.get_file_path()
if logger_level is not None and logger_level != logging.NOTSET and logger_file_path is not None and logger_file_path != "":
file_handler = logging.FileHandler(logger_file_path)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(module)s - %(filename)s - %(funcName)s - %(lineno)d - %(message)s')
file_handler.setLevel(logger_level.name)
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
if logger_level is not None and Constants.LOGGER_LEVELS.__contains__(logger_level.name):
logger.setLevel(logger_level.name)
@staticmethod
def initialize(logger_instance):
try:
SDKLogger(logger_instance=logger_instance)
except Exception as ex:
raise SDKException(message=Constants.LOGGER_INITIALIZATION_ERROR, Exception=ex) | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/api/logger/logger.py | logger.py |
try:
import logging
import os
import json
import threading
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.api.authenticator.store.token_store import TokenStore
from zcrmsdk.src.com.zoho.crm.api.exception.sdk_exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.dc.data_center import DataCenter
from zcrmsdk.src.com.zoho.crm.api.util.constants import Constants
from zcrmsdk.src.com.zoho.api.authenticator.token import Token
from zcrmsdk.src.com.zoho.api.logger import Logger, SDKLogger
from zcrmsdk.src.com.zoho.crm.api.request_proxy import RequestProxy
from zcrmsdk.src.com.zoho.crm.api.sdk_config import SDKConfig
except Exception:
import logging
import os
import json
import threading
from ..api.user_signature import UserSignature
from ...api.authenticator.store.token_store import TokenStore
from ..api.exception import SDKException
from ..api.dc.data_center import DataCenter
from ..api.util.constants import Constants
from ...api.authenticator.token import Token
from ...api.logger import Logger, SDKLogger
from .request_proxy import RequestProxy
from .sdk_config import SDKConfig
class Initializer(object):
"""
The class to initialize Zoho CRM SDK.
"""
def __init__(self):
self.environment = None
self.user = None
self.store = None
self.token = None
self.sdk_config = None
self.request_proxy = None
self.resource_path = None
json_details = None
initializer = None
LOCAL = threading.local()
LOCAL.init = None
@staticmethod
def initialize(user, environment, token, store=None, sdk_config=None, resource_path=None, logger=None, proxy=None):
"""
The method to initialize the SDK.
Parameters:
user (UserSignature) : A UserSignature class instance represents the CRM user
environment (DataCenter.Environment) : An Environment class instance containing the CRM API base URL and Accounts URL.
token (Token) : A Token class instance containing the OAuth client application information.
store (TokenStore) : A TokenStore class instance containing the token store information.
sdk_config (SDKConfig) : A SDKConfig class instance containing the configuration.
resource_path (str) : A String containing the absolute directory path to store user specific JSON files containing module fields information.
logger (Logger): A Logger class instance containing the log file path and Logger type.
proxy (RequestProxy) : A RequestProxy class instance containing the proxy properties of the user.
"""
try:
if not isinstance(user, UserSignature):
error = {Constants.FIELD: Constants.USER, Constants.EXPECTED_TYPE: UserSignature.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.USER_SIGNATURE_ERROR_MESSAGE, details=error)
if not isinstance(environment, DataCenter.Environment):
error = {Constants.FIELD: Constants.ENVIRONMENT,
Constants.EXPECTED_TYPE: DataCenter.Environment.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.ENVIRONMENT_ERROR_MESSAGE, details=error)
if not isinstance(token, Token):
error = {Constants.FIELD: Constants.TOKEN, Constants.EXPECTED_TYPE: Token.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.TOKEN_ERROR_MESSAGE, details=error)
if store is not None and not isinstance(store, TokenStore):
error = {Constants.FIELD: Constants.STORE, Constants.EXPECTED_TYPE: TokenStore.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.STORE_ERROR_MESSAGE, details=error)
if sdk_config is not None and not isinstance(sdk_config, SDKConfig):
error = {Constants.FIELD: Constants.SDK_CONFIG, Constants.EXPECTED_TYPE: SDKConfig.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.SDK_CONFIG_ERROR_MESSAGE, details=error)
if proxy is not None and not isinstance(proxy, RequestProxy):
error = {Constants.FIELD: Constants.USER_PROXY, Constants.EXPECTED_TYPE: RequestProxy.__module__}
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.REQUEST_PROXY_ERROR_MESSAGE, details=error)
if store is None:
try:
from zcrmsdk.src.com.zoho.api.authenticator.store.file_store import FileStore
except Exception:
from ...api.authenticator.store.file_store import FileStore
store = FileStore(os.path.join(os.getcwd(), Constants.TOKEN_FILE))
if sdk_config is None:
sdk_config = SDKConfig()
if resource_path is None or len(resource_path) == 0:
resource_path = os.getcwd()
if logger is None:
logger = Logger(Logger.Levels.INFO, os.path.join(os.getcwd(), Constants.LOG_FILE_NAME))
SDKLogger.initialize(logger)
if not os.path.isdir(resource_path):
raise SDKException(Constants.INITIALIZATION_ERROR, Constants.RESOURCE_PATH_INVALID_ERROR_MESSAGE)
try:
json_details_path = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', Constants.JSON_DETAILS_FILE_PATH)
if Initializer.json_details is None or len(Initializer.json_details)==0:
with open(json_details_path, mode='r') as JSON:
Initializer.json_details = json.load(JSON)
except Exception as e:
raise SDKException(code=Constants.JSON_DETAILS_ERROR, cause=e)
initializer = Initializer()
initializer.environment = environment
initializer.user = user
initializer.token = token
initializer.store = store
initializer.sdk_config = sdk_config
initializer.resource_path = resource_path
initializer.request_proxy = proxy
Initializer.initializer = initializer
logging.getLogger('SDKLogger').info(Constants.INITIALIZATION_SUCCESSFUL + initializer.__str__())
except SDKException as e:
raise e
def __str__(self):
return Constants.FOR_EMAIL_ID + Initializer.get_initializer().user.get_email() + Constants.IN_ENVIRONMENT + Initializer.get_initializer().environment.url + '.'
@staticmethod
def get_initializer():
"""
The method to get Initializer class instance.
Returns:
Initializer : An instance of Initializer
"""
if getattr(Initializer.LOCAL, 'init', None) is not None:
return getattr(Initializer.LOCAL, 'init')
return Initializer.initializer
@staticmethod
def get_json(file_path):
with open(file_path, mode="r") as JSON:
file_contents = json.load(JSON)
JSON.close()
return file_contents
@staticmethod
def switch_user(user=None, environment=None, token=None, sdk_config=None, proxy=None):
"""
The method to switch the different user in SDK environment.
Parameters:
user (UserSignature) : A UserSignature class instance represents the CRM user
environment (DataCenter.Environment) : An Environment class instance containing the CRM API base URL and Accounts URL.
token (Token) : A Token class instance containing the OAuth client application information.
sdk_config (SDKConfig) : A SDKConfig class instance containing the configuration.
proxy (RequestProxy) : A RequestProxy class instance containing the proxy properties of the user.
"""
if Initializer.initializer is None:
raise SDKException(Constants.SDK_UNINITIALIZATION_ERROR, Constants.SDK_UNINITIALIZATION_MESSAGE)
if user is not None and not isinstance(user, UserSignature):
error = {Constants.FIELD: Constants.USER, Constants.EXPECTED_TYPE: UserSignature.__module__}
raise SDKException(Constants.SWITCH_USER_ERROR, Constants.USER_SIGNATURE_ERROR_MESSAGE, details=error)
if environment is not None and not isinstance(environment, DataCenter.Environment):
error = {Constants.FIELD: Constants.ENVIRONMENT,
Constants.EXPECTED_TYPE: DataCenter.Environment.__module__}
raise SDKException(Constants.SWITCH_USER_ERROR, Constants.ENVIRONMENT_ERROR_MESSAGE, details=error)
if token is not None and not isinstance(token, Token):
error = {Constants.FIELD: Constants.TOKEN, Constants.EXPECTED_TYPE: Token.__module__}
raise SDKException(Constants.SWITCH_USER_ERROR, Constants.TOKEN_ERROR_MESSAGE, details=error)
if sdk_config is not None and not isinstance(sdk_config, SDKConfig):
error = {Constants.FIELD: Constants.SDK_CONFIG, Constants.EXPECTED_TYPE: SDKConfig.__module__}
raise SDKException(Constants.SWITCH_USER_ERROR, Constants.SDK_CONFIG_ERROR_MESSAGE, details=error)
if proxy is not None and not isinstance(proxy, RequestProxy):
error = {Constants.FIELD: Constants.USER_PROXY, Constants.EXPECTED_TYPE: RequestProxy.__module__}
raise SDKException(Constants.SWITCH_USER_ERROR, Constants.REQUEST_PROXY_ERROR_MESSAGE, details=error)
previous_initializer = Initializer.get_initializer()
initializer = Initializer()
initializer.user = previous_initializer.user if user is None else user
initializer.environment = previous_initializer.environment if environment is None else environment
initializer.token = previous_initializer.token if token is None else token
initializer.sdk_config = previous_initializer.sdk_config if sdk_config is None else sdk_config
initializer.store = Initializer.initializer.store
initializer.resource_path = Initializer.initializer.resource_path
initializer.request_proxy = proxy
Initializer.LOCAL.init = initializer
logging.getLogger('SDKLogger').info(Constants.INITIALIZATION_SWITCHED + initializer.__str__()) | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/initializer.py | initializer.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.org.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__org = None
self.__key_modified = dict()
def get_org(self):
"""
The method to get the org
Returns:
list: An instance of list
"""
return self.__org
def set_org(self, org):
"""
The method to set the value to org
Parameters:
org (list) : An instance of list
"""
if org is not None and not isinstance(org, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: org EXPECTED TYPE: list', None, None)
self.__org = org
self.__key_modified['org'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.org.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.org.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
class APIException(ResponseHandler, ActionResponse):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class LicenseDetails(object):
def __init__(self):
"""Creates an instance of LicenseDetails"""
self.__paid_expiry = None
self.__users_license_purchased = None
self.__trial_type = None
self.__trial_expiry = None
self.__paid = None
self.__paid_type = None
self.__key_modified = dict()
def get_paid_expiry(self):
"""
The method to get the paid_expiry
Returns:
datetime: An instance of datetime
"""
return self.__paid_expiry
def set_paid_expiry(self, paid_expiry):
"""
The method to set the value to paid_expiry
Parameters:
paid_expiry (datetime) : An instance of datetime
"""
from datetime import datetime
if paid_expiry is not None and not isinstance(paid_expiry, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: paid_expiry EXPECTED TYPE: datetime', None, None)
self.__paid_expiry = paid_expiry
self.__key_modified['paid_expiry'] = 1
def get_users_license_purchased(self):
"""
The method to get the users_license_purchased
Returns:
int: An int representing the users_license_purchased
"""
return self.__users_license_purchased
def set_users_license_purchased(self, users_license_purchased):
"""
The method to set the value to users_license_purchased
Parameters:
users_license_purchased (int) : An int representing the users_license_purchased
"""
if users_license_purchased is not None and not isinstance(users_license_purchased, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: users_license_purchased EXPECTED TYPE: int', None, None)
self.__users_license_purchased = users_license_purchased
self.__key_modified['users_license_purchased'] = 1
def get_trial_type(self):
"""
The method to get the trial_type
Returns:
string: A string representing the trial_type
"""
return self.__trial_type
def set_trial_type(self, trial_type):
"""
The method to set the value to trial_type
Parameters:
trial_type (string) : A string representing the trial_type
"""
if trial_type is not None and not isinstance(trial_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: trial_type EXPECTED TYPE: str', None, None)
self.__trial_type = trial_type
self.__key_modified['trial_type'] = 1
def get_trial_expiry(self):
"""
The method to get the trial_expiry
Returns:
string: A string representing the trial_expiry
"""
return self.__trial_expiry
def set_trial_expiry(self, trial_expiry):
"""
The method to set the value to trial_expiry
Parameters:
trial_expiry (string) : A string representing the trial_expiry
"""
if trial_expiry is not None and not isinstance(trial_expiry, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: trial_expiry EXPECTED TYPE: str', None, None)
self.__trial_expiry = trial_expiry
self.__key_modified['trial_expiry'] = 1
def get_paid(self):
"""
The method to get the paid
Returns:
bool: A bool representing the paid
"""
return self.__paid
def set_paid(self, paid):
"""
The method to set the value to paid
Parameters:
paid (bool) : A bool representing the paid
"""
if paid is not None and not isinstance(paid, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: paid EXPECTED TYPE: bool', None, None)
self.__paid = paid
self.__key_modified['paid'] = 1
def get_paid_type(self):
"""
The method to get the paid_type
Returns:
string: A string representing the paid_type
"""
return self.__paid_type
def set_paid_type(self, paid_type):
"""
The method to set the value to paid_type
Parameters:
paid_type (string) : A string representing the paid_type
"""
if paid_type is not None and not isinstance(paid_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: paid_type EXPECTED TYPE: str', None, None)
self.__paid_type = paid_type
self.__key_modified['paid_type'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/license_details.py | license_details.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
class OrgOperations(object):
def __init__(self):
"""Creates an instance of OrgOperations"""
pass
def get_organization(self):
"""
The method to get organization
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/org'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.org.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def upload_organization_photo(self, request):
"""
The method to upload organization photo
Parameters:
request (FileBodyWrapper) : An instance of FileBodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.org.file_body_wrapper import FileBodyWrapper
except Exception:
from .file_body_wrapper import FileBodyWrapper
if request is not None and not isinstance(request, FileBodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: FileBodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/org/photo'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('multipart/form-data')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.org.action_response import ActionResponse
except Exception:
from .action_response import ActionResponse
return handler_instance.api_call(ActionResponse.__module__, 'application/json') | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/org_operations.py | org_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Org(object):
def __init__(self):
"""Creates an instance of Org"""
self.__country = None
self.__hierarchy_preferences = None
self.__photo_id = None
self.__city = None
self.__description = None
self.__mc_status = None
self.__gapps_enabled = None
self.__domain_name = None
self.__translation_enabled = None
self.__street = None
self.__alias = None
self.__currency = None
self.__id = None
self.__state = None
self.__fax = None
self.__employee_count = None
self.__zip = None
self.__website = None
self.__currency_symbol = None
self.__mobile = None
self.__currency_locale = None
self.__primary_zuid = None
self.__zia_portal_id = None
self.__time_zone = None
self.__zgid = None
self.__country_code = None
self.__license_details = None
self.__phone = None
self.__company_name = None
self.__privacy_settings = None
self.__primary_email = None
self.__hipaa_compliance_enabled = None
self.__iso_code = None
self.__key_modified = dict()
def get_country(self):
"""
The method to get the country
Returns:
string: A string representing the country
"""
return self.__country
def set_country(self, country):
"""
The method to set the value to country
Parameters:
country (string) : A string representing the country
"""
if country is not None and not isinstance(country, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: country EXPECTED TYPE: str', None, None)
self.__country = country
self.__key_modified['country'] = 1
def get_hierarchy_preferences(self):
"""
The method to get the hierarchy_preferences
Returns:
HierarchyPreference: An instance of HierarchyPreference
"""
return self.__hierarchy_preferences
def set_hierarchy_preferences(self, hierarchy_preferences):
"""
The method to set the value to hierarchy_preferences
Parameters:
hierarchy_preferences (HierarchyPreference) : An instance of HierarchyPreference
"""
try:
from zcrmsdk.src.com.zoho.crm.api.org.hierarchy_preference import HierarchyPreference
except Exception:
from .hierarchy_preference import HierarchyPreference
if hierarchy_preferences is not None and not isinstance(hierarchy_preferences, HierarchyPreference):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: hierarchy_preferences EXPECTED TYPE: HierarchyPreference', None, None)
self.__hierarchy_preferences = hierarchy_preferences
self.__key_modified['hierarchy_preferences'] = 1
def get_photo_id(self):
"""
The method to get the photo_id
Returns:
string: A string representing the photo_id
"""
return self.__photo_id
def set_photo_id(self, photo_id):
"""
The method to set the value to photo_id
Parameters:
photo_id (string) : A string representing the photo_id
"""
if photo_id is not None and not isinstance(photo_id, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: photo_id EXPECTED TYPE: str', None, None)
self.__photo_id = photo_id
self.__key_modified['photo_id'] = 1
def get_city(self):
"""
The method to get the city
Returns:
string: A string representing the city
"""
return self.__city
def set_city(self, city):
"""
The method to set the value to city
Parameters:
city (string) : A string representing the city
"""
if city is not None and not isinstance(city, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: city EXPECTED TYPE: str', None, None)
self.__city = city
self.__key_modified['city'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_mc_status(self):
"""
The method to get the mc_status
Returns:
bool: A bool representing the mc_status
"""
return self.__mc_status
def set_mc_status(self, mc_status):
"""
The method to set the value to mc_status
Parameters:
mc_status (bool) : A bool representing the mc_status
"""
if mc_status is not None and not isinstance(mc_status, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: mc_status EXPECTED TYPE: bool', None, None)
self.__mc_status = mc_status
self.__key_modified['mc_status'] = 1
def get_gapps_enabled(self):
"""
The method to get the gapps_enabled
Returns:
bool: A bool representing the gapps_enabled
"""
return self.__gapps_enabled
def set_gapps_enabled(self, gapps_enabled):
"""
The method to set the value to gapps_enabled
Parameters:
gapps_enabled (bool) : A bool representing the gapps_enabled
"""
if gapps_enabled is not None and not isinstance(gapps_enabled, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: gapps_enabled EXPECTED TYPE: bool', None, None)
self.__gapps_enabled = gapps_enabled
self.__key_modified['gapps_enabled'] = 1
def get_domain_name(self):
"""
The method to get the domain_name
Returns:
string: A string representing the domain_name
"""
return self.__domain_name
def set_domain_name(self, domain_name):
"""
The method to set the value to domain_name
Parameters:
domain_name (string) : A string representing the domain_name
"""
if domain_name is not None and not isinstance(domain_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: domain_name EXPECTED TYPE: str', None, None)
self.__domain_name = domain_name
self.__key_modified['domain_name'] = 1
def get_translation_enabled(self):
"""
The method to get the translation_enabled
Returns:
bool: A bool representing the translation_enabled
"""
return self.__translation_enabled
def set_translation_enabled(self, translation_enabled):
"""
The method to set the value to translation_enabled
Parameters:
translation_enabled (bool) : A bool representing the translation_enabled
"""
if translation_enabled is not None and not isinstance(translation_enabled, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: translation_enabled EXPECTED TYPE: bool', None, None)
self.__translation_enabled = translation_enabled
self.__key_modified['translation_enabled'] = 1
def get_street(self):
"""
The method to get the street
Returns:
string: A string representing the street
"""
return self.__street
def set_street(self, street):
"""
The method to set the value to street
Parameters:
street (string) : A string representing the street
"""
if street is not None and not isinstance(street, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: street EXPECTED TYPE: str', None, None)
self.__street = street
self.__key_modified['street'] = 1
def get_alias(self):
"""
The method to get the alias
Returns:
string: A string representing the alias
"""
return self.__alias
def set_alias(self, alias):
"""
The method to set the value to alias
Parameters:
alias (string) : A string representing the alias
"""
if alias is not None and not isinstance(alias, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: alias EXPECTED TYPE: str', None, None)
self.__alias = alias
self.__key_modified['alias'] = 1
def get_currency(self):
"""
The method to get the currency
Returns:
string: A string representing the currency
"""
return self.__currency
def set_currency(self, currency):
"""
The method to set the value to currency
Parameters:
currency (string) : A string representing the currency
"""
if currency is not None and not isinstance(currency, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: currency EXPECTED TYPE: str', None, None)
self.__currency = currency
self.__key_modified['currency'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_state(self):
"""
The method to get the state
Returns:
string: A string representing the state
"""
return self.__state
def set_state(self, state):
"""
The method to set the value to state
Parameters:
state (string) : A string representing the state
"""
if state is not None and not isinstance(state, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: state EXPECTED TYPE: str', None, None)
self.__state = state
self.__key_modified['state'] = 1
def get_fax(self):
"""
The method to get the fax
Returns:
string: A string representing the fax
"""
return self.__fax
def set_fax(self, fax):
"""
The method to set the value to fax
Parameters:
fax (string) : A string representing the fax
"""
if fax is not None and not isinstance(fax, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fax EXPECTED TYPE: str', None, None)
self.__fax = fax
self.__key_modified['fax'] = 1
def get_employee_count(self):
"""
The method to get the employee_count
Returns:
string: A string representing the employee_count
"""
return self.__employee_count
def set_employee_count(self, employee_count):
"""
The method to set the value to employee_count
Parameters:
employee_count (string) : A string representing the employee_count
"""
if employee_count is not None and not isinstance(employee_count, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: employee_count EXPECTED TYPE: str', None, None)
self.__employee_count = employee_count
self.__key_modified['employee_count'] = 1
def get_zip(self):
"""
The method to get the zip
Returns:
string: A string representing the zip
"""
return self.__zip
def set_zip(self, zip):
"""
The method to set the value to zip
Parameters:
zip (string) : A string representing the zip
"""
if zip is not None and not isinstance(zip, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: zip EXPECTED TYPE: str', None, None)
self.__zip = zip
self.__key_modified['zip'] = 1
def get_website(self):
"""
The method to get the website
Returns:
string: A string representing the website
"""
return self.__website
def set_website(self, website):
"""
The method to set the value to website
Parameters:
website (string) : A string representing the website
"""
if website is not None and not isinstance(website, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: website EXPECTED TYPE: str', None, None)
self.__website = website
self.__key_modified['website'] = 1
def get_currency_symbol(self):
"""
The method to get the currency_symbol
Returns:
string: A string representing the currency_symbol
"""
return self.__currency_symbol
def set_currency_symbol(self, currency_symbol):
"""
The method to set the value to currency_symbol
Parameters:
currency_symbol (string) : A string representing the currency_symbol
"""
if currency_symbol is not None and not isinstance(currency_symbol, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: currency_symbol EXPECTED TYPE: str', None, None)
self.__currency_symbol = currency_symbol
self.__key_modified['currency_symbol'] = 1
def get_mobile(self):
"""
The method to get the mobile
Returns:
string: A string representing the mobile
"""
return self.__mobile
def set_mobile(self, mobile):
"""
The method to set the value to mobile
Parameters:
mobile (string) : A string representing the mobile
"""
if mobile is not None and not isinstance(mobile, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: mobile EXPECTED TYPE: str', None, None)
self.__mobile = mobile
self.__key_modified['mobile'] = 1
def get_currency_locale(self):
"""
The method to get the currency_locale
Returns:
string: A string representing the currency_locale
"""
return self.__currency_locale
def set_currency_locale(self, currency_locale):
"""
The method to set the value to currency_locale
Parameters:
currency_locale (string) : A string representing the currency_locale
"""
if currency_locale is not None and not isinstance(currency_locale, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: currency_locale EXPECTED TYPE: str', None, None)
self.__currency_locale = currency_locale
self.__key_modified['currency_locale'] = 1
def get_primary_zuid(self):
"""
The method to get the primary_zuid
Returns:
string: A string representing the primary_zuid
"""
return self.__primary_zuid
def set_primary_zuid(self, primary_zuid):
"""
The method to set the value to primary_zuid
Parameters:
primary_zuid (string) : A string representing the primary_zuid
"""
if primary_zuid is not None and not isinstance(primary_zuid, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: primary_zuid EXPECTED TYPE: str', None, None)
self.__primary_zuid = primary_zuid
self.__key_modified['primary_zuid'] = 1
def get_zia_portal_id(self):
"""
The method to get the zia_portal_id
Returns:
string: A string representing the zia_portal_id
"""
return self.__zia_portal_id
def set_zia_portal_id(self, zia_portal_id):
"""
The method to set the value to zia_portal_id
Parameters:
zia_portal_id (string) : A string representing the zia_portal_id
"""
if zia_portal_id is not None and not isinstance(zia_portal_id, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: zia_portal_id EXPECTED TYPE: str', None, None)
self.__zia_portal_id = zia_portal_id
self.__key_modified['zia_portal_id'] = 1
def get_time_zone(self):
"""
The method to get the time_zone
Returns:
string: A string representing the time_zone
"""
return self.__time_zone
def set_time_zone(self, time_zone):
"""
The method to set the value to time_zone
Parameters:
time_zone (string) : A string representing the time_zone
"""
if time_zone is not None and not isinstance(time_zone, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: time_zone EXPECTED TYPE: str', None, None)
self.__time_zone = time_zone
self.__key_modified['time_zone'] = 1
def get_zgid(self):
"""
The method to get the zgid
Returns:
string: A string representing the zgid
"""
return self.__zgid
def set_zgid(self, zgid):
"""
The method to set the value to zgid
Parameters:
zgid (string) : A string representing the zgid
"""
if zgid is not None and not isinstance(zgid, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: zgid EXPECTED TYPE: str', None, None)
self.__zgid = zgid
self.__key_modified['zgid'] = 1
def get_country_code(self):
"""
The method to get the country_code
Returns:
string: A string representing the country_code
"""
return self.__country_code
def set_country_code(self, country_code):
"""
The method to set the value to country_code
Parameters:
country_code (string) : A string representing the country_code
"""
if country_code is not None and not isinstance(country_code, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: country_code EXPECTED TYPE: str', None, None)
self.__country_code = country_code
self.__key_modified['country_code'] = 1
def get_license_details(self):
"""
The method to get the license_details
Returns:
LicenseDetails: An instance of LicenseDetails
"""
return self.__license_details
def set_license_details(self, license_details):
"""
The method to set the value to license_details
Parameters:
license_details (LicenseDetails) : An instance of LicenseDetails
"""
try:
from zcrmsdk.src.com.zoho.crm.api.org.license_details import LicenseDetails
except Exception:
from .license_details import LicenseDetails
if license_details is not None and not isinstance(license_details, LicenseDetails):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: license_details EXPECTED TYPE: LicenseDetails', None, None)
self.__license_details = license_details
self.__key_modified['license_details'] = 1
def get_phone(self):
"""
The method to get the phone
Returns:
string: A string representing the phone
"""
return self.__phone
def set_phone(self, phone):
"""
The method to set the value to phone
Parameters:
phone (string) : A string representing the phone
"""
if phone is not None and not isinstance(phone, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: phone EXPECTED TYPE: str', None, None)
self.__phone = phone
self.__key_modified['phone'] = 1
def get_company_name(self):
"""
The method to get the company_name
Returns:
string: A string representing the company_name
"""
return self.__company_name
def set_company_name(self, company_name):
"""
The method to set the value to company_name
Parameters:
company_name (string) : A string representing the company_name
"""
if company_name is not None and not isinstance(company_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: company_name EXPECTED TYPE: str', None, None)
self.__company_name = company_name
self.__key_modified['company_name'] = 1
def get_privacy_settings(self):
"""
The method to get the privacy_settings
Returns:
bool: A bool representing the privacy_settings
"""
return self.__privacy_settings
def set_privacy_settings(self, privacy_settings):
"""
The method to set the value to privacy_settings
Parameters:
privacy_settings (bool) : A bool representing the privacy_settings
"""
if privacy_settings is not None and not isinstance(privacy_settings, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: privacy_settings EXPECTED TYPE: bool', None, None)
self.__privacy_settings = privacy_settings
self.__key_modified['privacy_settings'] = 1
def get_primary_email(self):
"""
The method to get the primary_email
Returns:
string: A string representing the primary_email
"""
return self.__primary_email
def set_primary_email(self, primary_email):
"""
The method to set the value to primary_email
Parameters:
primary_email (string) : A string representing the primary_email
"""
if primary_email is not None and not isinstance(primary_email, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: primary_email EXPECTED TYPE: str', None, None)
self.__primary_email = primary_email
self.__key_modified['primary_email'] = 1
def get_hipaa_compliance_enabled(self):
"""
The method to get the hipaa_compliance_enabled
Returns:
bool: A bool representing the hipaa_compliance_enabled
"""
return self.__hipaa_compliance_enabled
def set_hipaa_compliance_enabled(self, hipaa_compliance_enabled):
"""
The method to set the value to hipaa_compliance_enabled
Parameters:
hipaa_compliance_enabled (bool) : A bool representing the hipaa_compliance_enabled
"""
if hipaa_compliance_enabled is not None and not isinstance(hipaa_compliance_enabled, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: hipaa_compliance_enabled EXPECTED TYPE: bool', None, None)
self.__hipaa_compliance_enabled = hipaa_compliance_enabled
self.__key_modified['hipaa_compliance_enabled'] = 1
def get_iso_code(self):
"""
The method to get the iso_code
Returns:
string: A string representing the iso_code
"""
return self.__iso_code
def set_iso_code(self, iso_code):
"""
The method to set the value to iso_code
Parameters:
iso_code (string) : A string representing the iso_code
"""
if iso_code is not None and not isinstance(iso_code, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: iso_code EXPECTED TYPE: str', None, None)
self.__iso_code = iso_code
self.__key_modified['iso_code'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/org.py | org.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.org.action_response import ActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
class SuccessResponse(ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/org/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.modules.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__modules = None
self.__key_modified = dict()
def get_modules(self):
"""
The method to get the modules
Returns:
list: An instance of list
"""
return self.__modules
def set_modules(self, modules):
"""
The method to set the value to modules
Parameters:
modules (list) : An instance of list
"""
if modules is not None and not isinstance(modules, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modules EXPECTED TYPE: list', None, None)
self.__modules = modules
self.__key_modified['modules'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.modules.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__modules = None
self.__key_modified = dict()
def get_modules(self):
"""
The method to get the modules
Returns:
list: An instance of list
"""
return self.__modules
def set_modules(self, modules):
"""
The method to set the value to modules
Parameters:
modules (list) : An instance of list
"""
if modules is not None and not isinstance(modules, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modules EXPECTED TYPE: list', None, None)
self.__modules = modules
self.__key_modified['modules'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Territory(object):
def __init__(self):
"""Creates an instance of Territory"""
self.__id = None
self.__name = None
self.__subordinates = None
self.__key_modified = dict()
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_subordinates(self):
"""
The method to get the subordinates
Returns:
bool: A bool representing the subordinates
"""
return self.__subordinates
def set_subordinates(self, subordinates):
"""
The method to set the value to subordinates
Parameters:
subordinates (bool) : A bool representing the subordinates
"""
if subordinates is not None and not isinstance(subordinates, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: subordinates EXPECTED TYPE: bool', None, None)
self.__subordinates = subordinates
self.__key_modified['subordinates'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/territory.py | territory.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.modules.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.modules.response_handler import ResponseHandler
from zcrmsdk.src.com.zoho.crm.api.modules.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .action_handler import ActionHandler
class APIException(ResponseHandler, ActionResponse, ActionHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Argument(object):
def __init__(self):
"""Creates an instance of Argument"""
self.__name = None
self.__value = None
self.__key_modified = dict()
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_value(self):
"""
The method to get the value
Returns:
string: A string representing the value
"""
return self.__value
def set_value(self, value):
"""
The method to set the value to value
Parameters:
value (string) : A string representing the value
"""
if value is not None and not isinstance(value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: value EXPECTED TYPE: str', None, None)
self.__value = value
self.__key_modified['value'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/argument.py | argument.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
class Module(object):
def __init__(self):
"""Creates an instance of Module"""
self.__name = None
self.__global_search_supported = None
self.__kanban_view = None
self.__deletable = None
self.__description = None
self.__creatable = None
self.__filter_status = None
self.__inventory_template_supported = None
self.__modified_time = None
self.__plural_label = None
self.__presence_sub_menu = None
self.__isblueprintsupported = None
self.__triggers_supported = None
self.__id = None
self.__related_list_properties = None
self.__properties = None
self.__on_demand_properties = None
self.__per_page = None
self.__visibility = None
self.__visible = None
self.__convertable = None
self.__editable = None
self.__emailtemplate_support = None
self.__profiles = None
self.__filter_supported = None
self.__display_field = None
self.__search_layout_fields = None
self.__kanban_view_supported = None
self.__show_as_tab = None
self.__web_link = None
self.__sequence_number = None
self.__singular_label = None
self.__viewable = None
self.__api_supported = None
self.__api_name = None
self.__quick_create = None
self.__modified_by = None
self.__generated_type = None
self.__feeds_required = None
self.__scoring_supported = None
self.__webform_supported = None
self.__arguments = None
self.__module_name = None
self.__business_card_field_limit = None
self.__custom_view = None
self.__parent_module = None
self.__territory = None
self.__key_modified = dict()
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_global_search_supported(self):
"""
The method to get the global_search_supported
Returns:
bool: A bool representing the global_search_supported
"""
return self.__global_search_supported
def set_global_search_supported(self, global_search_supported):
"""
The method to set the value to global_search_supported
Parameters:
global_search_supported (bool) : A bool representing the global_search_supported
"""
if global_search_supported is not None and not isinstance(global_search_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: global_search_supported EXPECTED TYPE: bool', None, None)
self.__global_search_supported = global_search_supported
self.__key_modified['global_search_supported'] = 1
def get_kanban_view(self):
"""
The method to get the kanban_view
Returns:
bool: A bool representing the kanban_view
"""
return self.__kanban_view
def set_kanban_view(self, kanban_view):
"""
The method to set the value to kanban_view
Parameters:
kanban_view (bool) : A bool representing the kanban_view
"""
if kanban_view is not None and not isinstance(kanban_view, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: kanban_view EXPECTED TYPE: bool', None, None)
self.__kanban_view = kanban_view
self.__key_modified['kanban_view'] = 1
def get_deletable(self):
"""
The method to get the deletable
Returns:
bool: A bool representing the deletable
"""
return self.__deletable
def set_deletable(self, deletable):
"""
The method to set the value to deletable
Parameters:
deletable (bool) : A bool representing the deletable
"""
if deletable is not None and not isinstance(deletable, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deletable EXPECTED TYPE: bool', None, None)
self.__deletable = deletable
self.__key_modified['deletable'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_creatable(self):
"""
The method to get the creatable
Returns:
bool: A bool representing the creatable
"""
return self.__creatable
def set_creatable(self, creatable):
"""
The method to set the value to creatable
Parameters:
creatable (bool) : A bool representing the creatable
"""
if creatable is not None and not isinstance(creatable, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: creatable EXPECTED TYPE: bool', None, None)
self.__creatable = creatable
self.__key_modified['creatable'] = 1
def get_filter_status(self):
"""
The method to get the filter_status
Returns:
bool: A bool representing the filter_status
"""
return self.__filter_status
def set_filter_status(self, filter_status):
"""
The method to set the value to filter_status
Parameters:
filter_status (bool) : A bool representing the filter_status
"""
if filter_status is not None and not isinstance(filter_status, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: filter_status EXPECTED TYPE: bool', None, None)
self.__filter_status = filter_status
self.__key_modified['filter_status'] = 1
def get_inventory_template_supported(self):
"""
The method to get the inventory_template_supported
Returns:
bool: A bool representing the inventory_template_supported
"""
return self.__inventory_template_supported
def set_inventory_template_supported(self, inventory_template_supported):
"""
The method to set the value to inventory_template_supported
Parameters:
inventory_template_supported (bool) : A bool representing the inventory_template_supported
"""
if inventory_template_supported is not None and not isinstance(inventory_template_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: inventory_template_supported EXPECTED TYPE: bool', None, None)
self.__inventory_template_supported = inventory_template_supported
self.__key_modified['inventory_template_supported'] = 1
def get_modified_time(self):
"""
The method to get the modified_time
Returns:
datetime: An instance of datetime
"""
return self.__modified_time
def set_modified_time(self, modified_time):
"""
The method to set the value to modified_time
Parameters:
modified_time (datetime) : An instance of datetime
"""
from datetime import datetime
if modified_time is not None and not isinstance(modified_time, datetime):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_time EXPECTED TYPE: datetime', None, None)
self.__modified_time = modified_time
self.__key_modified['modified_time'] = 1
def get_plural_label(self):
"""
The method to get the plural_label
Returns:
string: A string representing the plural_label
"""
return self.__plural_label
def set_plural_label(self, plural_label):
"""
The method to set the value to plural_label
Parameters:
plural_label (string) : A string representing the plural_label
"""
if plural_label is not None and not isinstance(plural_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: plural_label EXPECTED TYPE: str', None, None)
self.__plural_label = plural_label
self.__key_modified['plural_label'] = 1
def get_presence_sub_menu(self):
"""
The method to get the presence_sub_menu
Returns:
bool: A bool representing the presence_sub_menu
"""
return self.__presence_sub_menu
def set_presence_sub_menu(self, presence_sub_menu):
"""
The method to set the value to presence_sub_menu
Parameters:
presence_sub_menu (bool) : A bool representing the presence_sub_menu
"""
if presence_sub_menu is not None and not isinstance(presence_sub_menu, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: presence_sub_menu EXPECTED TYPE: bool', None, None)
self.__presence_sub_menu = presence_sub_menu
self.__key_modified['presence_sub_menu'] = 1
def get_isblueprintsupported(self):
"""
The method to get the isblueprintsupported
Returns:
bool: A bool representing the isblueprintsupported
"""
return self.__isblueprintsupported
def set_isblueprintsupported(self, isblueprintsupported):
"""
The method to set the value to isblueprintsupported
Parameters:
isblueprintsupported (bool) : A bool representing the isblueprintsupported
"""
if isblueprintsupported is not None and not isinstance(isblueprintsupported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: isblueprintsupported EXPECTED TYPE: bool', None, None)
self.__isblueprintsupported = isblueprintsupported
self.__key_modified['isBlueprintSupported'] = 1
def get_triggers_supported(self):
"""
The method to get the triggers_supported
Returns:
bool: A bool representing the triggers_supported
"""
return self.__triggers_supported
def set_triggers_supported(self, triggers_supported):
"""
The method to set the value to triggers_supported
Parameters:
triggers_supported (bool) : A bool representing the triggers_supported
"""
if triggers_supported is not None and not isinstance(triggers_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: triggers_supported EXPECTED TYPE: bool', None, None)
self.__triggers_supported = triggers_supported
self.__key_modified['triggers_supported'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_related_list_properties(self):
"""
The method to get the related_list_properties
Returns:
RelatedListProperties: An instance of RelatedListProperties
"""
return self.__related_list_properties
def set_related_list_properties(self, related_list_properties):
"""
The method to set the value to related_list_properties
Parameters:
related_list_properties (RelatedListProperties) : An instance of RelatedListProperties
"""
try:
from zcrmsdk.src.com.zoho.crm.api.modules.related_list_properties import RelatedListProperties
except Exception:
from .related_list_properties import RelatedListProperties
if related_list_properties is not None and not isinstance(related_list_properties, RelatedListProperties):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: related_list_properties EXPECTED TYPE: RelatedListProperties', None, None)
self.__related_list_properties = related_list_properties
self.__key_modified['related_list_properties'] = 1
def get_properties(self):
"""
The method to get the properties
Returns:
list: An instance of list
"""
return self.__properties
def set_properties(self, properties):
"""
The method to set the value to properties
Parameters:
properties (list) : An instance of list
"""
if properties is not None and not isinstance(properties, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: properties EXPECTED TYPE: list', None, None)
self.__properties = properties
self.__key_modified['$properties'] = 1
def get_on_demand_properties(self):
"""
The method to get the on_demand_properties
Returns:
list: An instance of list
"""
return self.__on_demand_properties
def set_on_demand_properties(self, on_demand_properties):
"""
The method to set the value to on_demand_properties
Parameters:
on_demand_properties (list) : An instance of list
"""
if on_demand_properties is not None and not isinstance(on_demand_properties, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: on_demand_properties EXPECTED TYPE: list', None, None)
self.__on_demand_properties = on_demand_properties
self.__key_modified['$on_demand_properties'] = 1
def get_per_page(self):
"""
The method to get the per_page
Returns:
int: An int representing the per_page
"""
return self.__per_page
def set_per_page(self, per_page):
"""
The method to set the value to per_page
Parameters:
per_page (int) : An int representing the per_page
"""
if per_page is not None and not isinstance(per_page, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: per_page EXPECTED TYPE: int', None, None)
self.__per_page = per_page
self.__key_modified['per_page'] = 1
def get_visibility(self):
"""
The method to get the visibility
Returns:
int: An int representing the visibility
"""
return self.__visibility
def set_visibility(self, visibility):
"""
The method to set the value to visibility
Parameters:
visibility (int) : An int representing the visibility
"""
if visibility is not None and not isinstance(visibility, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: visibility EXPECTED TYPE: int', None, None)
self.__visibility = visibility
self.__key_modified['visibility'] = 1
def get_visible(self):
"""
The method to get the visible
Returns:
bool: A bool representing the visible
"""
return self.__visible
def set_visible(self, visible):
"""
The method to set the value to visible
Parameters:
visible (bool) : A bool representing the visible
"""
if visible is not None and not isinstance(visible, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: visible EXPECTED TYPE: bool', None, None)
self.__visible = visible
self.__key_modified['visible'] = 1
def get_convertable(self):
"""
The method to get the convertable
Returns:
bool: A bool representing the convertable
"""
return self.__convertable
def set_convertable(self, convertable):
"""
The method to set the value to convertable
Parameters:
convertable (bool) : A bool representing the convertable
"""
if convertable is not None and not isinstance(convertable, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: convertable EXPECTED TYPE: bool', None, None)
self.__convertable = convertable
self.__key_modified['convertable'] = 1
def get_editable(self):
"""
The method to get the editable
Returns:
bool: A bool representing the editable
"""
return self.__editable
def set_editable(self, editable):
"""
The method to set the value to editable
Parameters:
editable (bool) : A bool representing the editable
"""
if editable is not None and not isinstance(editable, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: editable EXPECTED TYPE: bool', None, None)
self.__editable = editable
self.__key_modified['editable'] = 1
def get_emailtemplate_support(self):
"""
The method to get the emailtemplate_support
Returns:
bool: A bool representing the emailtemplate_support
"""
return self.__emailtemplate_support
def set_emailtemplate_support(self, emailtemplate_support):
"""
The method to set the value to emailtemplate_support
Parameters:
emailtemplate_support (bool) : A bool representing the emailtemplate_support
"""
if emailtemplate_support is not None and not isinstance(emailtemplate_support, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: emailtemplate_support EXPECTED TYPE: bool', None, None)
self.__emailtemplate_support = emailtemplate_support
self.__key_modified['emailTemplate_support'] = 1
def get_profiles(self):
"""
The method to get the profiles
Returns:
list: An instance of list
"""
return self.__profiles
def set_profiles(self, profiles):
"""
The method to set the value to profiles
Parameters:
profiles (list) : An instance of list
"""
if profiles is not None and not isinstance(profiles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: profiles EXPECTED TYPE: list', None, None)
self.__profiles = profiles
self.__key_modified['profiles'] = 1
def get_filter_supported(self):
"""
The method to get the filter_supported
Returns:
bool: A bool representing the filter_supported
"""
return self.__filter_supported
def set_filter_supported(self, filter_supported):
"""
The method to set the value to filter_supported
Parameters:
filter_supported (bool) : A bool representing the filter_supported
"""
if filter_supported is not None and not isinstance(filter_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: filter_supported EXPECTED TYPE: bool', None, None)
self.__filter_supported = filter_supported
self.__key_modified['filter_supported'] = 1
def get_display_field(self):
"""
The method to get the display_field
Returns:
string: A string representing the display_field
"""
return self.__display_field
def set_display_field(self, display_field):
"""
The method to set the value to display_field
Parameters:
display_field (string) : A string representing the display_field
"""
if display_field is not None and not isinstance(display_field, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_field EXPECTED TYPE: str', None, None)
self.__display_field = display_field
self.__key_modified['display_field'] = 1
def get_search_layout_fields(self):
"""
The method to get the search_layout_fields
Returns:
list: An instance of list
"""
return self.__search_layout_fields
def set_search_layout_fields(self, search_layout_fields):
"""
The method to set the value to search_layout_fields
Parameters:
search_layout_fields (list) : An instance of list
"""
if search_layout_fields is not None and not isinstance(search_layout_fields, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: search_layout_fields EXPECTED TYPE: list', None, None)
self.__search_layout_fields = search_layout_fields
self.__key_modified['search_layout_fields'] = 1
def get_kanban_view_supported(self):
"""
The method to get the kanban_view_supported
Returns:
bool: A bool representing the kanban_view_supported
"""
return self.__kanban_view_supported
def set_kanban_view_supported(self, kanban_view_supported):
"""
The method to set the value to kanban_view_supported
Parameters:
kanban_view_supported (bool) : A bool representing the kanban_view_supported
"""
if kanban_view_supported is not None and not isinstance(kanban_view_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: kanban_view_supported EXPECTED TYPE: bool', None, None)
self.__kanban_view_supported = kanban_view_supported
self.__key_modified['kanban_view_supported'] = 1
def get_show_as_tab(self):
"""
The method to get the show_as_tab
Returns:
bool: A bool representing the show_as_tab
"""
return self.__show_as_tab
def set_show_as_tab(self, show_as_tab):
"""
The method to set the value to show_as_tab
Parameters:
show_as_tab (bool) : A bool representing the show_as_tab
"""
if show_as_tab is not None and not isinstance(show_as_tab, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: show_as_tab EXPECTED TYPE: bool', None, None)
self.__show_as_tab = show_as_tab
self.__key_modified['show_as_tab'] = 1
def get_web_link(self):
"""
The method to get the web_link
Returns:
string: A string representing the web_link
"""
return self.__web_link
def set_web_link(self, web_link):
"""
The method to set the value to web_link
Parameters:
web_link (string) : A string representing the web_link
"""
if web_link is not None and not isinstance(web_link, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: web_link EXPECTED TYPE: str', None, None)
self.__web_link = web_link
self.__key_modified['web_link'] = 1
def get_sequence_number(self):
"""
The method to get the sequence_number
Returns:
int: An int representing the sequence_number
"""
return self.__sequence_number
def set_sequence_number(self, sequence_number):
"""
The method to set the value to sequence_number
Parameters:
sequence_number (int) : An int representing the sequence_number
"""
if sequence_number is not None and not isinstance(sequence_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sequence_number EXPECTED TYPE: int', None, None)
self.__sequence_number = sequence_number
self.__key_modified['sequence_number'] = 1
def get_singular_label(self):
"""
The method to get the singular_label
Returns:
string: A string representing the singular_label
"""
return self.__singular_label
def set_singular_label(self, singular_label):
"""
The method to set the value to singular_label
Parameters:
singular_label (string) : A string representing the singular_label
"""
if singular_label is not None and not isinstance(singular_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: singular_label EXPECTED TYPE: str', None, None)
self.__singular_label = singular_label
self.__key_modified['singular_label'] = 1
def get_viewable(self):
"""
The method to get the viewable
Returns:
bool: A bool representing the viewable
"""
return self.__viewable
def set_viewable(self, viewable):
"""
The method to set the value to viewable
Parameters:
viewable (bool) : A bool representing the viewable
"""
if viewable is not None and not isinstance(viewable, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: viewable EXPECTED TYPE: bool', None, None)
self.__viewable = viewable
self.__key_modified['viewable'] = 1
def get_api_supported(self):
"""
The method to get the api_supported
Returns:
bool: A bool representing the api_supported
"""
return self.__api_supported
def set_api_supported(self, api_supported):
"""
The method to set the value to api_supported
Parameters:
api_supported (bool) : A bool representing the api_supported
"""
if api_supported is not None and not isinstance(api_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_supported EXPECTED TYPE: bool', None, None)
self.__api_supported = api_supported
self.__key_modified['api_supported'] = 1
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_quick_create(self):
"""
The method to get the quick_create
Returns:
bool: A bool representing the quick_create
"""
return self.__quick_create
def set_quick_create(self, quick_create):
"""
The method to set the value to quick_create
Parameters:
quick_create (bool) : A bool representing the quick_create
"""
if quick_create is not None and not isinstance(quick_create, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: quick_create EXPECTED TYPE: bool', None, None)
self.__quick_create = quick_create
self.__key_modified['quick_create'] = 1
def get_modified_by(self):
"""
The method to get the modified_by
Returns:
User: An instance of User
"""
return self.__modified_by
def set_modified_by(self, modified_by):
"""
The method to set the value to modified_by
Parameters:
modified_by (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if modified_by is not None and not isinstance(modified_by, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modified_by EXPECTED TYPE: User', None, None)
self.__modified_by = modified_by
self.__key_modified['modified_by'] = 1
def get_generated_type(self):
"""
The method to get the generated_type
Returns:
Choice: An instance of Choice
"""
return self.__generated_type
def set_generated_type(self, generated_type):
"""
The method to set the value to generated_type
Parameters:
generated_type (Choice) : An instance of Choice
"""
if generated_type is not None and not isinstance(generated_type, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: generated_type EXPECTED TYPE: Choice', None, None)
self.__generated_type = generated_type
self.__key_modified['generated_type'] = 1
def get_feeds_required(self):
"""
The method to get the feeds_required
Returns:
bool: A bool representing the feeds_required
"""
return self.__feeds_required
def set_feeds_required(self, feeds_required):
"""
The method to set the value to feeds_required
Parameters:
feeds_required (bool) : A bool representing the feeds_required
"""
if feeds_required is not None and not isinstance(feeds_required, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: feeds_required EXPECTED TYPE: bool', None, None)
self.__feeds_required = feeds_required
self.__key_modified['feeds_required'] = 1
def get_scoring_supported(self):
"""
The method to get the scoring_supported
Returns:
bool: A bool representing the scoring_supported
"""
return self.__scoring_supported
def set_scoring_supported(self, scoring_supported):
"""
The method to set the value to scoring_supported
Parameters:
scoring_supported (bool) : A bool representing the scoring_supported
"""
if scoring_supported is not None and not isinstance(scoring_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: scoring_supported EXPECTED TYPE: bool', None, None)
self.__scoring_supported = scoring_supported
self.__key_modified['scoring_supported'] = 1
def get_webform_supported(self):
"""
The method to get the webform_supported
Returns:
bool: A bool representing the webform_supported
"""
return self.__webform_supported
def set_webform_supported(self, webform_supported):
"""
The method to set the value to webform_supported
Parameters:
webform_supported (bool) : A bool representing the webform_supported
"""
if webform_supported is not None and not isinstance(webform_supported, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: webform_supported EXPECTED TYPE: bool', None, None)
self.__webform_supported = webform_supported
self.__key_modified['webform_supported'] = 1
def get_arguments(self):
"""
The method to get the arguments
Returns:
list: An instance of list
"""
return self.__arguments
def set_arguments(self, arguments):
"""
The method to set the value to arguments
Parameters:
arguments (list) : An instance of list
"""
if arguments is not None and not isinstance(arguments, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: arguments EXPECTED TYPE: list', None, None)
self.__arguments = arguments
self.__key_modified['arguments'] = 1
def get_module_name(self):
"""
The method to get the module_name
Returns:
string: A string representing the module_name
"""
return self.__module_name
def set_module_name(self, module_name):
"""
The method to set the value to module_name
Parameters:
module_name (string) : A string representing the module_name
"""
if module_name is not None and not isinstance(module_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_name EXPECTED TYPE: str', None, None)
self.__module_name = module_name
self.__key_modified['module_name'] = 1
def get_business_card_field_limit(self):
"""
The method to get the business_card_field_limit
Returns:
int: An int representing the business_card_field_limit
"""
return self.__business_card_field_limit
def set_business_card_field_limit(self, business_card_field_limit):
"""
The method to set the value to business_card_field_limit
Parameters:
business_card_field_limit (int) : An int representing the business_card_field_limit
"""
if business_card_field_limit is not None and not isinstance(business_card_field_limit, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: business_card_field_limit EXPECTED TYPE: int', None, None)
self.__business_card_field_limit = business_card_field_limit
self.__key_modified['business_card_field_limit'] = 1
def get_custom_view(self):
"""
The method to get the custom_view
Returns:
CustomView: An instance of CustomView
"""
return self.__custom_view
def set_custom_view(self, custom_view):
"""
The method to set the value to custom_view
Parameters:
custom_view (CustomView) : An instance of CustomView
"""
try:
from zcrmsdk.src.com.zoho.crm.api.customviews import CustomView
except Exception:
from ..custom_views import CustomView
if custom_view is not None and not isinstance(custom_view, CustomView):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: custom_view EXPECTED TYPE: CustomView', None, None)
self.__custom_view = custom_view
self.__key_modified['custom_view'] = 1
def get_parent_module(self):
"""
The method to get the parent_module
Returns:
Module: An instance of Module
"""
return self.__parent_module
def set_parent_module(self, parent_module):
"""
The method to set the value to parent_module
Parameters:
parent_module (Module) : An instance of Module
"""
try:
from zcrmsdk.src.com.zoho.crm.api.modules.module import Module
except Exception:
from .module import Module
if parent_module is not None and not isinstance(parent_module, Module):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: parent_module EXPECTED TYPE: Module', None, None)
self.__parent_module = parent_module
self.__key_modified['parent_module'] = 1
def get_territory(self):
"""
The method to get the territory
Returns:
Territory: An instance of Territory
"""
return self.__territory
def set_territory(self, territory):
"""
The method to set the value to territory
Parameters:
territory (Territory) : An instance of Territory
"""
try:
from zcrmsdk.src.com.zoho.crm.api.modules.territory import Territory
except Exception:
from .territory import Territory
if territory is not None and not isinstance(territory, Territory):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: territory EXPECTED TYPE: Territory', None, None)
self.__territory = territory
self.__key_modified['territory'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/module.py | module.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class RelatedListProperties(object):
def __init__(self):
"""Creates an instance of RelatedListProperties"""
self.__sort_by = None
self.__fields = None
self.__sort_order = None
self.__key_modified = dict()
def get_sort_by(self):
"""
The method to get the sort_by
Returns:
string: A string representing the sort_by
"""
return self.__sort_by
def set_sort_by(self, sort_by):
"""
The method to set the value to sort_by
Parameters:
sort_by (string) : A string representing the sort_by
"""
if sort_by is not None and not isinstance(sort_by, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sort_by EXPECTED TYPE: str', None, None)
self.__sort_by = sort_by
self.__key_modified['sort_by'] = 1
def get_fields(self):
"""
The method to get the fields
Returns:
list: An instance of list
"""
return self.__fields
def set_fields(self, fields):
"""
The method to set the value to fields
Parameters:
fields (list) : An instance of list
"""
if fields is not None and not isinstance(fields, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fields EXPECTED TYPE: list', None, None)
self.__fields = fields
self.__key_modified['fields'] = 1
def get_sort_order(self):
"""
The method to get the sort_order
Returns:
string: A string representing the sort_order
"""
return self.__sort_order
def set_sort_order(self, sort_order):
"""
The method to set the value to sort_order
Parameters:
sort_order (string) : A string representing the sort_order
"""
if sort_order is not None and not isinstance(sort_order, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sort_order EXPECTED TYPE: str', None, None)
self.__sort_order = sort_order
self.__key_modified['sort_order'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/related_list_properties.py | related_list_properties.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.modules.action_response import ActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
class SuccessResponse(ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
from zcrmsdk.src.com.zoho.crm.api.header import Header
from zcrmsdk.src.com.zoho.crm.api.header_map import HeaderMap
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
from ..header import Header
from ..header_map import HeaderMap
class ModulesOperations(object):
def __init__(self):
"""Creates an instance of ModulesOperations"""
pass
def get_modules(self, header_instance=None):
"""
The method to get modules
Parameters:
header_instance (HeaderMap) : An instance of HeaderMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if header_instance is not None and not isinstance(header_instance, HeaderMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: header_instance EXPECTED TYPE: HeaderMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/modules'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_header(header_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.modules.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_module(self, api_name):
"""
The method to get module
Parameters:
api_name (string) : A string representing the api_name
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/modules/'
api_path = api_path + str(api_name)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
try:
from zcrmsdk.src.com.zoho.crm.api.modules.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def update_module_by_api_name(self, api_name, request):
"""
The method to update module by api name
Parameters:
api_name (string) : A string representing the api_name
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.modules.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/modules/'
api_path = api_path + str(api_name)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.modules.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def update_module_by_id(self, id, request):
"""
The method to update module by id
Parameters:
id (int) : An int representing the id
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.modules.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/modules/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.modules.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
class GetModulesHeader(object):
if_modified_since = Header('If-Modified-Since', 'com.zoho.crm.api.Modules.GetModulesHeader') | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/modules/modules_operations.py | modules_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__variables = None
self.__key_modified = dict()
def get_variables(self):
"""
The method to get the variables
Returns:
list: An instance of list
"""
return self.__variables
def set_variables(self, variables):
"""
The method to set the value to variables
Parameters:
variables (list) : An instance of list
"""
if variables is not None and not isinstance(variables, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: variables EXPECTED TYPE: list', None, None)
self.__variables = variables
self.__key_modified['variables'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__variables = None
self.__key_modified = dict()
def get_variables(self):
"""
The method to get the variables
Returns:
list: An instance of list
"""
return self.__variables
def set_variables(self, variables):
"""
The method to set the value to variables
Parameters:
variables (list) : An instance of list
"""
if variables is not None and not isinstance(variables, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: variables EXPECTED TYPE: list', None, None)
self.__variables = variables
self.__key_modified['variables'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.variables.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .action_handler import ActionHandler
class APIException(ResponseHandler, ActionResponse, ActionHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.parameter_map import ParameterMap
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
from zcrmsdk.src.com.zoho.crm.api.param import Param
except Exception:
from ..exception import SDKException
from ..parameter_map import ParameterMap
from ..util import APIResponse, CommonAPIHandler, Constants
from ..param import Param
class VariablesOperations(object):
def __init__(self):
"""Creates an instance of VariablesOperations"""
pass
def get_variables(self, param_instance=None):
"""
The method to get variables
Parameters:
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def create_variables(self, request):
"""
The method to create variables
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.variables.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def update_variables(self, request):
"""
The method to update variables
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.variables.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def delete_variables(self, param_instance=None):
"""
The method to delete variables
Parameters:
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_variable_by_id(self, id, param_instance=None):
"""
The method to get variable by id
Parameters:
id (int) : An int representing the id
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def update_variable_by_id(self, id, request):
"""
The method to update variable by id
Parameters:
id (int) : An int representing the id
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.variables.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def delete_variable(self, id):
"""
The method to delete variable
Parameters:
id (int) : An int representing the id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables/'
api_path = api_path + str(id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_variable_for_api_name(self, api_name, param_instance=None):
"""
The method to get variable for api name
Parameters:
api_name (string) : A string representing the api_name
param_instance (ParameterMap) : An instance of ParameterMap
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
if param_instance is not None and not isinstance(param_instance, ParameterMap):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables/'
api_path = api_path + str(api_name)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.set_param(param_instance)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def update_variable_by_api_name(self, api_name, request):
"""
The method to update variable by api name
Parameters:
api_name (string) : A string representing the api_name
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.variables.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/variables/'
api_path = api_path + str(api_name)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
try:
from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
class GetVariablesParam(object):
group = Param('group', 'com.zoho.crm.api.Variables.GetVariablesParam')
class DeleteVariablesParam(object):
ids = Param('ids', 'com.zoho.crm.api.Variables.DeleteVariablesParam')
class GetVariableByIDParam(object):
group = Param('group', 'com.zoho.crm.api.Variables.GetVariableByIDParam')
class GetVariableForAPINameParam(object):
group = Param('group', 'com.zoho.crm.api.Variables.GetVariableForAPINameParam') | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/variables_operations.py | variables_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Variable(object):
def __init__(self):
"""Creates an instance of Variable"""
self.__api_name = None
self.__name = None
self.__description = None
self.__id = None
self.__source = None
self.__type = None
self.__variable_group = None
self.__value = None
self.__key_modified = dict()
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
def set_api_name(self, api_name):
"""
The method to set the value to api_name
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
self.__key_modified['api_name'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_source(self):
"""
The method to get the source
Returns:
string: A string representing the source
"""
return self.__source
def set_source(self, source):
"""
The method to set the value to source
Parameters:
source (string) : A string representing the source
"""
if source is not None and not isinstance(source, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: source EXPECTED TYPE: str', None, None)
self.__source = source
self.__key_modified['source'] = 1
def get_type(self):
"""
The method to get the type
Returns:
string: A string representing the type
"""
return self.__type
def set_type(self, type):
"""
The method to set the value to type
Parameters:
type (string) : A string representing the type
"""
if type is not None and not isinstance(type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None)
self.__type = type
self.__key_modified['type'] = 1
def get_variable_group(self):
"""
The method to get the variable_group
Returns:
VariableGroup: An instance of VariableGroup
"""
return self.__variable_group
def set_variable_group(self, variable_group):
"""
The method to set the value to variable_group
Parameters:
variable_group (VariableGroup) : An instance of VariableGroup
"""
try:
from zcrmsdk.src.com.zoho.crm.api.variablegroups import VariableGroup
except Exception:
from ..variable_groups import VariableGroup
if variable_group is not None and not isinstance(variable_group, VariableGroup):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: variable_group EXPECTED TYPE: VariableGroup', None, None)
self.__variable_group = variable_group
self.__key_modified['variable_group'] = 1
def get_value(self):
"""
The method to get the value
Returns:
Object: A Object representing the value
"""
return self.__value
def set_value(self, value):
"""
The method to set the value to value
Parameters:
value (Object) : A Object representing the value
"""
self.__value = value
self.__key_modified['value'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/variable.py | variable.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.variables.action_response import ActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
class SuccessResponse(ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/variables/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.roles.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__roles = None
self.__key_modified = dict()
def get_roles(self):
"""
The method to get the roles
Returns:
list: An instance of list
"""
return self.__roles
def set_roles(self, roles):
"""
The method to set the value to roles
Parameters:
roles (list) : An instance of list
"""
if roles is not None and not isinstance(roles, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: roles EXPECTED TYPE: list', None, None)
self.__roles = roles
self.__key_modified['roles'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/roles/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.roles.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .response_handler import ResponseHandler
class APIException(ResponseHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/roles/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Role(object):
def __init__(self):
"""Creates an instance of Role"""
self.__display_label = None
self.__forecast_manager = None
self.__share_with_peers = None
self.__name = None
self.__description = None
self.__id = None
self.__reporting_to = None
self.__admin_user = None
self.__key_modified = dict()
def get_display_label(self):
"""
The method to get the display_label
Returns:
string: A string representing the display_label
"""
return self.__display_label
def set_display_label(self, display_label):
"""
The method to set the value to display_label
Parameters:
display_label (string) : A string representing the display_label
"""
if display_label is not None and not isinstance(display_label, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_label EXPECTED TYPE: str', None, None)
self.__display_label = display_label
self.__key_modified['display_label'] = 1
def get_forecast_manager(self):
"""
The method to get the forecast_manager
Returns:
User: An instance of User
"""
return self.__forecast_manager
def set_forecast_manager(self, forecast_manager):
"""
The method to set the value to forecast_manager
Parameters:
forecast_manager (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if forecast_manager is not None and not isinstance(forecast_manager, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: forecast_manager EXPECTED TYPE: User', None, None)
self.__forecast_manager = forecast_manager
self.__key_modified['forecast_manager'] = 1
def get_share_with_peers(self):
"""
The method to get the share_with_peers
Returns:
bool: A bool representing the share_with_peers
"""
return self.__share_with_peers
def set_share_with_peers(self, share_with_peers):
"""
The method to set the value to share_with_peers
Parameters:
share_with_peers (bool) : A bool representing the share_with_peers
"""
if share_with_peers is not None and not isinstance(share_with_peers, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: share_with_peers EXPECTED TYPE: bool', None, None)
self.__share_with_peers = share_with_peers
self.__key_modified['share_with_peers'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def get_description(self):
"""
The method to get the description
Returns:
string: A string representing the description
"""
return self.__description
def set_description(self, description):
"""
The method to set the value to description
Parameters:
description (string) : A string representing the description
"""
if description is not None and not isinstance(description, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: description EXPECTED TYPE: str', None, None)
self.__description = description
self.__key_modified['description'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_reporting_to(self):
"""
The method to get the reporting_to
Returns:
User: An instance of User
"""
return self.__reporting_to
def set_reporting_to(self, reporting_to):
"""
The method to set the value to reporting_to
Parameters:
reporting_to (User) : An instance of User
"""
try:
from zcrmsdk.src.com.zoho.crm.api.users import User
except Exception:
from ..users import User
if reporting_to is not None and not isinstance(reporting_to, User):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: reporting_to EXPECTED TYPE: User', None, None)
self.__reporting_to = reporting_to
self.__key_modified['reporting_to'] = 1
def get_admin_user(self):
"""
The method to get the admin_user
Returns:
bool: A bool representing the admin_user
"""
return self.__admin_user
def set_admin_user(self, admin_user):
"""
The method to set the value to admin_user
Parameters:
admin_user (bool) : A bool representing the admin_user
"""
if admin_user is not None and not isinstance(admin_user, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: admin_user EXPECTED TYPE: bool', None, None)
self.__admin_user = admin_user
self.__key_modified['admin_user'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/roles/role.py | role.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__pipeline = None
self.__key_modified = dict()
def get_pipeline(self):
"""
The method to get the pipeline
Returns:
list: An instance of list
"""
return self.__pipeline
def set_pipeline(self, pipeline):
"""
The method to set the value to pipeline
Parameters:
pipeline (list) : An instance of list
"""
if pipeline is not None and not isinstance(pipeline, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline EXPECTED TYPE: list', None, None)
self.__pipeline = pipeline
self.__key_modified['pipeline'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.pipeline.response_handler import ResponseHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .response_handler import ResponseHandler
class ResponseWrapper(ResponseHandler):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
super().__init__()
self.__pipeline = None
self.__key_modified = dict()
def get_pipeline(self):
"""
The method to get the pipeline
Returns:
list: An instance of list
"""
return self.__pipeline
def set_pipeline(self, pipeline):
"""
The method to set the value to pipeline
Parameters:
pipeline (list) : An instance of list
"""
if pipeline is not None and not isinstance(pipeline, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline EXPECTED TYPE: list', None, None)
self.__pipeline = pipeline
self.__key_modified['pipeline'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/response_wrapper.py | response_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Stage(object):
def __init__(self):
"""Creates an instance of Stage"""
self.__from_1 = None
self.__to = None
self.__key_modified = dict()
def get_from(self):
"""
The method to get the from
Returns:
int: An int representing the from_1
"""
return self.__from_1
def set_from(self, from_1):
"""
The method to set the value to from
Parameters:
from_1 (int) : An int representing the from_1
"""
if from_1 is not None and not isinstance(from_1, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: from_1 EXPECTED TYPE: int', None, None)
self.__from_1 = from_1
self.__key_modified['from'] = 1
def get_to(self):
"""
The method to get the to
Returns:
int: An int representing the to
"""
return self.__to
def set_to(self, to):
"""
The method to set the value to to
Parameters:
to (int) : An int representing the to
"""
if to is not None and not isinstance(to, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: to EXPECTED TYPE: int', None, None)
self.__to = to
self.__key_modified['to'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/stage.py | stage.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.pipeline.response_handler import ResponseHandler
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_action_handler import TransferActionHandler
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_action_response import TransferActionResponse
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .transfer_action_handler import TransferActionHandler
from .transfer_action_response import TransferActionResponse
from .action_handler import ActionHandler
class APIException(TransferActionResponse, TransferActionHandler, ResponseHandler, ActionResponse, ActionHandler):
def __init__(self):
"""Creates an instance of APIException"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/api_exception.py | api_exception.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import APIResponse, CommonAPIHandler, Constants
from zcrmsdk.src.com.zoho.crm.api.param import Param
except Exception:
from ..exception import SDKException
from ..util import APIResponse, CommonAPIHandler, Constants
from ..param import Param
class PipelineOperations(object):
def __init__(self, layout_id=None):
"""
Creates an instance of PipelineOperations with the given parameters
Parameters:
layout_id (int) : An int representing the layout_id
"""
if layout_id is not None and not isinstance(layout_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: layout_id EXPECTED TYPE: int', None, None)
self.__layout_id = layout_id
def transfer_and_delete(self, request):
"""
The method to transfer and delete
Parameters:
request (TransferAndDeleteWrapper) : An instance of TransferAndDeleteWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_and_delete_wrapper import TransferAndDeleteWrapper
except Exception:
from .transfer_and_delete_wrapper import TransferAndDeleteWrapper
if request is not None and not isinstance(request, TransferAndDeleteWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: TransferAndDeleteWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline/actions/transfer'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.TransferAndDeleteParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_action_handler import TransferActionHandler
except Exception:
from .transfer_action_handler import TransferActionHandler
return handler_instance.api_call(TransferActionHandler.__module__, 'application/json')
def get_pipelines(self):
"""
The method to get pipelines
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.GetPipelinesParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def create_pipelines(self, request):
"""
The method to create pipelines
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_POST)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.CreatePipelinesParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def update_pipelines(self, request):
"""
The method to update pipelines
Parameters:
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline'
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.set_mandatory_checker(True)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.UpdatePipelinesParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_pipeline(self, pipeline_id):
"""
The method to get pipeline
Parameters:
pipeline_id (int) : An int representing the pipeline_id
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
if not isinstance(pipeline_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline_id EXPECTED TYPE: int', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline/'
api_path = api_path + str(pipeline_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_GET)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.GetPipelineParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.response_handler import ResponseHandler
except Exception:
from .response_handler import ResponseHandler
return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def update_pipeline(self, pipeline_id, request):
"""
The method to update pipeline
Parameters:
pipeline_id (int) : An int representing the pipeline_id
request (BodyWrapper) : An instance of BodyWrapper
Returns:
APIResponse: An instance of APIResponse
Raises:
SDKException
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.body_wrapper import BodyWrapper
except Exception:
from .body_wrapper import BodyWrapper
if not isinstance(pipeline_id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline_id EXPECTED TYPE: int', None, None)
if request is not None and not isinstance(request, BodyWrapper):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None)
handler_instance = CommonAPIHandler()
api_path = ''
api_path = api_path + '/crm/v2.1/settings/pipeline/'
api_path = api_path + str(pipeline_id)
handler_instance.set_api_path(api_path)
handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
handler_instance.set_content_type('application/json')
handler_instance.set_request(request)
handler_instance.add_param(Param('layout_id', 'com.zoho.crm.api.Pipeline.UpdatePipelineParam'), self.__layout_id)
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler
except Exception:
from .action_handler import ActionHandler
return handler_instance.api_call(ActionHandler.__module__, 'application/json')
class TransferAndDeleteParam(object):
pass
class GetPipelinesParam(object):
pass
class CreatePipelinesParam(object):
pass
class UpdatePipelinesParam(object):
pass
class GetPipelineParam(object):
pass
class UpdatePipelineParam(object):
pass | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/pipeline_operations.py | pipeline_operations.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Pipeline(object):
def __init__(self):
"""Creates an instance of Pipeline"""
self.__from_1 = None
self.__to = None
self.__parent = None
self.__child_available = None
self.__display_value = None
self.__default = None
self.__maps = None
self.__actual_value = None
self.__id = None
self.__key_modified = dict()
def get_from(self):
"""
The method to get the from
Returns:
int: An int representing the from_1
"""
return self.__from_1
def set_from(self, from_1):
"""
The method to set the value to from
Parameters:
from_1 (int) : An int representing the from_1
"""
if from_1 is not None and not isinstance(from_1, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: from_1 EXPECTED TYPE: int', None, None)
self.__from_1 = from_1
self.__key_modified['from'] = 1
def get_to(self):
"""
The method to get the to
Returns:
int: An int representing the to
"""
return self.__to
def set_to(self, to):
"""
The method to set the value to to
Parameters:
to (int) : An int representing the to
"""
if to is not None and not isinstance(to, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: to EXPECTED TYPE: int', None, None)
self.__to = to
self.__key_modified['to'] = 1
def get_parent(self):
"""
The method to get the parent
Returns:
Pipeline: An instance of Pipeline
"""
return self.__parent
def set_parent(self, parent):
"""
The method to set the value to parent
Parameters:
parent (Pipeline) : An instance of Pipeline
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.pipeline import Pipeline
except Exception:
from .pipeline import Pipeline
if parent is not None and not isinstance(parent, Pipeline):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: parent EXPECTED TYPE: Pipeline', None, None)
self.__parent = parent
self.__key_modified['parent'] = 1
def get_child_available(self):
"""
The method to get the child_available
Returns:
bool: A bool representing the child_available
"""
return self.__child_available
def set_child_available(self, child_available):
"""
The method to set the value to child_available
Parameters:
child_available (bool) : A bool representing the child_available
"""
if child_available is not None and not isinstance(child_available, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: child_available EXPECTED TYPE: bool', None, None)
self.__child_available = child_available
self.__key_modified['child_available'] = 1
def get_display_value(self):
"""
The method to get the display_value
Returns:
string: A string representing the display_value
"""
return self.__display_value
def set_display_value(self, display_value):
"""
The method to set the value to display_value
Parameters:
display_value (string) : A string representing the display_value
"""
if display_value is not None and not isinstance(display_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_value EXPECTED TYPE: str', None, None)
self.__display_value = display_value
self.__key_modified['display_value'] = 1
def get_default(self):
"""
The method to get the default
Returns:
bool: A bool representing the default
"""
return self.__default
def set_default(self, default):
"""
The method to set the value to default
Parameters:
default (bool) : A bool representing the default
"""
if default is not None and not isinstance(default, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: default EXPECTED TYPE: bool', None, None)
self.__default = default
self.__key_modified['default'] = 1
def get_maps(self):
"""
The method to get the maps
Returns:
list: An instance of list
"""
return self.__maps
def set_maps(self, maps):
"""
The method to set the value to maps
Parameters:
maps (list) : An instance of list
"""
if maps is not None and not isinstance(maps, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: maps EXPECTED TYPE: list', None, None)
self.__maps = maps
self.__key_modified['maps'] = 1
def get_actual_value(self):
"""
The method to get the actual_value
Returns:
string: A string representing the actual_value
"""
return self.__actual_value
def set_actual_value(self, actual_value):
"""
The method to set the value to actual_value
Parameters:
actual_value (string) : A string representing the actual_value
"""
if actual_value is not None and not isinstance(actual_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: actual_value EXPECTED TYPE: str', None, None)
self.__actual_value = actual_value
self.__key_modified['actual_value'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/pipeline.py | pipeline.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class TransferPipeLine(object):
def __init__(self):
"""Creates an instance of TransferPipeLine"""
self.__pipeline = None
self.__stages = None
self.__key_modified = dict()
def get_pipeline(self):
"""
The method to get the pipeline
Returns:
Pipeline: An instance of Pipeline
"""
return self.__pipeline
def set_pipeline(self, pipeline):
"""
The method to set the value to pipeline
Parameters:
pipeline (Pipeline) : An instance of Pipeline
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.pipeline import Pipeline
except Exception:
from .pipeline import Pipeline
if pipeline is not None and not isinstance(pipeline, Pipeline):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline EXPECTED TYPE: Pipeline', None, None)
self.__pipeline = pipeline
self.__key_modified['pipeline'] = 1
def get_stages(self):
"""
The method to get the stages
Returns:
list: An instance of list
"""
return self.__stages
def set_stages(self, stages):
"""
The method to set the value to stages
Parameters:
stages (list) : An instance of list
"""
if stages is not None and not isinstance(stages, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: stages EXPECTED TYPE: list', None, None)
self.__stages = stages
self.__key_modified['stages'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/transfer_pipe_line.py | transfer_pipe_line.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class PickListValue(object):
def __init__(self):
"""Creates an instance of PickListValue"""
self.__display_value = None
self.__delete = None
self.__sequence_number = None
self.__actual_value = None
self.__id = None
self.__forecast_type = None
self.__forecast_category = None
self.__key_modified = dict()
def get_display_value(self):
"""
The method to get the display_value
Returns:
string: A string representing the display_value
"""
return self.__display_value
def set_display_value(self, display_value):
"""
The method to set the value to display_value
Parameters:
display_value (string) : A string representing the display_value
"""
if display_value is not None and not isinstance(display_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_value EXPECTED TYPE: str', None, None)
self.__display_value = display_value
self.__key_modified['display_value'] = 1
def get_delete(self):
"""
The method to get the delete
Returns:
bool: A bool representing the delete
"""
return self.__delete
def set_delete(self, delete):
"""
The method to set the value to delete
Parameters:
delete (bool) : A bool representing the delete
"""
if delete is not None and not isinstance(delete, bool):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: delete EXPECTED TYPE: bool', None, None)
self.__delete = delete
self.__key_modified['_delete'] = 1
def get_sequence_number(self):
"""
The method to get the sequence_number
Returns:
int: An int representing the sequence_number
"""
return self.__sequence_number
def set_sequence_number(self, sequence_number):
"""
The method to set the value to sequence_number
Parameters:
sequence_number (int) : An int representing the sequence_number
"""
if sequence_number is not None and not isinstance(sequence_number, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sequence_number EXPECTED TYPE: int', None, None)
self.__sequence_number = sequence_number
self.__key_modified['sequence_number'] = 1
def get_actual_value(self):
"""
The method to get the actual_value
Returns:
string: A string representing the actual_value
"""
return self.__actual_value
def set_actual_value(self, actual_value):
"""
The method to set the value to actual_value
Parameters:
actual_value (string) : A string representing the actual_value
"""
if actual_value is not None and not isinstance(actual_value, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: actual_value EXPECTED TYPE: str', None, None)
self.__actual_value = actual_value
self.__key_modified['actual_value'] = 1
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_forecast_type(self):
"""
The method to get the forecast_type
Returns:
string: A string representing the forecast_type
"""
return self.__forecast_type
def set_forecast_type(self, forecast_type):
"""
The method to set the value to forecast_type
Parameters:
forecast_type (string) : A string representing the forecast_type
"""
if forecast_type is not None and not isinstance(forecast_type, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: forecast_type EXPECTED TYPE: str', None, None)
self.__forecast_type = forecast_type
self.__key_modified['forecast_type'] = 1
def get_forecast_category(self):
"""
The method to get the forecast_category
Returns:
ForecastCategory: An instance of ForecastCategory
"""
return self.__forecast_category
def set_forecast_category(self, forecast_category):
"""
The method to set the value to forecast_category
Parameters:
forecast_category (ForecastCategory) : An instance of ForecastCategory
"""
try:
from zcrmsdk.src.com.zoho.crm.api.pipeline.forecast_category import ForecastCategory
except Exception:
from .forecast_category import ForecastCategory
if forecast_category is not None and not isinstance(forecast_category, ForecastCategory):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: forecast_category EXPECTED TYPE: ForecastCategory', None, None)
self.__forecast_category = forecast_category
self.__key_modified['forecast_category'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/pick_list_value.py | pick_list_value.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class TransferAndDeleteWrapper(object):
def __init__(self):
"""Creates an instance of TransferAndDeleteWrapper"""
self.__transfer_pipeline = None
self.__key_modified = dict()
def get_transfer_pipeline(self):
"""
The method to get the transfer_pipeline
Returns:
list: An instance of list
"""
return self.__transfer_pipeline
def set_transfer_pipeline(self, transfer_pipeline):
"""
The method to set the value to transfer_pipeline
Parameters:
transfer_pipeline (list) : An instance of list
"""
if transfer_pipeline is not None and not isinstance(transfer_pipeline, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: transfer_pipeline EXPECTED TYPE: list', None, None)
self.__transfer_pipeline = transfer_pipeline
self.__key_modified['transfer_pipeline'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/transfer_and_delete_wrapper.py | transfer_and_delete_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class ForecastCategory(object):
def __init__(self):
"""Creates an instance of ForecastCategory"""
self.__id = None
self.__name = None
self.__key_modified = dict()
def get_id(self):
"""
The method to get the id
Returns:
int: An int representing the id
"""
return self.__id
def set_id(self, id):
"""
The method to set the value to id
Parameters:
id (int) : An int representing the id
"""
if id is not None and not isinstance(id, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)
self.__id = id
self.__key_modified['id'] = 1
def get_name(self):
"""
The method to get the name
Returns:
string: A string representing the name
"""
return self.__name
def set_name(self, name):
"""
The method to set the value to name
Parameters:
name (string) : A string representing the name
"""
if name is not None and not isinstance(name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None)
self.__name = name
self.__key_modified['name'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/forecast_category.py | forecast_category.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_action_handler import TransferActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .transfer_action_handler import TransferActionHandler
class TransferActionWrapper(TransferActionHandler):
def __init__(self):
"""Creates an instance of TransferActionWrapper"""
super().__init__()
self.__transfer_pipeline = None
self.__key_modified = dict()
def get_transfer_pipeline(self):
"""
The method to get the transfer_pipeline
Returns:
list: An instance of list
"""
return self.__transfer_pipeline
def set_transfer_pipeline(self, transfer_pipeline):
"""
The method to set the value to transfer_pipeline
Parameters:
transfer_pipeline (list) : An instance of list
"""
if transfer_pipeline is not None and not isinstance(transfer_pipeline, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: transfer_pipeline EXPECTED TYPE: list', None, None)
self.__transfer_pipeline = transfer_pipeline
self.__key_modified['transfer_pipeline'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/transfer_action_wrapper.py | transfer_action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Choice, Constants
from zcrmsdk.src.com.zoho.crm.api.pipeline.action_response import ActionResponse
from zcrmsdk.src.com.zoho.crm.api.pipeline.transfer_action_response import TransferActionResponse
except Exception:
from ..exception import SDKException
from ..util import Choice, Constants
from .action_response import ActionResponse
from .transfer_action_response import TransferActionResponse
class SuccessResponse(TransferActionResponse, ActionResponse):
def __init__(self):
"""Creates an instance of SuccessResponse"""
super().__init__()
self.__status = None
self.__code = None
self.__message = None
self.__details = None
self.__key_modified = dict()
def get_status(self):
"""
The method to get the status
Returns:
Choice: An instance of Choice
"""
return self.__status
def set_status(self, status):
"""
The method to set the value to status
Parameters:
status (Choice) : An instance of Choice
"""
if status is not None and not isinstance(status, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: Choice', None, None)
self.__status = status
self.__key_modified['status'] = 1
def get_code(self):
"""
The method to get the code
Returns:
Choice: An instance of Choice
"""
return self.__code
def set_code(self, code):
"""
The method to set the value to code
Parameters:
code (Choice) : An instance of Choice
"""
if code is not None and not isinstance(code, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: Choice', None, None)
self.__code = code
self.__key_modified['code'] = 1
def get_message(self):
"""
The method to get the message
Returns:
Choice: An instance of Choice
"""
return self.__message
def set_message(self, message):
"""
The method to set the value to message
Parameters:
message (Choice) : An instance of Choice
"""
if message is not None and not isinstance(message, Choice):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: Choice', None, None)
self.__message = message
self.__key_modified['message'] = 1
def get_details(self):
"""
The method to get the details
Returns:
dict: An instance of dict
"""
return self.__details
def set_details(self, details):
"""
The method to set the value to details
Parameters:
details (dict) : An instance of dict
"""
if details is not None and not isinstance(details, dict):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: details EXPECTED TYPE: dict', None, None)
self.__details = details
self.__key_modified['details'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/pipeline/success_response.py | success_response.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
from zcrmsdk.src.com.zoho.crm.api.record.action_handler import ActionHandler
except Exception:
from ..exception import SDKException
from ..util import Constants
from .action_handler import ActionHandler
class ActionWrapper(ActionHandler):
def __init__(self):
"""Creates an instance of ActionWrapper"""
super().__init__()
self.__data = None
self.__key_modified = dict()
def get_data(self):
"""
The method to get the data
Returns:
list: An instance of list
"""
return self.__data
def set_data(self, data):
"""
The method to set the value to data
Parameters:
data (list) : An instance of list
"""
if data is not None and not isinstance(data, list):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: data EXPECTED TYPE: list', None, None)
self.__data = data
self.__key_modified['data'] = 1
def is_key_modified(self, key):
"""
The method to check if the user has modified the given key
Parameters:
key (string) : A string representing the key
Returns:
int: An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if key in self.__key_modified:
return self.__key_modified.get(key)
return None
def set_key_modified(self, key, modification):
"""
The method to mark the given key as modified
Parameters:
key (string) : A string representing the key
modification (int) : An int representing the modification
"""
if key is not None and not isinstance(key, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None)
if modification is not None and not isinstance(modification, int):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None)
self.__key_modified[key] = modification | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/record/action_wrapper.py | action_wrapper.py |
try:
from zcrmsdk.src.com.zoho.crm.api.exception import SDKException
from zcrmsdk.src.com.zoho.crm.api.util import Constants
except Exception:
from ..exception import SDKException
from ..util import Constants
class Field(object):
def __init__(self, api_name):
"""
Creates an instance of Field with the given parameters
Parameters:
api_name (string) : A string representing the api_name
"""
if api_name is not None and not isinstance(api_name, str):
raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None)
self.__api_name = api_name
def get_api_name(self):
"""
The method to get the api_name
Returns:
string: A string representing the api_name
"""
return self.__api_name
class Products(object):
@classmethod
def product_category(cls):
return Field('Product_Category')
@classmethod
def qty_in_demand(cls):
return Field('Qty_in_Demand')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def vendor_name(cls):
return Field('Vendor_Name')
@classmethod
def tax(cls):
return Field('Tax')
@classmethod
def sales_start_date(cls):
return Field('Sales_Start_Date')
@classmethod
def product_active(cls):
return Field('Product_Active')
@classmethod
def record_image(cls):
return Field('Record_Image')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def product_code(cls):
return Field('Product_Code')
@classmethod
def manufacturer(cls):
return Field('Manufacturer')
@classmethod
def id(cls):
return Field('id')
@classmethod
def support_expiry_date(cls):
return Field('Support_Expiry_Date')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def commission_rate(cls):
return Field('Commission_Rate')
@classmethod
def product_name(cls):
return Field('Product_Name')
@classmethod
def handler(cls):
return Field('Handler')
@classmethod
def support_start_date(cls):
return Field('Support_Start_Date')
@classmethod
def usage_unit(cls):
return Field('Usage_Unit')
@classmethod
def qty_ordered(cls):
return Field('Qty_Ordered')
@classmethod
def qty_in_stock(cls):
return Field('Qty_in_Stock')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def sales_end_date(cls):
return Field('Sales_End_Date')
@classmethod
def unit_price(cls):
return Field('Unit_Price')
@classmethod
def taxable(cls):
return Field('Taxable')
@classmethod
def reorder_level(cls):
return Field('Reorder_Level')
class Tasks(object):
@classmethod
def status(cls):
return Field('Status')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def due_date(cls):
return Field('Due_Date')
@classmethod
def priority(cls):
return Field('Priority')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def closed_time(cls):
return Field('Closed_Time')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def send_notification_email(cls):
return Field('Send_Notification_Email')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def recurring_activity(cls):
return Field('Recurring_Activity')
@classmethod
def what_id(cls):
return Field('What_Id')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def remind_at(cls):
return Field('Remind_At')
@classmethod
def who_id(cls):
return Field('Who_Id')
class Vendors(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def email(cls):
return Field('Email')
@classmethod
def category(cls):
return Field('Category')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def vendor_name(cls):
return Field('Vendor_Name')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def website(cls):
return Field('Website')
@classmethod
def city(cls):
return Field('City')
@classmethod
def record_image(cls):
return Field('Record_Image')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def phone(cls):
return Field('Phone')
@classmethod
def state(cls):
return Field('State')
@classmethod
def gl_account(cls):
return Field('GL_Account')
@classmethod
def street(cls):
return Field('Street')
@classmethod
def country(cls):
return Field('Country')
@classmethod
def zip_code(cls):
return Field('Zip_Code')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
class Calls(object):
@classmethod
def call_duration(cls):
return Field('Call_Duration')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def reminder(cls):
return Field('Reminder')
@classmethod
def caller_id(cls):
return Field('Caller_ID')
@classmethod
def cti_entry(cls):
return Field('CTI_Entry')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def call_start_time(cls):
return Field('Call_Start_Time')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def call_agenda(cls):
return Field('Call_Agenda')
@classmethod
def call_result(cls):
return Field('Call_Result')
@classmethod
def call_type(cls):
return Field('Call_Type')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def what_id(cls):
return Field('What_Id')
@classmethod
def call_duration_in_seconds(cls):
return Field('Call_Duration_in_seconds')
@classmethod
def call_purpose(cls):
return Field('Call_Purpose')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def dialled_number(cls):
return Field('Dialled_Number')
@classmethod
def call_status(cls):
return Field('Call_Status')
@classmethod
def who_id(cls):
return Field('Who_Id')
class Leads(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def company(cls):
return Field('Company')
@classmethod
def email(cls):
return Field('Email')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def rating(cls):
return Field('Rating')
@classmethod
def website(cls):
return Field('Website')
@classmethod
def twitter(cls):
return Field('Twitter')
@classmethod
def salutation(cls):
return Field('Salutation')
@classmethod
def last_activity_time(cls):
return Field('Last_Activity_Time')
@classmethod
def first_name(cls):
return Field('First_Name')
@classmethod
def full_name(cls):
return Field('Full_Name')
@classmethod
def lead_status(cls):
return Field('Lead_Status')
@classmethod
def industry(cls):
return Field('Industry')
@classmethod
def record_image(cls):
return Field('Record_Image')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def skype_id(cls):
return Field('Skype_ID')
@classmethod
def phone(cls):
return Field('Phone')
@classmethod
def street(cls):
return Field('Street')
@classmethod
def zip_code(cls):
return Field('Zip_Code')
@classmethod
def id(cls):
return Field('id')
@classmethod
def email_opt_out(cls):
return Field('Email_Opt_Out')
@classmethod
def designation(cls):
return Field('Designation')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def city(cls):
return Field('City')
@classmethod
def no_of_employees(cls):
return Field('No_of_Employees')
@classmethod
def mobile(cls):
return Field('Mobile')
@classmethod
def converted_date_time(cls):
return Field('Converted_Date_Time')
@classmethod
def last_name(cls):
return Field('Last_Name')
@classmethod
def layout(cls):
return Field('Layout')
@classmethod
def state(cls):
return Field('State')
@classmethod
def lead_source(cls):
return Field('Lead_Source')
@classmethod
def is_record_duplicate(cls):
return Field('Is_Record_Duplicate')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def fax(cls):
return Field('Fax')
@classmethod
def annual_revenue(cls):
return Field('Annual_Revenue')
@classmethod
def secondary_email(cls):
return Field('Secondary_Email')
class Deals(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def campaign_source(cls):
return Field('Campaign_Source')
@classmethod
def closing_date(cls):
return Field('Closing_Date')
@classmethod
def last_activity_time(cls):
return Field('Last_Activity_Time')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def lead_conversion_time(cls):
return Field('Lead_Conversion_Time')
@classmethod
def deal_name(cls):
return Field('Deal_Name')
@classmethod
def expected_revenue(cls):
return Field('Expected_Revenue')
@classmethod
def overall_sales_duration(cls):
return Field('Overall_Sales_Duration')
@classmethod
def stage(cls):
return Field('Stage')
@classmethod
def id(cls):
return Field('id')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def territory(cls):
return Field('Territory')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def amount(cls):
return Field('Amount')
@classmethod
def probability(cls):
return Field('Probability')
@classmethod
def next_step(cls):
return Field('Next_Step')
@classmethod
def contact_name(cls):
return Field('Contact_Name')
@classmethod
def sales_cycle_duration(cls):
return Field('Sales_Cycle_Duration')
@classmethod
def type(cls):
return Field('Type')
@classmethod
def deal_category_status(cls):
return Field('Deal_Category_Status')
@classmethod
def lead_source(cls):
return Field('Lead_Source')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
class Campaigns(object):
@classmethod
def status(cls):
return Field('Status')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def campaign_name(cls):
return Field('Campaign_Name')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def end_date(cls):
return Field('End_Date')
@classmethod
def type(cls):
return Field('Type')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def num_sent(cls):
return Field('Num_sent')
@classmethod
def expected_revenue(cls):
return Field('Expected_Revenue')
@classmethod
def actual_cost(cls):
return Field('Actual_Cost')
@classmethod
def id(cls):
return Field('id')
@classmethod
def expected_response(cls):
return Field('Expected_Response')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def parent_campaign(cls):
return Field('Parent_Campaign')
@classmethod
def start_date(cls):
return Field('Start_Date')
@classmethod
def budgeted_cost(cls):
return Field('Budgeted_Cost')
class Quotes(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def discount(cls):
return Field('Discount')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def shipping_state(cls):
return Field('Shipping_State')
@classmethod
def tax(cls):
return Field('Tax')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def deal_name(cls):
return Field('Deal_Name')
@classmethod
def valid_till(cls):
return Field('Valid_Till')
@classmethod
def billing_country(cls):
return Field('Billing_Country')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def team(cls):
return Field('Team')
@classmethod
def id(cls):
return Field('id')
@classmethod
def carrier(cls):
return Field('Carrier')
@classmethod
def quoted_items(cls):
return Field('Quoted_Items')
@classmethod
def quote_stage(cls):
return Field('Quote_Stage')
@classmethod
def grand_total(cls):
return Field('Grand_Total')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def billing_street(cls):
return Field('Billing_Street')
@classmethod
def adjustment(cls):
return Field('Adjustment')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def terms_and_conditions(cls):
return Field('Terms_and_Conditions')
@classmethod
def sub_total(cls):
return Field('Sub_Total')
@classmethod
def billing_code(cls):
return Field('Billing_Code')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def contact_name(cls):
return Field('Contact_Name')
@classmethod
def shipping_city(cls):
return Field('Shipping_City')
@classmethod
def shipping_country(cls):
return Field('Shipping_Country')
@classmethod
def shipping_code(cls):
return Field('Shipping_Code')
@classmethod
def billing_city(cls):
return Field('Billing_City')
@classmethod
def quote_number(cls):
return Field('Quote_Number')
@classmethod
def billing_state(cls):
return Field('Billing_State')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def shipping_street(cls):
return Field('Shipping_Street')
class Invoices(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def discount(cls):
return Field('Discount')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def shipping_state(cls):
return Field('Shipping_State')
@classmethod
def tax(cls):
return Field('Tax')
@classmethod
def invoice_date(cls):
return Field('Invoice_Date')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def invoiced_items(cls):
return Field('Invoiced_Items')
@classmethod
def billing_country(cls):
return Field('Billing_Country')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def sales_order(cls):
return Field('Sales_Order')
@classmethod
def status(cls):
return Field('Status')
@classmethod
def grand_total(cls):
return Field('Grand_Total')
@classmethod
def sales_commission(cls):
return Field('Sales_Commission')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def due_date(cls):
return Field('Due_Date')
@classmethod
def billing_street(cls):
return Field('Billing_Street')
@classmethod
def adjustment(cls):
return Field('Adjustment')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def terms_and_conditions(cls):
return Field('Terms_and_Conditions')
@classmethod
def sub_total(cls):
return Field('Sub_Total')
@classmethod
def invoice_number(cls):
return Field('Invoice_Number')
@classmethod
def billing_code(cls):
return Field('Billing_Code')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def contact_name(cls):
return Field('Contact_Name')
@classmethod
def excise_duty(cls):
return Field('Excise_Duty')
@classmethod
def shipping_city(cls):
return Field('Shipping_City')
@classmethod
def shipping_country(cls):
return Field('Shipping_Country')
@classmethod
def shipping_code(cls):
return Field('Shipping_Code')
@classmethod
def billing_city(cls):
return Field('Billing_City')
@classmethod
def purchase_order(cls):
return Field('Purchase_Order')
@classmethod
def billing_state(cls):
return Field('Billing_State')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def shipping_street(cls):
return Field('Shipping_Street')
class Attachments(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def file_name(cls):
return Field('File_Name')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def size(cls):
return Field('Size')
@classmethod
def parent_id(cls):
return Field('Parent_Id')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
class Price_Books(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def active(cls):
return Field('Active')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def pricing_details(cls):
return Field('Pricing_Details')
@classmethod
def pricing_model(cls):
return Field('Pricing_Model')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def price_book_name(cls):
return Field('Price_Book_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
class Sales_Orders(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def discount(cls):
return Field('Discount')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def customer_no(cls):
return Field('Customer_No')
@classmethod
def shipping_state(cls):
return Field('Shipping_State')
@classmethod
def tax(cls):
return Field('Tax')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def deal_name(cls):
return Field('Deal_Name')
@classmethod
def billing_country(cls):
return Field('Billing_Country')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def carrier(cls):
return Field('Carrier')
@classmethod
def ordered_items(cls):
return Field('Ordered_Items')
@classmethod
def quote_name(cls):
return Field('Quote_Name')
@classmethod
def status(cls):
return Field('Status')
@classmethod
def sales_commission(cls):
return Field('Sales_Commission')
@classmethod
def grand_total(cls):
return Field('Grand_Total')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def due_date(cls):
return Field('Due_Date')
@classmethod
def billing_street(cls):
return Field('Billing_Street')
@classmethod
def adjustment(cls):
return Field('Adjustment')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def terms_and_conditions(cls):
return Field('Terms_and_Conditions')
@classmethod
def sub_total(cls):
return Field('Sub_Total')
@classmethod
def billing_code(cls):
return Field('Billing_Code')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def contact_name(cls):
return Field('Contact_Name')
@classmethod
def excise_duty(cls):
return Field('Excise_Duty')
@classmethod
def shipping_city(cls):
return Field('Shipping_City')
@classmethod
def shipping_country(cls):
return Field('Shipping_Country')
@classmethod
def shipping_code(cls):
return Field('Shipping_Code')
@classmethod
def billing_city(cls):
return Field('Billing_City')
@classmethod
def so_number(cls):
return Field('SO_Number')
@classmethod
def purchase_order(cls):
return Field('Purchase_Order')
@classmethod
def billing_state(cls):
return Field('Billing_State')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def pending(cls):
return Field('Pending')
@classmethod
def shipping_street(cls):
return Field('Shipping_Street')
class Contacts(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def email(cls):
return Field('Email')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def vendor_name(cls):
return Field('Vendor_Name')
@classmethod
def mailing_zip(cls):
return Field('Mailing_Zip')
@classmethod
def reports_to(cls):
return Field('Reports_To')
@classmethod
def other_phone(cls):
return Field('Other_Phone')
@classmethod
def mailing_state(cls):
return Field('Mailing_State')
@classmethod
def twitter(cls):
return Field('Twitter')
@classmethod
def other_zip(cls):
return Field('Other_Zip')
@classmethod
def mailing_street(cls):
return Field('Mailing_Street')
@classmethod
def other_state(cls):
return Field('Other_State')
@classmethod
def salutation(cls):
return Field('Salutation')
@classmethod
def other_country(cls):
return Field('Other_Country')
@classmethod
def last_activity_time(cls):
return Field('Last_Activity_Time')
@classmethod
def first_name(cls):
return Field('First_Name')
@classmethod
def full_name(cls):
return Field('Full_Name')
@classmethod
def asst_phone(cls):
return Field('Asst_Phone')
@classmethod
def record_image(cls):
return Field('Record_Image')
@classmethod
def department(cls):
return Field('Department')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def skype_id(cls):
return Field('Skype_ID')
@classmethod
def assistant(cls):
return Field('Assistant')
@classmethod
def phone(cls):
return Field('Phone')
@classmethod
def mailing_country(cls):
return Field('Mailing_Country')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def email_opt_out(cls):
return Field('Email_Opt_Out')
@classmethod
def reporting_to(cls):
return Field('Reporting_To')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def date_of_birth(cls):
return Field('Date_of_Birth')
@classmethod
def mailing_city(cls):
return Field('Mailing_City')
@classmethod
def other_city(cls):
return Field('Other_City')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def title(cls):
return Field('Title')
@classmethod
def other_street(cls):
return Field('Other_Street')
@classmethod
def mobile(cls):
return Field('Mobile')
@classmethod
def territories(cls):
return Field('Territories')
@classmethod
def home_phone(cls):
return Field('Home_Phone')
@classmethod
def last_name(cls):
return Field('Last_Name')
@classmethod
def lead_source(cls):
return Field('Lead_Source')
@classmethod
def is_record_duplicate(cls):
return Field('Is_Record_Duplicate')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def fax(cls):
return Field('Fax')
@classmethod
def secondary_email(cls):
return Field('Secondary_Email')
class Solutions(object):
@classmethod
def status(cls):
return Field('Status')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def comments(cls):
return Field('Comments')
@classmethod
def no_of_comments(cls):
return Field('No_of_comments')
@classmethod
def product_name(cls):
return Field('Product_Name')
@classmethod
def add_comment(cls):
return Field('Add_Comment')
@classmethod
def solution_number(cls):
return Field('Solution_Number')
@classmethod
def answer(cls):
return Field('Answer')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def solution_title(cls):
return Field('Solution_Title')
@classmethod
def published(cls):
return Field('Published')
@classmethod
def question(cls):
return Field('Question')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
class Events(object):
@classmethod
def all_day(cls):
return Field('All_day')
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def check_in_state(cls):
return Field('Check_In_State')
@classmethod
def check_in_address(cls):
return Field('Check_In_Address')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def start_datetime(cls):
return Field('Start_DateTime')
@classmethod
def latitude(cls):
return Field('Latitude')
@classmethod
def participants(cls):
return Field('Participants')
@classmethod
def event_title(cls):
return Field('Event_Title')
@classmethod
def end_datetime(cls):
return Field('End_DateTime')
@classmethod
def check_in_by(cls):
return Field('Check_In_By')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def check_in_city(cls):
return Field('Check_In_City')
@classmethod
def id(cls):
return Field('id')
@classmethod
def check_in_comment(cls):
return Field('Check_In_Comment')
@classmethod
def remind_at(cls):
return Field('Remind_At')
@classmethod
def who_id(cls):
return Field('Who_Id')
@classmethod
def check_in_status(cls):
return Field('Check_In_Status')
@classmethod
def check_in_country(cls):
return Field('Check_In_Country')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def venue(cls):
return Field('Venue')
@classmethod
def zip_code(cls):
return Field('ZIP_Code')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def longitude(cls):
return Field('Longitude')
@classmethod
def check_in_time(cls):
return Field('Check_In_Time')
@classmethod
def recurring_activity(cls):
return Field('Recurring_Activity')
@classmethod
def what_id(cls):
return Field('What_Id')
@classmethod
def check_in_sub_locality(cls):
return Field('Check_In_Sub_Locality')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
class Purchase_Orders(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def discount(cls):
return Field('Discount')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def vendor_name(cls):
return Field('Vendor_Name')
@classmethod
def shipping_state(cls):
return Field('Shipping_State')
@classmethod
def tax(cls):
return Field('Tax')
@classmethod
def po_date(cls):
return Field('PO_Date')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def billing_country(cls):
return Field('Billing_Country')
@classmethod
def purchase_items(cls):
return Field('Purchase_Items')
@classmethod
def id(cls):
return Field('id')
@classmethod
def carrier(cls):
return Field('Carrier')
@classmethod
def status(cls):
return Field('Status')
@classmethod
def grand_total(cls):
return Field('Grand_Total')
@classmethod
def sales_commission(cls):
return Field('Sales_Commission')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def po_number(cls):
return Field('PO_Number')
@classmethod
def due_date(cls):
return Field('Due_Date')
@classmethod
def billing_street(cls):
return Field('Billing_Street')
@classmethod
def adjustment(cls):
return Field('Adjustment')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def terms_and_conditions(cls):
return Field('Terms_and_Conditions')
@classmethod
def sub_total(cls):
return Field('Sub_Total')
@classmethod
def billing_code(cls):
return Field('Billing_Code')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def tracking_number(cls):
return Field('Tracking_Number')
@classmethod
def contact_name(cls):
return Field('Contact_Name')
@classmethod
def excise_duty(cls):
return Field('Excise_Duty')
@classmethod
def shipping_city(cls):
return Field('Shipping_City')
@classmethod
def shipping_country(cls):
return Field('Shipping_Country')
@classmethod
def shipping_code(cls):
return Field('Shipping_Code')
@classmethod
def billing_city(cls):
return Field('Billing_City')
@classmethod
def requisition_no(cls):
return Field('Requisition_No')
@classmethod
def billing_state(cls):
return Field('Billing_State')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def shipping_street(cls):
return Field('Shipping_Street')
class Accounts(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def ownership(cls):
return Field('Ownership')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def account_type(cls):
return Field('Account_Type')
@classmethod
def rating(cls):
return Field('Rating')
@classmethod
def sic_code(cls):
return Field('SIC_Code')
@classmethod
def shipping_state(cls):
return Field('Shipping_State')
@classmethod
def website(cls):
return Field('Website')
@classmethod
def employees(cls):
return Field('Employees')
@classmethod
def last_activity_time(cls):
return Field('Last_Activity_Time')
@classmethod
def industry(cls):
return Field('Industry')
@classmethod
def record_image(cls):
return Field('Record_Image')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def account_site(cls):
return Field('Account_Site')
@classmethod
def phone(cls):
return Field('Phone')
@classmethod
def billing_country(cls):
return Field('Billing_Country')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def account_number(cls):
return Field('Account_Number')
@classmethod
def ticker_symbol(cls):
return Field('Ticker_Symbol')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def billing_street(cls):
return Field('Billing_Street')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def billing_code(cls):
return Field('Billing_Code')
@classmethod
def territories(cls):
return Field('Territories')
@classmethod
def parent_account(cls):
return Field('Parent_Account')
@classmethod
def shipping_city(cls):
return Field('Shipping_City')
@classmethod
def shipping_country(cls):
return Field('Shipping_Country')
@classmethod
def shipping_code(cls):
return Field('Shipping_Code')
@classmethod
def billing_city(cls):
return Field('Billing_City')
@classmethod
def billing_state(cls):
return Field('Billing_State')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def fax(cls):
return Field('Fax')
@classmethod
def annual_revenue(cls):
return Field('Annual_Revenue')
@classmethod
def shipping_street(cls):
return Field('Shipping_Street')
class Cases(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def email(cls):
return Field('Email')
@classmethod
def description(cls):
return Field('Description')
@classmethod
def internal_comments(cls):
return Field('Internal_Comments')
@classmethod
def no_of_comments(cls):
return Field('No_of_comments')
@classmethod
def reported_by(cls):
return Field('Reported_By')
@classmethod
def case_number(cls):
return Field('Case_Number')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def deal_name(cls):
return Field('Deal_Name')
@classmethod
def phone(cls):
return Field('Phone')
@classmethod
def account_name(cls):
return Field('Account_Name')
@classmethod
def id(cls):
return Field('id')
@classmethod
def solution(cls):
return Field('Solution')
@classmethod
def status(cls):
return Field('Status')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def priority(cls):
return Field('Priority')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def comments(cls):
return Field('Comments')
@classmethod
def product_name(cls):
return Field('Product_Name')
@classmethod
def add_comment(cls):
return Field('Add_Comment')
@classmethod
def case_origin(cls):
return Field('Case_Origin')
@classmethod
def subject(cls):
return Field('Subject')
@classmethod
def case_reason(cls):
return Field('Case_Reason')
@classmethod
def type(cls):
return Field('Type')
@classmethod
def is_record_duplicate(cls):
return Field('Is_Record_Duplicate')
@classmethod
def tag(cls):
return Field('Tag')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def related_to(cls):
return Field('Related_To')
class Notes(object):
@classmethod
def owner(cls):
return Field('Owner')
@classmethod
def modified_by(cls):
return Field('Modified_By')
@classmethod
def modified_time(cls):
return Field('Modified_Time')
@classmethod
def created_time(cls):
return Field('Created_Time')
@classmethod
def parent_id(cls):
return Field('Parent_Id')
@classmethod
def id(cls):
return Field('id')
@classmethod
def created_by(cls):
return Field('Created_By')
@classmethod
def note_title(cls):
return Field('Note_Title')
@classmethod
def note_content(cls):
return Field('Note_Content') | zohocrmsdk2-1 | /zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/record/field.py | field.py |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.