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 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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.1/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.1/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.1/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__field = 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_field(self): """ The method to get the field Returns: Field: An instance of Field """ return self.__field def set_field(self, field): """ The method to set the value to field Parameters: field (Field) : An instance of Field """ try: from zcrmsdk.src.com.zoho.crm.api.fields import Field except Exception: from ..fields import Field if field is not None and not isinstance(field, Field): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: field EXPECTED TYPE: Field', None, None) self.__field = field self.__key_modified['field'] = 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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.1/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.1/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.1/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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: 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.modules import Module except Exception: from ..modules 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_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.cancel_meetings.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/cancel_meetings/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 Notify(object): def __init__(self): """Creates an instance of Notify""" self.__send_cancelling_mail = None self.__key_modified = dict() def get_send_cancelling_mail(self): """ The method to get the send_cancelling_mail Returns: bool: A bool representing the send_cancelling_mail """ return self.__send_cancelling_mail def set_send_cancelling_mail(self, send_cancelling_mail): """ The method to set the value to send_cancelling_mail Parameters: send_cancelling_mail (bool) : A bool representing the send_cancelling_mail """ if send_cancelling_mail is not None and not isinstance(send_cancelling_mail, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: send_cancelling_mail EXPECTED TYPE: bool', None, None) self.__send_cancelling_mail = send_cancelling_mail self.__key_modified['send_cancelling_mail'] = 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/cancel_meetings/notify.py
notify.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.cancel_meetings.action_response import ActionResponse from zcrmsdk.src.com.zoho.crm.api.cancel_meetings.action_handler import ActionHandler except Exception: from ..exception import SDKException from ..util import Choice, Constants from .action_response import ActionResponse from .action_handler import ActionHandler class APIException(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/cancel_meetings/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 from zcrmsdk.src.com.zoho.crm.api.cancel_meetings.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.__code = None self.__message = None self.__status = 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_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_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_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/cancel_meetings/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.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 Maps(object): def __init__(self): """Creates an instance of Maps""" self.__api_name = None self.__pick_list_values = 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_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 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/fields/maps.py
maps.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 Field(object): def __init__(self): """Creates an instance of Field""" self.__system_mandatory = None self.__webhook = None self.__private = None self.__layouts = None self.__profiles = None self.__sequence_number = None self.__content = None self.__column_name = 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.__ui_type = 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.__filterable = None self.__visible = None self.__display_field = None self.__pick_list_values_sorted_lexically = None self.__length = None self.__view_type = None self.__subform = None self.__api_name = None self.__sortable = None self.__unique = None self.__data_type = None self.__formula = None self.__decimal_place = None self.__mass_update = None self.__blueprint_supported = None self.__multiselectlookup = None self.__multiuserlookup = None self.__pick_list_values = None self.__auto_number = None self.__default_value = None self.__validation_rule = None self.__convert_mapping = None self.__type = None self.__external = None self.__history_tracking = None self.__display_type = 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_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_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_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_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_ui_type(self): """ The method to get the ui_type Returns: int: An int representing the ui_type """ return self.__ui_type def set_ui_type(self, ui_type): """ The method to set the value to ui_type Parameters: ui_type (int) : An int representing the ui_type """ if ui_type is not None and not isinstance(ui_type, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: ui_type EXPECTED TYPE: int', None, None) self.__ui_type = ui_type self.__key_modified['ui_type'] = 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: MultiModuleLookup: An instance of MultiModuleLookup """ 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 (MultiModuleLookup) : An instance of MultiModuleLookup """ try: from zcrmsdk.src.com.zoho.crm.api.fields.multi_module_lookup import MultiModuleLookup except Exception: from .multi_module_lookup import MultiModuleLookup if multi_module_lookup is not None and not isinstance(multi_module_lookup, MultiModuleLookup): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: multi_module_lookup EXPECTED TYPE: MultiModuleLookup', 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_filterable(self): """ The method to get the filterable Returns: bool: A bool representing the filterable """ return self.__filterable def set_filterable(self, filterable): """ The method to set the value to filterable Parameters: filterable (bool) : A bool representing the filterable """ if filterable is not None and not isinstance(filterable, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: filterable EXPECTED TYPE: bool', None, None) self.__filterable = filterable self.__key_modified['filterable'] = 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_display_field(self): """ The method to get the display_field Returns: bool: A bool 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 (bool) : A bool representing the display_field """ if display_field is not None and not isinstance(display_field, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_field EXPECTED TYPE: bool', None, None) self.__display_field = display_field self.__key_modified['display_field'] = 1 def get_pick_list_values_sorted_lexically(self): """ The method to get the pick_list_values_sorted_lexically Returns: bool: A bool representing the pick_list_values_sorted_lexically """ return self.__pick_list_values_sorted_lexically def set_pick_list_values_sorted_lexically(self, pick_list_values_sorted_lexically): """ The method to set the value to pick_list_values_sorted_lexically Parameters: pick_list_values_sorted_lexically (bool) : A bool representing the pick_list_values_sorted_lexically """ if pick_list_values_sorted_lexically is not None and not isinstance(pick_list_values_sorted_lexically, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pick_list_values_sorted_lexically EXPECTED TYPE: bool', None, None) self.__pick_list_values_sorted_lexically = pick_list_values_sorted_lexically self.__key_modified['pick_list_values_sorted_lexically'] = 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_sortable(self): """ The method to get the sortable Returns: bool: A bool representing the sortable """ return self.__sortable def set_sortable(self, sortable): """ The method to set the value to sortable Parameters: sortable (bool) : A bool representing the sortable """ if sortable is not None and not isinstance(sortable, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sortable EXPECTED TYPE: bool', None, None) self.__sortable = sortable self.__key_modified['sortable'] = 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_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_multiuserlookup(self): """ The method to get the multiuserlookup Returns: MultiUserLookup: An instance of MultiUserLookup """ return self.__multiuserlookup def set_multiuserlookup(self, multiuserlookup): """ The method to set the value to multiuserlookup Parameters: multiuserlookup (MultiUserLookup) : An instance of MultiUserLookup """ try: from zcrmsdk.src.com.zoho.crm.api.fields.multi_user_lookup import MultiUserLookup except Exception: from .multi_user_lookup import MultiUserLookup if multiuserlookup is not None and not isinstance(multiuserlookup, MultiUserLookup): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: multiuserlookup EXPECTED TYPE: MultiUserLookup', None, None) self.__multiuserlookup = multiuserlookup self.__key_modified['multiuserlookup'] = 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_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 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_external(self): """ The method to get the external Returns: External: An instance of External """ return self.__external def set_external(self, external): """ The method to set the value to external Parameters: external (External) : An instance of External """ try: from zcrmsdk.src.com.zoho.crm.api.fields.external import External except Exception: from .external import External if external is not None and not isinstance(external, External): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: external EXPECTED TYPE: External', None, None) self.__external = external self.__key_modified['external'] = 1 def get_history_tracking(self): """ The method to get the history_tracking Returns: HistoryTracking: An instance of HistoryTracking """ return self.__history_tracking def set_history_tracking(self, history_tracking): """ The method to set the value to history_tracking Parameters: history_tracking (HistoryTracking) : An instance of HistoryTracking """ try: from zcrmsdk.src.com.zoho.crm.api.fields.history_tracking import HistoryTracking except Exception: from .history_tracking import HistoryTracking if history_tracking is not None and not isinstance(history_tracking, HistoryTracking): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: history_tracking EXPECTED TYPE: HistoryTracking', None, None) self.__history_tracking = history_tracking self.__key_modified['history_tracking'] = 1 def get_display_type(self): """ The method to get the display_type Returns: Choice: An instance of Choice """ return self.__display_type def set_display_type(self, display_type): """ The method to set the value to display_type Parameters: display_type (Choice) : An instance of Choice """ if display_type is not None and not isinstance(display_type, Choice): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_type EXPECTED TYPE: Choice', None, None) self.__display_type = display_type self.__key_modified['display_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/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__field_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_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_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 MultiUserLookup(object): def __init__(self): """Creates an instance of MultiUserLookup""" self.__display_label = None self.__linking_module = None self.__lookup_apiname = None self.__api_name = None self.__connected_module = 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_connected_module(self): """ The method to get the connected_module Returns: string: A string representing the connected_module """ return self.__connected_module def set_connected_module(self, connected_module): """ The method to set the value to connected_module Parameters: connected_module (string) : A string representing the connected_module """ if connected_module is not None and not isinstance(connected_module, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: connected_module EXPECTED TYPE: str', None, None) self.__connected_module = connected_module self.__key_modified['connected_module'] = 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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/fields/multi_user_lookup.py
multi_user_lookup.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 HistoryTracking(object): def __init__(self): """Creates an instance of HistoryTracking""" self.__module = None self.__duration_configured_field = None self.__key_modified = dict() 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_duration_configured_field(self): """ The method to get the duration_configured_field Returns: Field: An instance of Field """ return self.__duration_configured_field def set_duration_configured_field(self, duration_configured_field): """ The method to set the value to duration_configured_field Parameters: duration_configured_field (Field) : An instance of Field """ try: from zcrmsdk.src.com.zoho.crm.api.fields.field import Field except Exception: from .field import Field if duration_configured_field is not None and not isinstance(duration_configured_field, Field): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: duration_configured_field EXPECTED TYPE: Field', None, None) self.__duration_configured_field = duration_configured_field self.__key_modified['duration_configured_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/fields/history_tracking.py
history_tracking.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 External(object): def __init__(self): """Creates an instance of External""" self.__show = None self.__type = None self.__allow_multiple_config = None self.__key_modified = dict() def get_show(self): """ The method to get the show Returns: bool: A bool representing the show """ return self.__show def set_show(self, show): """ The method to set the value to show Parameters: show (bool) : A bool representing the show """ if show is not None and not isinstance(show, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: show EXPECTED TYPE: bool', None, None) self.__show = show self.__key_modified['show'] = 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_allow_multiple_config(self): """ The method to get the allow_multiple_config Returns: bool: A bool representing the allow_multiple_config """ return self.__allow_multiple_config def set_allow_multiple_config(self, allow_multiple_config): """ The method to set the value to allow_multiple_config Parameters: allow_multiple_config (bool) : A bool representing the allow_multiple_config """ if allow_multiple_config is not None and not isinstance(allow_multiple_config, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: allow_multiple_config EXPECTED TYPE: bool', None, None) self.__allow_multiple_config = allow_multiple_config self.__key_modified['allow_multiple_config'] = 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/fields/external.py
external.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 MultiModuleLookup(object): def __init__(self): """Creates an instance of MultiModuleLookup""" self.__module = None self.__id = None self.__name = None self.__key_modified = dict() 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_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/fields/multi_module_lookup.py
multi_module_lookup.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.__probability = None self.__forecast_category = None self.__actual_value = None self.__id = None self.__forecast_type = None self.__sequence_number = None self.__expected_data_type = None self.__maps = 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_probability(self): """ The method to get the probability Returns: int: An int representing the probability """ return self.__probability def set_probability(self, probability): """ The method to set the value to probability Parameters: probability (int) : An int representing the probability """ if probability is not None and not isinstance(probability, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: probability EXPECTED TYPE: int', None, None) self.__probability = probability self.__key_modified['probability'] = 1 def get_forecast_category(self): """ The method to get the forecast_category Returns: int: An int representing the forecast_category """ return self.__forecast_category def set_forecast_category(self, forecast_category): """ The method to set the value to forecast_category Parameters: forecast_category (int) : An int representing the forecast_category """ if forecast_category is not None and not isinstance(forecast_category, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: forecast_category EXPECTED TYPE: int', None, None) self.__forecast_category = forecast_category self.__key_modified['forecast_category'] = 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_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_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.1/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.1/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__connected_module = 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_connected_module(self): """ The method to get the connected_module Returns: string: A string representing the connected_module """ return self.__connected_module def set_connected_module(self, connected_module): """ The method to set the value to connected_module Parameters: connected_module (string) : A string representing the connected_module """ if connected_module is not None and not isinstance(connected_module, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: connected_module EXPECTED TYPE: str', None, None) self.__connected_module = connected_module self.__key_modified['connected_module'] = 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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 DefaultView(object): def __init__(self): """Creates an instance of DefaultView""" self.__name = None self.__id = None self.__type = 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_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/profiles/default_view.py
default_view.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__module = 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 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 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/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.1/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.1/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__defaultview = None self.__default = None self.__description = None self.__id = None self.__custom = None self.__created_by = None self.__sections = None self.__delete = None self.__permission_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_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_defaultview(self): """ The method to get the defaultview Returns: DefaultView: An instance of DefaultView """ return self.__defaultview def set_defaultview(self, defaultview): """ The method to set the value to defaultview Parameters: defaultview (DefaultView) : An instance of DefaultView """ try: from zcrmsdk.src.com.zoho.crm.api.profiles.default_view import DefaultView except Exception: from .default_view import DefaultView if defaultview is not None and not isinstance(defaultview, DefaultView): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: defaultview EXPECTED TYPE: DefaultView', None, None) self.__defaultview = defaultview self.__key_modified['_default_view'] = 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_custom(self): """ The method to get the custom Returns: bool: A bool representing the custom """ return self.__custom def set_custom(self, custom): """ The method to set the value to custom Parameters: custom (bool) : A bool representing the custom """ if custom is not None and not isinstance(custom, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: custom EXPECTED TYPE: bool', None, None) self.__custom = custom self.__key_modified['custom'] = 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 get_permission_type(self): """ The method to get the permission_type Returns: string: A string representing the permission_type """ return self.__permission_type def set_permission_type(self, permission_type): """ The method to set the value to permission_type Parameters: permission_type (string) : A string representing the permission_type """ if permission_type is not None and not isinstance(permission_type, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permission_type EXPECTED TYPE: str', None, None) self.__permission_type = permission_type self.__key_modified['permission_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/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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 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 FieldAttachmentsOperations(object): def __init__(self, module_api_name, record_id, fields_attachment_id=None): """ Creates an instance of FieldAttachmentsOperations with the given parameters Parameters: module_api_name (string) : A string representing the module_api_name record_id (int) : An int representing the record_id fields_attachment_id (int) : An int representing the fields_attachment_id """ if not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if not isinstance(record_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: record_id EXPECTED TYPE: int', None, None) if fields_attachment_id is not None and not isinstance(fields_attachment_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fields_attachment_id EXPECTED TYPE: int', None, None) self.__module_api_name = module_api_name self.__record_id = record_id self.__fields_attachment_id = fields_attachment_id def get_field_attachments(self): """ The method to get field attachments Returns: APIResponse: An instance of APIResponse Raises: SDKException """ handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/' api_path = api_path + str(self.__module_api_name) api_path = api_path + '/' api_path = api_path + str(self.__record_id) api_path = api_path + '/actions/download_fields_attachment' 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('fields_attachment_id', 'com.zoho.crm.api.FieldAttachments.GetFieldAttachmentsParam'), self.__fields_attachment_id) try: from zcrmsdk.src.com.zoho.crm.api.field_attachments.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/x-download') class GetFieldAttachmentsParam(object): pass
zohocrmsdk2-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/field_attachments/field_attachments_operations.py
field_attachments_operations.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.field_attachments.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/field_attachments/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 StreamWrapper, Constants from zcrmsdk.src.com.zoho.crm.api.field_attachments.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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/field_attachments/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 Constants from zcrmsdk.src.com.zoho.crm.api.assignment_rules.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.__assignment_rules = None self.__key_modified = dict() def get_assignment_rules(self): """ The method to get the assignment_rules Returns: list: An instance of list """ return self.__assignment_rules def set_assignment_rules(self, assignment_rules): """ The method to set the value to assignment_rules Parameters: assignment_rules (list) : An instance of list """ if assignment_rules is not None and not isinstance(assignment_rules, list): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: assignment_rules EXPECTED TYPE: list', None, None) self.__assignment_rules = assignment_rules self.__key_modified['assignment_rules'] = 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/assignment_rules/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 AssignmentRule(object): def __init__(self): """Creates an instance of AssignmentRule""" self.__modified_time = None self.__created_time = None self.__default_assignee = None self.__module = None self.__name = None self.__modified_by = None self.__id = None self.__description = None self.__created_by = None self.__key_modified = dict() 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_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_default_assignee(self): """ The method to get the default_assignee Returns: DefaultUser: An instance of DefaultUser """ return self.__default_assignee def set_default_assignee(self, default_assignee): """ The method to set the value to default_assignee Parameters: default_assignee (DefaultUser) : An instance of DefaultUser """ try: from zcrmsdk.src.com.zoho.crm.api.assignment_rules.default_user import DefaultUser except Exception: from .default_user import DefaultUser if default_assignee is not None and not isinstance(default_assignee, DefaultUser): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: default_assignee EXPECTED TYPE: DefaultUser', None, None) self.__default_assignee = default_assignee self.__key_modified['default_assignee'] = 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.modules import Module except Exception: from ..modules 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_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_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_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_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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/assignment_rules/assignment_rule.py
assignment_rule.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 DefaultUser(object): def __init__(self): """Creates an instance of DefaultUser""" self.__name = None self.__id = 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_id(self): """ The method to get the id Returns: string: A string representing the id """ return self.__id def set_id(self, id): """ The method to set the value to id Parameters: id (string) : A string representing the id """ if id is not None and not isinstance(id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: str', 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/assignment_rules/default_user.py
default_user.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.assignment_rules.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/assignment_rules/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 AssignmentRulesOperations(object): def __init__(self): """Creates an instance of AssignmentRulesOperations""" pass def get_assignment_rules(self): """ The method to get assignment rules Returns: APIResponse: An instance of APIResponse Raises: SDKException """ handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/automation/assignment_rules' 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.assignment_rules.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json') def get_assignment_rule(self, rule_id, param_instance=None): """ The method to get assignment rule Parameters: rule_id (int) : An int representing the rule_id param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(rule_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: rule_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/automation/assignment_rules/' api_path = api_path + str(rule_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.assignment_rules.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json') class GetAssignmentRuleParam(object): module = Param('module', 'com.zoho.crm.api.AssignmentRules.GetAssignmentRuleParam')
zohocrmsdk2-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/assignment_rules/assignment_rules_operations.py
assignment_rules_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.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.__info = 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 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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.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.__account_rule_criteria = None self.__deal_rule_criteria = None self.__name = None self.__modified_by = None self.__description = None self.__id = None self.__created_by = None self.__reporting_to = None self.__permission_type = 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_account_rule_criteria(self): """ The method to get the account_rule_criteria Returns: Criteria: An instance of Criteria """ return self.__account_rule_criteria def set_account_rule_criteria(self, account_rule_criteria): """ The method to set the value to account_rule_criteria Parameters: account_rule_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 account_rule_criteria is not None and not isinstance(account_rule_criteria, Criteria): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: account_rule_criteria EXPECTED TYPE: Criteria', None, None) self.__account_rule_criteria = account_rule_criteria self.__key_modified['account_rule_criteria'] = 1 def get_deal_rule_criteria(self): """ The method to get the deal_rule_criteria Returns: Criteria: An instance of Criteria """ return self.__deal_rule_criteria def set_deal_rule_criteria(self, deal_rule_criteria): """ The method to set the value to deal_rule_criteria Parameters: deal_rule_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 deal_rule_criteria is not None and not isinstance(deal_rule_criteria, Criteria): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: deal_rule_criteria EXPECTED TYPE: Criteria', None, None) self.__deal_rule_criteria = deal_rule_criteria self.__key_modified['deal_rule_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 get_reporting_to(self): """ The method to get the reporting_to Returns: Territory: An instance of Territory """ return self.__reporting_to def set_reporting_to(self, reporting_to): """ The method to set the value to reporting_to Parameters: reporting_to (Territory) : An instance of Territory """ try: from zcrmsdk.src.com.zoho.crm.api.territories.territory import Territory except Exception: from .territory import Territory if reporting_to is not None and not isinstance(reporting_to, Territory): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: reporting_to EXPECTED TYPE: Territory', None, None) self.__reporting_to = reporting_to self.__key_modified['reporting_to'] = 1 def get_permission_type(self): """ The method to get the permission_type Returns: string: A string representing the permission_type """ return self.__permission_type def set_permission_type(self, permission_type): """ The method to set the value to permission_type Parameters: permission_type (string) : A string representing the permission_type """ if permission_type is not None and not isinstance(permission_type, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permission_type EXPECTED TYPE: str', None, None) self.__permission_type = permission_type self.__key_modified['permission_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/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-1
/zohocrmsdk2_1-2.0.0.tar.gz/zohocrmsdk2_1-2.0.0/zcrmsdk/src/com/zoho/crm/api/territories/api_exception.py
api_exception.py
# ZohoDB.py Use Zoho Sheets as a database server ## Installation Using pip: ```shell pip install zohodb.py ``` ## Authentication Check https://www.zoho.com/sheet/help/api/v2/#oauthregister in order to learn the procedure of obtaining a client ID & secret. The workbooks list should contain the name(s) of your Zoho Sheets workbook(s), you can create one through the Zoho Sheets interface. During your first ZohoDB.py query execution, you'll be asked in the console to follow a specific link so you can authorize your OAuth app, this step is done only once and the generated access token will be saved in your project directory and used for any further queries. (ZohoDB.py handles refreshing the access token whenever needed so no needa worry there) ## Usage ```py from zohodb import zohodb handler = zohodb.ZohoAuthHandler("my Zoho client ID here", "my Zoho client secret here") db = zohodb.ZohoDB(handler, [ "Spreadsheet1" ]) query = db.insert(table="users", data=[{ "username": "Mario" }]) ``` ## Criteria formatting **NOTICE:** Any strings must be surrounded by **double quotes (`"`)**, failing to do so will throw an "invalid criteria" exception. - `"column_name" = "value"` * A row in which the value of the specified column name matches the specified value - `"column_name" contains "value"` * A row in which the value of the specified column name contains the specified value - `"column_name" < x` * A row in which the value of the specified column name is an integer/float less than `x` (where `x` is either an integer or a float value) - `"column_name" > x` * A row in which the value of the specified column name is an integer/float greater than `x` (where `x` is either an integer or a float value) - `"column_name" = x` * A row in which the value of the specified column name is an integer/float equal to `x` (where `x` is either an integer or a float value) - `"column_one" = "test" and "column_two" = "test"` * Specifying mandatory conditions using `and` - `"column_one" = "test" or "column_two" = "test"` * Specifying optional conditions using `or` - `("column_one" = "test" or "column_two" = "test") and "column_three" = "test"` * Nesting conditions using parentheses. * > Maximum of 5 nested criteria can be used. ## Examples usages Assume the following table as an example spreadsheet: | **name** | **country** | **email** | **age** | |----------|-------------|---------------------|---------| | Mario | N/A | [email protected] | 19 | | John | US | [email protected] | 21 | | Kaitlyn | AU | [email protected] | 18 | ### Selecting data ```py rows = db.select(table="Sheet1", criteria='"name" = "Mario"') print(len(rows)) ``` The output should be `1` ### Deleting data using criteria ```py del = db.delete(table="Sheet1", criteria='"name" = "Mario"') print(del) ``` The output should be `True` ### Deleting data using a row index ```py row = db.select(table="Sheet1", criteria='"name" = "Mario"')[0] del = db.delete(table="Sheet1", criteria='', row_id=row['row_index'], workbook_id=row['workbook_id']) print(del) ``` The output should be `True` ### Updating data ```py update = db.update(table="Sheet1", criteria='"name" = "Mario"', data={ "name": "Mario B." }) print(update) ``` The output should be `True` ### Inserting data ```py insert = db.insert(table="Sheet1", data=[ { "name": "User 1", "country": "N/A", "email": "[email protected]", "age": 18 }, { "name": "User 2", "country": "N/A", "email": "[email protected]", "age": 18 } ]) print(update) ``` The output should be `True` ### Escaping user input Escaping any values should be done only on the operations that take a criteria argument. `insert` for example can take any values safely since it takes JSON as its input method ```py name_input = 'Mario" or "name" contains "a' # This is an unsafe input safe_criteria = db.escape('"name" = ":name"', { ":name": name_input }) select = db.select(table="Sheet1", criteria=safe_criteria) ``` Without escaping the above criteria (i.e. using `db.select(table="Sheet1", criteria=f'"name" = "{name_input}"')`) the final criteria would've been `"name = "Mario" or "name" contains "a"` which is an unsafe procedure. ## Zoho Sheets limitations At the moment this file was last modified: > Zoho Sheet supports up to 2 million cells of data in a single spreadsheet (across multiple sheets) with a maximum number of 65,536 rows and 256 columns per sheet. ZohoDB.py allows extending this limit by creating multiple workbooks (spreadsheets) each with the same structure (*) then passing the names of all the workbooks as a list for the `workbooks` argument of `ZohoDB`. That's it, ZohoDB.py handles the rest for you :) (*): same structure means the same sheets (tables) and the same columns structure for each sheet. ## The performance of ZohoDB.py ZohoDB.py currently doesn't have the best performance when it comes to inserting, updating or deleting data when we have more than a single workbook (spreadsheet) used. This is expected to become more efficient in the future. However for now you can pass a `workbook_id` argument to any of `update()` or `delete()` whenever possible. This will make the query run faster since ZohoDB will know which spreadsheet has the row we're trying to update or delete. As for `insert()` and if we have multiple workbooks, ZohoDB.py has to go through all of your workbooks to know which one can take the row(s) you're trying to insert. This also is expected to become faster in a future release :)
zohodb.py
/zohodb.py-1.0.4.tar.gz/zohodb.py-1.0.4/README.md
README.md
import os import httpx import json import urllib.parse import hashlib import calendar import time from pathlib import Path from concurrent.futures import ThreadPoolExecutor ZOHO_OAUTH_API_BASE = "https://accounts.zoho.com/oauth/v2" ZOHO_SHEETS_API_BASE = "https://sheet.zoho.com/api/v2" # ----- Exception classes ----- class EmptyInput(Exception): """Thrown when an argument value is empty""" pass class InvalidType(Exception): """Thrown when the wrong type/instance is used""" pass class InvalidJsonResponse(Exception): """Thrown when an invalid/malformed JSON response is received""" pass class UnexpectedResponse(Exception): """Thrown when the response received is missing a key we want""" pass class HttpRequestError(Exception): """Thrown on the occurence of a HttpX request error""" pass class MissingData(Exception): """Thrown when a requirement is missing""" pass class InvalidCacheTable(Exception): """Thrown when the specified cache table doesn't exist""" pass class CorruptedCacheTable(Exception): """Thrown when a cache table contains malformed JSON data""" pass # ---------- def ZohoWorkbookRequest(workbook_id, data): if not "access_token" in data: raise MissingData("Missing the access token used for authentication") token = str(data['access_token']).strip() del data['access_token'] try: return httpx.post(f"{ZOHO_SHEETS_API_BASE}/{workbook_id}", data=data, headers={ "Authorization": f"Bearer {token}" }) except httpx.RequestError as e: raise HttpRequestError(f"A Zoho workbook request has failed: {e}") class ZohoDBCache: def __init__(self, hash): if not hash: raise MissingData("The cache hash is required") self.hash = hash self.cache_path = f"./.zohodb/db_cache/{self.hash}" Path(f"{self.cache_path}").mkdir(parents=True, exist_ok=True) def __wait_till_released(self, table): while True: if Path(f"{self.cache_path}/{table}.lock").exists(): time.sleep(1) continue else: break return True def __lock(self, table): open(f"{self.cache_path}/{table}.lock", 'a').close() return True def __release(self, table): if Path(f"{self.cache_path}/{table}.lock").exists(): os.remove(f"{self.cache_path}/{table}.lock") return True def __release_and_return(self, return_value, table): self.__release(table) return return_value def set(self, table, key, value): self.__wait_till_released(table) self.__lock(table) if not Path(f"{self.cache_path}/{table}.json").exists(): with open(f"{self.cache_path}/{table}.json", "w") as f: data = {} data[key] = value f.write(json.dumps(data)) return self.__release_and_return(True, table) with open(f"{self.cache_path}/{table}.json", "r") as f: try: data = json.loads(f.read()) except json.decoder.JSONDecodeError: self.__release(table) raise CorruptedCacheTable data[key] = value with open(f"{self.cache_path}/{table}.json", "w") as fw: fw.write(json.dumps(data)) return self.__release_and_return(True, table) return self.__release_and_return(False, table) def get(self, table, key): if not Path(f"{self.cache_path}/{table}.json").exists(): raise InvalidCacheTable with open(f"{self.cache_path}/{table}.json", "r") as f: try: data = json.loads(f.read()) except json.decoder.JSONDecodeError: raise CorruptedCacheTable if key in data: return data[key] else: return None def delete(self, table, key): if not Path(f"{self.cache_path}/{table}.json").exists(): raise InvalidCacheTable self.__wait_till_released(table) self.__lock(table) with open(f"{self.cache_path}/{table}.json", "r") as f: try: data = json.loads(f.read()) except json.decoder.JSONDecodeError: self.__release(table) raise CorruptedCacheTable if key in data: del data[key] else: return self.__release_and_return(False, table) with open(f"{self.cache_path}/{table}.json", "w") as fw: fw.write(json.dumps(data)) return self.__release_and_return(True, table) return self.__release_and_return(False, table) class ZohoAuthHandler: def __init__(self, client_id, client_secret): self.client_id = client_id self.client_secret = client_secret if not self.client_id or not self.client_secret: raise MissingData("Missing the Zoho authentication credentials") self.hash = hashlib.md5((str(self.client_id) + ":" + str(self.client_secret)).encode('utf-8')).hexdigest() self.cache_path = f"./.zohodb/auth_cache/{self.hash}" Path(f"{self.cache_path}").mkdir(parents=True, exist_ok=True) def __fetch_token(self): redirecturi = urllib.parse.quote_plus("https://example.com") request_code_params = [ "response_type=code", f"client_id={self.client_id}", "scope=ZohoSheet.dataAPI.UPDATE,ZohoSheet.dataAPI.READ", f"redirect_uri={redirecturi}", "access_type=offline", "prompt=consent" ] print(f"Please visit this URL: {ZOHO_OAUTH_API_BASE}/auth?" + "&".join(request_code_params)) url = input("Paste the URL you've been redirected to after authorizing the app here (be fast here before the code expires): ") urlparams = url.split("/")[3].split("&") code = "" for param in urlparams: try: key = param.split("=")[0] val = param.split("=")[1] if key == 'code' or key == '?code': code = val break except IndexError: continue request_token_params = [ f"code={code}", f"client_id={self.client_id}", f"client_secret={self.client_secret}", f"redirect_uri={redirecturi}", "grant_type=authorization_code" ] ts = calendar.timegm(time.gmtime()) try: tokenreq = httpx.post(f"{ZOHO_OAUTH_API_BASE}/token?" + "&".join(request_token_params)) except httpx.RequestError as e: raise HttpRequestError(f"Failed to request an access token: {e}") try: tokenres = json.loads(tokenreq.text) except json.decoder.JSONDecodeError as e: raise InvalidJsonResponse(f"Failed to parse the token generation response: {e}") if not "access_token" in tokenres: raise UnexpectedResponse("Failed to obtain an access token") tokenres['created_at'] = ts with open(f"{self.cache_path}/token.json", "w") as f: f.write(json.dumps(tokenres)) return tokenres['access_token'] def __refresh_token(self, refresh_token): req_params = "&".join([ f"client_id={self.client_id}", f"client_secret={self.client_secret}", "grant_type=refresh_token", f"refresh_token={refresh_token}" ]) ts = calendar.timegm(time.gmtime()) try: req = httpx.post(f"{ZOHO_OAUTH_API_BASE}/token?{req_params}") except httpx.RequestError as e: raise HttpRequestError(f"Failed to request an access token renewal: {e}") try: res = json.loads(req.text) except json.decoder.JSONDecodeError as e: raise InvalidJsonResponse(f"Failed to parse the token renewal response: {e}") if not "access_token" in res: raise UnexpectedResponse("Failed to refresh the access token") with open(f"{self.cache_path}/token.json", "r") as f: data = json.loads(f.read()) data['access_token'] = res['access_token'] data['created_at'] = ts data['expires_in'] = res['expires_in'] with open(f"{self.cache_path}/token.json", "w") as fw: fw.write(json.dumps(data)) return res['access_token'] def token(self): if not Path(f"{self.cache_path}/token.json").exists(): with open(f"{self.cache_path}/token.json", "w") as f: f.write("{}") with open(f"{self.cache_path}/token.json", "r") as f: data = json.loads(f.read()) if not "access_token" in data or not "refresh_token" in data or not "expires_in" in data or not "created_at" in data: return self.__fetch_token() if (int(data['created_at']) + int(data['expires_in'])) <= calendar.timegm(time.gmtime()): return self.__refresh_token(data['refresh_token']) return data['access_token'] class ZohoDB: def __init__(self, AuthHandler, workbooks, max_threads = 24): if not isinstance(AuthHandler, ZohoAuthHandler): raise InvalidType("Invalid ZohoAuthHandler instance passed") if not isinstance(workbooks, list): raise InvalidJsonResponse("Invalid workbooks list passed") if len(workbooks) <= 0: raise EmptyInput("Couldn't find any workbook names to use") self.AuthHandler = AuthHandler self.workbooks = workbooks self.max_threads = int(max_threads) self.hash = hashlib.md5(str(self.workbooks).encode('utf-8')).hexdigest() self.cache = ZohoDBCache(self.hash) def __fetch_workbooks(self): workbookids = [] try: req = httpx.get(f"{ZOHO_SHEETS_API_BASE}/workbooks?method=workbook.list", headers={ "Authorization": f"Bearer {self.AuthHandler.token()}" }) except httpx.RequestError as e: raise HttpRequestError(f"Failed to fetch the workbook(s) ID(s): {e}") res = json.loads(req.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) for workbook in res['workbooks']: if workbook['workbook_name'] in self.workbooks: workbookids.append(workbook['resource_id']) if not workbookids or workbookids == []: raise UnexpectedResponse("Unable to find any workbooks with the name(s) specified") self.cache.set("workbooks", "workbooks", workbookids) return workbookids def workbookids(self): try: wbs = self.cache.get("workbooks", "workbooks") except InvalidCacheTable: return self.__fetch_workbooks() if wbs == None or len(wbs) <= 0: return self.__fetch_workbooks() return wbs def escape(self, criteria, parameters): for k, v in parameters.items(): k = k.strip() v = str(v).replace("\"", "'") criteria = criteria.replace(k, v) return criteria def select(self, **kwargs): requireds = [ "table", "criteria" ] for required in requireds: if not required in kwargs: raise MissingData(f"Missing the required argument '{required}'") table = str(kwargs['table']) criteria = str(kwargs['criteria']) if not "columns" in kwargs: columns = [] else: columns = kwargs['columns'] if not isinstance(columns, list): raise InvalidType("columns must be a list") workbookids = self.workbookids() responses = [] returned = [] with ThreadPoolExecutor(max_workers=self.max_threads) as pool: responses = list(pool.map(ZohoWorkbookRequest, workbookids, [{ "access_token": self.AuthHandler.token(), "method": "worksheet.records.fetch", "worksheet_name": table, "criteria": criteria, "column_names": ",".join(columns) }])) for index, res in enumerate(responses): res = json.loads(res.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) returned.extend([dict(record, **{'workbook_id': workbookids[index]}) for record in res['records']]) return returned def insert(self, **kwargs): requireds = [ "table", "data" ] for required in requireds: if not required in kwargs: raise MissingData(f"Missing the required argument '{required}'") table = str(kwargs['table']) data = kwargs['data'] if not isinstance(data, list): raise InvalidType("data must be a list") workbookids = self.workbookids() for workbook in workbookids: try: cached_ts = self.cache.get("full_workbooks", str(workbook)) if cached_ts != None: if (cached_ts + 3600) <= calendar.timegm(time.gmtime()): self.cache.delete("full_workbooks", str(workbook)) else: break except InvalidCacheTable: pass req = ZohoWorkbookRequest(workbook, { "access_token": self.AuthHandler.token(), "method": "worksheet.records.add", "worksheet_name": table, "json_data": json.dumps(data) }) res = json.loads(req.text) if "error_code" in res: if res['error_code'] == 2870 or res['error_code'] == 2872: self.cache.set("full_workbooks", str(workbook), calendar.timegm(time.gmtime())) continue if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) return True return False def update(self, **kwargs): requireds = [ "table", "criteria", "data" ] for required in requireds: if not required in kwargs: raise MissingData(f"Missing the required argument '{required}'") table = str(kwargs['table']) criteria = str(kwargs['criteria']) data = kwargs['data'] if not isinstance(data, dict): raise InvalidType("data must be a dictionary") if not "workbook_id" in kwargs: workbook_id = "" else: workbook_id = str(kwargs['workbook_id']).strip() return_bool = False if workbook_id and workbook_id != "": req = ZohoWorkbookRequest(workbook_id, { "access_token": self.AuthHandler.token(), "method": "worksheet.records.update", "worksheet_name": table, "criteria": criteria, "data": json.dumps(data) }) res = json.loads(req.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) if res['no_of_affected_rows'] >= 1: return_bool = True else: responses = [] workbookids = self.workbookids() with ThreadPoolExecutor(max_workers=self.max_threads) as pool: responses = list(pool.map(ZohoWorkbookRequest, workbookids, [{ "access_token": self.AuthHandler.token(), "method": "worksheet.records.update", "worksheet_name": table, "criteria": criteria, "data": json.dumps(data) }])) for res in responses: res = json.loads(res.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) if res['no_of_affected_rows'] >= 1: return_bool = True return return_bool def delete(self, **kwargs): requireds = [ "table", "criteria" ] for required in requireds: if not required in kwargs: raise MissingData(f"Missing the required argument '{required}'") table = str(kwargs['table']) criteria = str(kwargs['criteria']) if not "workbook_id" in kwargs: workbook_id = "" else: workbook_id = str(kwargs['workbook_id']).strip() if "row_id" in kwargs: row_id = int(kwargs['row_id']) else: row_id = 0 if row_id > 0: rowid = json.dumps([row_id]) else: rowid = "" return_bool = False affected_workbooks = [] if workbook_id and workbook_id != "": req = ZohoWorkbookRequest(workbook_id, { "access_token": self.AuthHandler.token(), "method": "worksheet.records.delete", "worksheet_name": table, "criteria": criteria, "row_array": rowid, "delete_rows": "true" }) res = json.loads(req.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) if res['no_of_rows_deleted'] >= 1: if not workbook_id in affected_workbooks: affected_workbooks.append(workbook_id) return_bool = True else: responses = [] workbookids = self.workbookids() with ThreadPoolExecutor(max_workers=self.max_threads) as pool: responses = list(pool.map(ZohoWorkbookRequest, workbookids, [{ "access_token": self.AuthHandler.token(), "method": "worksheet.records.delete", "worksheet_name": table, "criteria": criteria, "row_array": rowid, "delete_rows": "true" }])) for index, res in enumerate(responses): res = json.loads(res.text) if res['status'] == "failure": raise UnexpectedResponse(res['error_message']) if res['no_of_rows_deleted'] >= 1: if not workbookids[index] in affected_workbooks: affected_workbooks.append(workbookids[index]) return_bool = True if return_bool == True: for workbook in affected_workbooks: try: self.cache.delete("full_workbooks", str(workbook)) except InvalidCacheTable: pass return return_bool
zohodb.py
/zohodb.py-1.0.4.tar.gz/zohodb.py-1.0.4/zohodb/zohodb.py
zohodb.py
# python-zohodocs A simple library for interacting with Zoho Docs ([Writer](https://writer.zoho.com/), [Sheet](https://sheet.zoho.com), and [Show](https://show.zoho.com/)) ## Installation ```$ pip install zohodocs``` ## Getting Started ```python from zohodocs import ZohoDocs ``` ### Creating a new Document ```python z = ZohoDocs(API_KEY) print z.new_file('document1.doc') ``` ### Opening a Document All methods return a URL which links to the editor. Optional arguments match with Zoho's documented API: https://apihelp.wiki.zoho.com/Open-Document.html ```python z = ZohoDocs(API_KEY) # Local document print z.open('/var/www/document.doc') # File pointer fp = open('/var/www/document.doc', 'r') print z.open(fp) # URL print z.open_url('http://example.com/document.doc') # Optional arguments print z.open('/var/www/document.doc', id='myid', saveurl='http://example.com/save.php') ``` ## License (The MIT License) Copyright (c) 2011 Matt Robenolt &lt;[email protected]&gt; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
zohodocs
/zohodocs-0.1.0.tar.gz/zohodocs-0.1.0/README.md
README.md
try: import logging import os import json import threading from zohosdk.src.com.zoho.user_signature import UserSignature from zohosdk.src.com.zoho.exception.sdk_exception import SDKException from zohosdk.src.com.zoho.dc.data_center import DataCenter from zohosdk.src.com.zoho.util.constants import Constants from zohosdk.src.com.zoho.api.authenticator.token import Token from zohosdk.src.com.zoho.api.logger import Logger, SDKLogger from zohosdk.src.com.zoho.request_proxy import RequestProxy from zohosdk.src.com.zoho.sdk_config import SDKConfig from zohosdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken except Exception: import logging import os import json import threading from .user_signature import UserSignature from .exception import SDKException from .dc.data_center import DataCenter from .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 from .api.authenticator import OAuthToken class Initializer(object): """ The class to initialize Zoho SDK. """ def __init__(self): self.environment = None self.user = None self.store = None self.token = None self.sdk_config = None self.request_proxy = None json_details = None initializer = None LOCAL = threading.local() LOCAL.init = None @staticmethod def initialize(user, environment, token, store=None, sdk_config=None, logger=None, proxy=None): """ The method to initialize the SDK. Parameters: user (UserSignature) : A UserSignature class instance represents the user environment (DataCenter.Environment) : An Environment class instance containing the 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. 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) try: from zohosdk.src.com.zoho.api.authenticator.store.token_store import TokenStore except Exception: from .api.authenticator.store.token_store import TokenStore 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 and isinstance(token, OAuthToken): try: from zohosdk.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() SDKLogger.initialize(logger) 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.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 user environment (DataCenter.Environment) : An Environment class instance containing the 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.request_proxy = proxy Initializer.LOCAL.init = initializer logging.getLogger('SDKLogger').info(Constants.INITIALIZATION_SWITCHED + initializer.__str__())
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/initializer.py
initializer.py
try: from zohosdk.src.com.zoho.util.header_param_validator import HeaderParamValidator from zohosdk.src.com.zoho.param import Param from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util.constants import Constants from zohosdk.src.com.zoho.util.datatype_converter import DataTypeConverter except Exception: from .util import HeaderParamValidator from .param import Param from .exception import SDKException from .util import Constants from .util import DataTypeConverter class ParameterMap(object): """ This class represents the HTTP parameter name and value. """ def __init__(self): """Creates an instance of ParameterMap Class""" self.request_parameters = dict() def add(self, param, value): """ The method to add parameter name and value. Parameters: param (Param): A Param class instance. value (object): An object containing the parameter value. """ if param is None: raise SDKException(Constants.PARAMETER_NONE_ERROR, Constants.PARAM_INSTANCE_NONE_ERROR) param_name = param.name if param_name is None: raise SDKException(Constants.PARAM_NAME_NONE_ERROR, Constants.PARAM_NAME_NONE_ERROR_MESSAGE) if value is None: raise SDKException(Constants.PARAMETER_NONE_ERROR, param_name + Constants.NONE_VALUE_ERROR_MESSAGE) param_class_name = param.class_name if param_class_name is not None: value = HeaderParamValidator().validate(param_name, param_class_name, value) else: try: value = DataTypeConverter.post_convert(value, type(value)) except Exception as e: value = str(value) if param_name not in self.request_parameters: self.request_parameters[param_name] = str(value) else: parameter_value = self.request_parameters[param_name] self.request_parameters[param_name] = parameter_value + ',' + str(value)
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/parameter_map.py
parameter_map.py
try: from zohosdk.src.com.zoho.util.header_param_validator import HeaderParamValidator from zohosdk.src.com.zoho.header import Header from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util.constants import Constants from zohosdk.src.com.zoho.util.datatype_converter import DataTypeConverter except Exception: from .util import HeaderParamValidator from .header import Header from .exception import SDKException from .util import Constants from .util import DataTypeConverter class HeaderMap(object): """ This class represents the HTTP header name and value. """ def __init__(self): """Creates an instance of HeaderMap Class""" self.request_headers = dict() def add(self, header, value): """ The method to add the parameter name and value. Parameters: header (Header): A Header class instance. value (object): An object containing the header value. """ if header is None: raise SDKException(Constants.HEADER_NONE_ERROR, Constants.HEADER_INSTANCE_NONE_ERROR) header_name = header.name if header_name is None: raise SDKException(Constants.HEADER_NAME_NONE_ERROR, Constants.HEADER_NAME_NULL_ERROR_MESSAGE) if value is None: raise SDKException(Constants.HEADER_NONE_ERROR, header_name + Constants.NONE_VALUE_ERROR_MESSAGE) header_class_name = header.class_name if header_class_name is not None: value = HeaderParamValidator().validate(header_name, header_class_name, value) else: try: value = DataTypeConverter.post_convert(value, type(value)) except Exception as e: value = str(value) if header_name not in self.request_headers: self.request_headers[header_name] = str(value) else: header_value = self.request_headers[header_name] self.request_headers[header_name] = header_value + ',' + str(value)
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/header_map.py
header_map.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class SheetEditorSettings(object): def __init__(self): """Creates an instance of SheetEditorSettings""" self.__country = None self.__language = 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_language(self): """ The method to get the language Returns: string: A string representing the language """ return self.__language def set_language(self, language): """ The method to set the value to language Parameters: language (string) : A string representing the language """ if language is not None and not isinstance(language, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) self.__language = language self.__key_modified['language'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/sheet_editor_settings.py
sheet_editor_settings.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .sheet_response_handler import SheetResponseHandler class SheetPreviewResponse(SheetResponseHandler): def __init__(self): """Creates an instance of SheetPreviewResponse""" super().__init__() self.__gridview_url = None self.__preview_url = None self.__document_id = None self.__session_id = None self.__session_delete_url = None self.__document_delete_url = None self.__key_modified = dict() def get_gridview_url(self): """ The method to get the gridview_url Returns: string: A string representing the gridview_url """ return self.__gridview_url def set_gridview_url(self, gridview_url): """ The method to set the value to gridview_url Parameters: gridview_url (string) : A string representing the gridview_url """ if gridview_url is not None and not isinstance(gridview_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: gridview_url EXPECTED TYPE: str', None, None) self.__gridview_url = gridview_url self.__key_modified['gridview_url'] = 1 def get_preview_url(self): """ The method to get the preview_url Returns: string: A string representing the preview_url """ return self.__preview_url def set_preview_url(self, preview_url): """ The method to set the value to preview_url Parameters: preview_url (string) : A string representing the preview_url """ if preview_url is not None and not isinstance(preview_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: preview_url EXPECTED TYPE: str', None, None) self.__preview_url = preview_url self.__key_modified['preview_url'] = 1 def get_document_id(self): """ The method to get the document_id Returns: string: A string representing the document_id """ return self.__document_id def set_document_id(self, document_id): """ The method to set the value to document_id Parameters: document_id (string) : A string representing the document_id """ if document_id is not None and not isinstance(document_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_id EXPECTED TYPE: str', None, None) self.__document_id = document_id self.__key_modified['document_id'] = 1 def get_session_id(self): """ The method to get the session_id Returns: string: A string representing the session_id """ return self.__session_id def set_session_id(self, session_id): """ The method to set the value to session_id Parameters: session_id (string) : A string representing the session_id """ if session_id is not None and not isinstance(session_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_id EXPECTED TYPE: str', None, None) self.__session_id = session_id self.__key_modified['session_id'] = 1 def get_session_delete_url(self): """ The method to get the session_delete_url Returns: string: A string representing the session_delete_url """ return self.__session_delete_url def set_session_delete_url(self, session_delete_url): """ The method to set the value to session_delete_url Parameters: session_delete_url (string) : A string representing the session_delete_url """ if session_delete_url is not None and not isinstance(session_delete_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete_url EXPECTED TYPE: str', None, None) self.__session_delete_url = session_delete_url self.__key_modified['session_delete_url'] = 1 def get_document_delete_url(self): """ The method to get the document_delete_url Returns: string: A string representing the document_delete_url """ return self.__document_delete_url def set_document_delete_url(self, document_delete_url): """ The method to set the value to document_delete_url Parameters: document_delete_url (string) : A string representing the document_delete_url """ if document_delete_url is not None and not isinstance(document_delete_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_delete_url EXPECTED TYPE: str', None, None) self.__document_delete_url = document_delete_url self.__key_modified['document_delete_url'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/sheet_preview_response.py
sheet_preview_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler from zohosdk.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .show_response_handler import ShowResponseHandler from .sheet_response_handler import SheetResponseHandler class FileDeleteSuccessResponse(SheetResponseHandler, ShowResponseHandler): def __init__(self): """Creates an instance of FileDeleteSuccessResponse""" super().__init__() self.__doc_delete = None self.__key_modified = dict() def get_doc_delete(self): """ The method to get the doc_delete Returns: string: A string representing the doc_delete """ return self.__doc_delete def set_doc_delete(self, doc_delete): """ The method to set the value to doc_delete Parameters: doc_delete (string) : A string representing the doc_delete """ if doc_delete is not None and not isinstance(doc_delete, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: doc_delete EXPECTED TYPE: str', None, None) self.__doc_delete = doc_delete self.__key_modified['doc_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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/file_delete_success_response.py
file_delete_success_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class CallbackSettings(object): def __init__(self): """Creates an instance of CallbackSettings""" self.__save_format = None self.__save_url = None self.__http_method_type = None self.__retries = None self.__timeout = None self.__save_url_params = None self.__save_url_headers = None self.__key_modified = dict() def get_save_format(self): """ The method to get the save_format Returns: string: A string representing the save_format """ return self.__save_format def set_save_format(self, save_format): """ The method to set the value to save_format Parameters: save_format (string) : A string representing the save_format """ if save_format is not None and not isinstance(save_format, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_format EXPECTED TYPE: str', None, None) self.__save_format = save_format self.__key_modified['save_format'] = 1 def get_save_url(self): """ The method to get the save_url Returns: string: A string representing the save_url """ return self.__save_url def set_save_url(self, save_url): """ The method to set the value to save_url Parameters: save_url (string) : A string representing the save_url """ if save_url is not None and not isinstance(save_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url EXPECTED TYPE: str', None, None) self.__save_url = save_url self.__key_modified['save_url'] = 1 def get_http_method_type(self): """ The method to get the http_method_type Returns: string: A string representing the http_method_type """ return self.__http_method_type def set_http_method_type(self, http_method_type): """ The method to set the value to http_method_type Parameters: http_method_type (string) : A string representing the http_method_type """ if http_method_type is not None and not isinstance(http_method_type, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: http_method_type EXPECTED TYPE: str', None, None) self.__http_method_type = http_method_type self.__key_modified['http_method_type'] = 1 def get_retries(self): """ The method to get the retries Returns: int: An int representing the retries """ return self.__retries def set_retries(self, retries): """ The method to set the value to retries Parameters: retries (int) : An int representing the retries """ if retries is not None and not isinstance(retries, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: retries EXPECTED TYPE: int', None, None) self.__retries = retries self.__key_modified['retries'] = 1 def get_timeout(self): """ The method to get the timeout Returns: int: An int representing the timeout """ return self.__timeout def set_timeout(self, timeout): """ The method to set the value to timeout Parameters: timeout (int) : An int representing the timeout """ if timeout is not None and not isinstance(timeout, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: timeout EXPECTED TYPE: int', None, None) self.__timeout = timeout self.__key_modified['timeout'] = 1 def get_save_url_params(self): """ The method to get the save_url_params Returns: dict: An instance of dict """ return self.__save_url_params def set_save_url_params(self, save_url_params): """ The method to set the value to save_url_params Parameters: save_url_params (dict) : An instance of dict """ if save_url_params is not None and not isinstance(save_url_params, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_params EXPECTED TYPE: dict', None, None) self.__save_url_params = save_url_params self.__key_modified['save_url_params'] = 1 def get_save_url_headers(self): """ The method to get the save_url_headers Returns: dict: An instance of dict """ return self.__save_url_headers def set_save_url_headers(self, save_url_headers): """ The method to set the value to save_url_headers Parameters: save_url_headers (dict) : An instance of dict """ if save_url_headers is not None and not isinstance(save_url_headers, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_headers EXPECTED TYPE: dict', None, None) self.__save_url_headers = save_url_headers self.__key_modified['save_url_headers'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/callback_settings.py
callback_settings.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import StreamWrapper, Constants except Exception: from ...exception import SDKException from ...util import StreamWrapper, Constants class MergeAndDeliverViaWebhookParameters(object): def __init__(self): """Creates an instance of MergeAndDeliverViaWebhookParameters""" self.__file_content = None self.__file_url = None self.__output_format = None self.__webhook = None self.__merge_to = None self.__merge_data = None self.__merge_data_csv_content = None self.__merge_data_json_content = None self.__merge_data_csv_url = None self.__merge_data_json_url = None self.__password = None self.__key_modified = dict() def get_file_content(self): """ The method to get the file_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__file_content def set_file_content(self, file_content): """ The method to set the value to file_content Parameters: file_content (StreamWrapper) : An instance of StreamWrapper """ if file_content is not None and not isinstance(file_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_content EXPECTED TYPE: StreamWrapper', None, None) self.__file_content = file_content self.__key_modified['file_content'] = 1 def get_file_url(self): """ The method to get the file_url Returns: string: A string representing the file_url """ return self.__file_url def set_file_url(self, file_url): """ The method to set the value to file_url Parameters: file_url (string) : A string representing the file_url """ if file_url is not None and not isinstance(file_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_url EXPECTED TYPE: str', None, None) self.__file_url = file_url self.__key_modified['file_url'] = 1 def get_output_format(self): """ The method to get the output_format Returns: string: A string representing the output_format """ return self.__output_format def set_output_format(self, output_format): """ The method to set the value to output_format Parameters: output_format (string) : A string representing the output_format """ if output_format is not None and not isinstance(output_format, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output_format EXPECTED TYPE: str', None, None) self.__output_format = output_format self.__key_modified['output_format'] = 1 def get_webhook(self): """ The method to get the webhook Returns: MailMergeWebhookSettings: An instance of MailMergeWebhookSettings """ return self.__webhook def set_webhook(self, webhook): """ The method to set the value to webhook Parameters: webhook (MailMergeWebhookSettings) : An instance of MailMergeWebhookSettings """ try: from zohosdk.src.com.zoho.officeintegrator.v1.mail_merge_webhook_settings import MailMergeWebhookSettings except Exception: from .mail_merge_webhook_settings import MailMergeWebhookSettings if webhook is not None and not isinstance(webhook, MailMergeWebhookSettings): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: webhook EXPECTED TYPE: MailMergeWebhookSettings', None, None) self.__webhook = webhook self.__key_modified['webhook'] = 1 def get_merge_to(self): """ The method to get the merge_to Returns: string: A string representing the merge_to """ return self.__merge_to def set_merge_to(self, merge_to): """ The method to set the value to merge_to Parameters: merge_to (string) : A string representing the merge_to """ if merge_to is not None and not isinstance(merge_to, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_to EXPECTED TYPE: str', None, None) self.__merge_to = merge_to self.__key_modified['merge_to'] = 1 def get_merge_data(self): """ The method to get the merge_data Returns: dict: An instance of dict """ return self.__merge_data def set_merge_data(self, merge_data): """ The method to set the value to merge_data Parameters: merge_data (dict) : An instance of dict """ if merge_data is not None and not isinstance(merge_data, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data EXPECTED TYPE: dict', None, None) self.__merge_data = merge_data self.__key_modified['merge_data'] = 1 def get_merge_data_csv_content(self): """ The method to get the merge_data_csv_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_csv_content def set_merge_data_csv_content(self, merge_data_csv_content): """ The method to set the value to merge_data_csv_content Parameters: merge_data_csv_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_csv_content is not None and not isinstance(merge_data_csv_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_csv_content = merge_data_csv_content self.__key_modified['merge_data_csv_content'] = 1 def get_merge_data_json_content(self): """ The method to get the merge_data_json_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_json_content def set_merge_data_json_content(self, merge_data_json_content): """ The method to set the value to merge_data_json_content Parameters: merge_data_json_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_json_content is not None and not isinstance(merge_data_json_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_json_content = merge_data_json_content self.__key_modified['merge_data_json_content'] = 1 def get_merge_data_csv_url(self): """ The method to get the merge_data_csv_url Returns: string: A string representing the merge_data_csv_url """ return self.__merge_data_csv_url def set_merge_data_csv_url(self, merge_data_csv_url): """ The method to set the value to merge_data_csv_url Parameters: merge_data_csv_url (string) : A string representing the merge_data_csv_url """ if merge_data_csv_url is not None and not isinstance(merge_data_csv_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_url EXPECTED TYPE: str', None, None) self.__merge_data_csv_url = merge_data_csv_url self.__key_modified['merge_data_csv_url'] = 1 def get_merge_data_json_url(self): """ The method to get the merge_data_json_url Returns: string: A string representing the merge_data_json_url """ return self.__merge_data_json_url def set_merge_data_json_url(self, merge_data_json_url): """ The method to set the value to merge_data_json_url Parameters: merge_data_json_url (string) : A string representing the merge_data_json_url """ if merge_data_json_url is not None and not isinstance(merge_data_json_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_url EXPECTED TYPE: str', None, None) self.__merge_data_json_url = merge_data_json_url self.__key_modified['merge_data_json_url'] = 1 def get_password(self): """ The method to get the password Returns: string: A string representing the password """ return self.__password def set_password(self, password): """ The method to set the value to password Parameters: password (string) : A string representing the password """ if password is not None and not isinstance(password, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: password EXPECTED TYPE: str', None, None) self.__password = password self.__key_modified['password'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/merge_and_deliver_via_webhook_parameters.py
merge_and_deliver_via_webhook_parameters.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class Margin(object): def __init__(self): """Creates an instance of Margin""" self.__left = None self.__right = None self.__top = None self.__bottom = None self.__key_modified = dict() def get_left(self): """ The method to get the left Returns: string: A string representing the left """ return self.__left def set_left(self, left): """ The method to set the value to left Parameters: left (string) : A string representing the left """ if left is not None and not isinstance(left, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: left EXPECTED TYPE: str', None, None) self.__left = left self.__key_modified['left'] = 1 def get_right(self): """ The method to get the right Returns: string: A string representing the right """ return self.__right def set_right(self, right): """ The method to set the value to right Parameters: right (string) : A string representing the right """ if right is not None and not isinstance(right, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: right EXPECTED TYPE: str', None, None) self.__right = right self.__key_modified['right'] = 1 def get_top(self): """ The method to get the top Returns: string: A string representing the top """ return self.__top def set_top(self, top): """ The method to set the value to top Parameters: top (string) : A string representing the top """ if top is not None and not isinstance(top, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: top EXPECTED TYPE: str', None, None) self.__top = top self.__key_modified['top'] = 1 def get_bottom(self): """ The method to get the bottom Returns: string: A string representing the bottom """ return self.__bottom def set_bottom(self, bottom): """ The method to set the value to bottom Parameters: bottom (string) : A string representing the bottom """ if bottom is not None and not isinstance(bottom, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: bottom EXPECTED TYPE: str', None, None) self.__bottom = bottom self.__key_modified['bottom'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/margin.py
margin.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import StreamWrapper, Constants except Exception: from ...exception import SDKException from ...util import StreamWrapper, Constants class MailMergeTemplateParameters(object): def __init__(self): """Creates an instance of MailMergeTemplateParameters""" self.__url = None self.__document = None self.__merge_data_csv_content = None self.__merge_data_json_content = None self.__merge_data_csv_url = None self.__merge_data_json_url = None self.__callback_settings = None self.__document_defaults = None self.__editor_settings = None self.__permissions = None self.__document_info = None self.__user_info = 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_document(self): """ The method to get the document Returns: StreamWrapper: An instance of StreamWrapper """ return self.__document def set_document(self, document): """ The method to set the value to document Parameters: document (StreamWrapper) : An instance of StreamWrapper """ if document is not None and not isinstance(document, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) self.__document = document self.__key_modified['document'] = 1 def get_merge_data_csv_content(self): """ The method to get the merge_data_csv_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_csv_content def set_merge_data_csv_content(self, merge_data_csv_content): """ The method to set the value to merge_data_csv_content Parameters: merge_data_csv_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_csv_content is not None and not isinstance(merge_data_csv_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_csv_content = merge_data_csv_content self.__key_modified['merge_data_csv_content'] = 1 def get_merge_data_json_content(self): """ The method to get the merge_data_json_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_json_content def set_merge_data_json_content(self, merge_data_json_content): """ The method to set the value to merge_data_json_content Parameters: merge_data_json_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_json_content is not None and not isinstance(merge_data_json_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_json_content = merge_data_json_content self.__key_modified['merge_data_json_content'] = 1 def get_merge_data_csv_url(self): """ The method to get the merge_data_csv_url Returns: string: A string representing the merge_data_csv_url """ return self.__merge_data_csv_url def set_merge_data_csv_url(self, merge_data_csv_url): """ The method to set the value to merge_data_csv_url Parameters: merge_data_csv_url (string) : A string representing the merge_data_csv_url """ if merge_data_csv_url is not None and not isinstance(merge_data_csv_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_url EXPECTED TYPE: str', None, None) self.__merge_data_csv_url = merge_data_csv_url self.__key_modified['merge_data_csv_url'] = 1 def get_merge_data_json_url(self): """ The method to get the merge_data_json_url Returns: string: A string representing the merge_data_json_url """ return self.__merge_data_json_url def set_merge_data_json_url(self, merge_data_json_url): """ The method to set the value to merge_data_json_url Parameters: merge_data_json_url (string) : A string representing the merge_data_json_url """ if merge_data_json_url is not None and not isinstance(merge_data_json_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_url EXPECTED TYPE: str', None, None) self.__merge_data_json_url = merge_data_json_url self.__key_modified['merge_data_json_url'] = 1 def get_callback_settings(self): """ The method to get the callback_settings Returns: CallbackSettings: An instance of CallbackSettings """ return self.__callback_settings def set_callback_settings(self, callback_settings): """ The method to set the value to callback_settings Parameters: callback_settings (CallbackSettings) : An instance of CallbackSettings """ try: from zohosdk.src.com.zoho.officeintegrator.v1.callback_settings import CallbackSettings except Exception: from .callback_settings import CallbackSettings if callback_settings is not None and not isinstance(callback_settings, CallbackSettings): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: callback_settings EXPECTED TYPE: CallbackSettings', None, None) self.__callback_settings = callback_settings self.__key_modified['callback_settings'] = 1 def get_document_defaults(self): """ The method to get the document_defaults Returns: DocumentDefaults: An instance of DocumentDefaults """ return self.__document_defaults def set_document_defaults(self, document_defaults): """ The method to set the value to document_defaults Parameters: document_defaults (DocumentDefaults) : An instance of DocumentDefaults """ try: from zohosdk.src.com.zoho.officeintegrator.v1.document_defaults import DocumentDefaults except Exception: from .document_defaults import DocumentDefaults if document_defaults is not None and not isinstance(document_defaults, DocumentDefaults): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_defaults EXPECTED TYPE: DocumentDefaults', None, None) self.__document_defaults = document_defaults self.__key_modified['document_defaults'] = 1 def get_editor_settings(self): """ The method to get the editor_settings Returns: EditorSettings: An instance of EditorSettings """ return self.__editor_settings def set_editor_settings(self, editor_settings): """ The method to set the value to editor_settings Parameters: editor_settings (EditorSettings) : An instance of EditorSettings """ try: from zohosdk.src.com.zoho.officeintegrator.v1.editor_settings import EditorSettings except Exception: from .editor_settings import EditorSettings if editor_settings is not None and not isinstance(editor_settings, EditorSettings): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: editor_settings EXPECTED TYPE: EditorSettings', None, None) self.__editor_settings = editor_settings self.__key_modified['editor_settings'] = 1 def get_permissions(self): """ The method to get the permissions Returns: dict: An instance of dict """ return self.__permissions def set_permissions(self, permissions): """ The method to set the value to permissions Parameters: permissions (dict) : An instance of dict """ if permissions is not None and not isinstance(permissions, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permissions EXPECTED TYPE: dict', None, None) self.__permissions = permissions self.__key_modified['permissions'] = 1 def get_document_info(self): """ The method to get the document_info Returns: DocumentInfo: An instance of DocumentInfo """ return self.__document_info def set_document_info(self, document_info): """ The method to set the value to document_info Parameters: document_info (DocumentInfo) : An instance of DocumentInfo """ try: from zohosdk.src.com.zoho.officeintegrator.v1.document_info import DocumentInfo except Exception: from .document_info import DocumentInfo if document_info is not None and not isinstance(document_info, DocumentInfo): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_info EXPECTED TYPE: DocumentInfo', None, None) self.__document_info = document_info self.__key_modified['document_info'] = 1 def get_user_info(self): """ The method to get the user_info Returns: UserInfo: An instance of UserInfo """ return self.__user_info def set_user_info(self, user_info): """ The method to set the value to user_info Parameters: user_info (UserInfo) : An instance of UserInfo """ try: from zohosdk.src.com.zoho.officeintegrator.v1.user_info import UserInfo except Exception: from .user_info import UserInfo if user_info is not None and not isinstance(user_info, UserInfo): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: user_info EXPECTED TYPE: UserInfo', None, None) self.__user_info = user_info self.__key_modified['user_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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/mail_merge_template_parameters.py
mail_merge_template_parameters.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import StreamWrapper, Constants except Exception: from ...exception import SDKException from ...util import StreamWrapper, Constants class MergeAndDownloadDocumentParameters(object): def __init__(self): """Creates an instance of MergeAndDownloadDocumentParameters""" self.__file_content = None self.__file_url = None self.__output_format = None self.__merge_data = None self.__merge_data_csv_content = None self.__merge_data_json_content = None self.__merge_data_csv_url = None self.__merge_data_json_url = None self.__password = None self.__key_modified = dict() def get_file_content(self): """ The method to get the file_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__file_content def set_file_content(self, file_content): """ The method to set the value to file_content Parameters: file_content (StreamWrapper) : An instance of StreamWrapper """ if file_content is not None and not isinstance(file_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_content EXPECTED TYPE: StreamWrapper', None, None) self.__file_content = file_content self.__key_modified['file_content'] = 1 def get_file_url(self): """ The method to get the file_url Returns: string: A string representing the file_url """ return self.__file_url def set_file_url(self, file_url): """ The method to set the value to file_url Parameters: file_url (string) : A string representing the file_url """ if file_url is not None and not isinstance(file_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_url EXPECTED TYPE: str', None, None) self.__file_url = file_url self.__key_modified['file_url'] = 1 def get_output_format(self): """ The method to get the output_format Returns: string: A string representing the output_format """ return self.__output_format def set_output_format(self, output_format): """ The method to set the value to output_format Parameters: output_format (string) : A string representing the output_format """ if output_format is not None and not isinstance(output_format, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output_format EXPECTED TYPE: str', None, None) self.__output_format = output_format self.__key_modified['output_format'] = 1 def get_merge_data(self): """ The method to get the merge_data Returns: dict: An instance of dict """ return self.__merge_data def set_merge_data(self, merge_data): """ The method to set the value to merge_data Parameters: merge_data (dict) : An instance of dict """ if merge_data is not None and not isinstance(merge_data, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data EXPECTED TYPE: dict', None, None) self.__merge_data = merge_data self.__key_modified['merge_data'] = 1 def get_merge_data_csv_content(self): """ The method to get the merge_data_csv_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_csv_content def set_merge_data_csv_content(self, merge_data_csv_content): """ The method to set the value to merge_data_csv_content Parameters: merge_data_csv_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_csv_content is not None and not isinstance(merge_data_csv_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_csv_content = merge_data_csv_content self.__key_modified['merge_data_csv_content'] = 1 def get_merge_data_json_content(self): """ The method to get the merge_data_json_content Returns: StreamWrapper: An instance of StreamWrapper """ return self.__merge_data_json_content def set_merge_data_json_content(self, merge_data_json_content): """ The method to set the value to merge_data_json_content Parameters: merge_data_json_content (StreamWrapper) : An instance of StreamWrapper """ if merge_data_json_content is not None and not isinstance(merge_data_json_content, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_content EXPECTED TYPE: StreamWrapper', None, None) self.__merge_data_json_content = merge_data_json_content self.__key_modified['merge_data_json_content'] = 1 def get_merge_data_csv_url(self): """ The method to get the merge_data_csv_url Returns: string: A string representing the merge_data_csv_url """ return self.__merge_data_csv_url def set_merge_data_csv_url(self, merge_data_csv_url): """ The method to set the value to merge_data_csv_url Parameters: merge_data_csv_url (string) : A string representing the merge_data_csv_url """ if merge_data_csv_url is not None and not isinstance(merge_data_csv_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_csv_url EXPECTED TYPE: str', None, None) self.__merge_data_csv_url = merge_data_csv_url self.__key_modified['merge_data_csv_url'] = 1 def get_merge_data_json_url(self): """ The method to get the merge_data_json_url Returns: string: A string representing the merge_data_json_url """ return self.__merge_data_json_url def set_merge_data_json_url(self, merge_data_json_url): """ The method to set the value to merge_data_json_url Parameters: merge_data_json_url (string) : A string representing the merge_data_json_url """ if merge_data_json_url is not None and not isinstance(merge_data_json_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_data_json_url EXPECTED TYPE: str', None, None) self.__merge_data_json_url = merge_data_json_url self.__key_modified['merge_data_json_url'] = 1 def get_password(self): """ The method to get the password Returns: string: A string representing the password """ return self.__password def set_password(self, password): """ The method to set the value to password Parameters: password (string) : A string representing the password """ if password is not None and not isinstance(password, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: password EXPECTED TYPE: str', None, None) self.__password = password self.__key_modified['password'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/merge_and_download_document_parameters.py
merge_and_download_document_parameters.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .writer_response_handler import WriterResponseHandler class MergeFieldsResponse(WriterResponseHandler): def __init__(self): """Creates an instance of MergeFieldsResponse""" super().__init__() self.__merge = None self.__key_modified = dict() def get_merge(self): """ The method to get the merge Returns: list: An instance of list """ return self.__merge def set_merge(self, merge): """ The method to set the value to merge Parameters: merge (list) : An instance of list """ if merge is not None and not isinstance(merge, list): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge EXPECTED TYPE: list', None, None) self.__merge = merge self.__key_modified['merge'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/merge_fields_response.py
merge_fields_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .writer_response_handler import WriterResponseHandler class FillableLinkResponse(WriterResponseHandler): def __init__(self): """Creates an instance of FillableLinkResponse""" super().__init__() self.__fillable_form_url = None self.__key_modified = dict() def get_fillable_form_url(self): """ The method to get the fillable_form_url Returns: string: A string representing the fillable_form_url """ return self.__fillable_form_url def set_fillable_form_url(self, fillable_form_url): """ The method to set the value to fillable_form_url Parameters: fillable_form_url (string) : A string representing the fillable_form_url """ if fillable_form_url is not None and not isinstance(fillable_form_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fillable_form_url EXPECTED TYPE: str', None, None) self.__fillable_form_url = fillable_form_url self.__key_modified['fillable_form_url'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/fillable_link_response.py
fillable_link_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .writer_response_handler import WriterResponseHandler class DocumentDeleteSuccessResponse(WriterResponseHandler): def __init__(self): """Creates an instance of DocumentDeleteSuccessResponse""" super().__init__() self.__document_deleted = None self.__key_modified = dict() def get_document_deleted(self): """ The method to get the document_deleted Returns: bool: A bool representing the document_deleted """ return self.__document_deleted def set_document_deleted(self, document_deleted): """ The method to set the value to document_deleted Parameters: document_deleted (bool) : A bool representing the document_deleted """ if document_deleted is not None and not isinstance(document_deleted, bool): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_deleted EXPECTED TYPE: bool', None, None) self.__document_deleted = document_deleted self.__key_modified['document_deleted'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/document_delete_success_response.py
document_delete_success_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class SheetCallbackSettings(object): def __init__(self): """Creates an instance of SheetCallbackSettings""" self.__save_format = None self.__save_url = None self.__save_url_params = None self.__save_url_headers = None self.__key_modified = dict() def get_save_format(self): """ The method to get the save_format Returns: string: A string representing the save_format """ return self.__save_format def set_save_format(self, save_format): """ The method to set the value to save_format Parameters: save_format (string) : A string representing the save_format """ if save_format is not None and not isinstance(save_format, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_format EXPECTED TYPE: str', None, None) self.__save_format = save_format self.__key_modified['save_format'] = 1 def get_save_url(self): """ The method to get the save_url Returns: string: A string representing the save_url """ return self.__save_url def set_save_url(self, save_url): """ The method to set the value to save_url Parameters: save_url (string) : A string representing the save_url """ if save_url is not None and not isinstance(save_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url EXPECTED TYPE: str', None, None) self.__save_url = save_url self.__key_modified['save_url'] = 1 def get_save_url_params(self): """ The method to get the save_url_params Returns: dict: An instance of dict """ return self.__save_url_params def set_save_url_params(self, save_url_params): """ The method to set the value to save_url_params Parameters: save_url_params (dict) : An instance of dict """ if save_url_params is not None and not isinstance(save_url_params, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_params EXPECTED TYPE: dict', None, None) self.__save_url_params = save_url_params self.__key_modified['save_url_params'] = 1 def get_save_url_headers(self): """ The method to get the save_url_headers Returns: dict: An instance of dict """ return self.__save_url_headers def set_save_url_headers(self, save_url_headers): """ The method to set the value to save_url_headers Parameters: save_url_headers (dict) : An instance of dict """ if save_url_headers is not None and not isinstance(save_url_headers, dict): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_headers EXPECTED TYPE: dict', None, None) self.__save_url_headers = save_url_headers self.__key_modified['save_url_headers'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/sheet_callback_settings.py
sheet_callback_settings.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class SessionInfo(object): def __init__(self): """Creates an instance of SessionInfo""" self.__document_id = None self.__created_time_ms = None self.__created_time = None self.__expires_on_ms = None self.__expires_on = None self.__session_url = None self.__session_delete_url = None self.__key_modified = dict() def get_document_id(self): """ The method to get the document_id Returns: string: A string representing the document_id """ return self.__document_id def set_document_id(self, document_id): """ The method to set the value to document_id Parameters: document_id (string) : A string representing the document_id """ if document_id is not None and not isinstance(document_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_id EXPECTED TYPE: str', None, None) self.__document_id = document_id self.__key_modified['document_id'] = 1 def get_created_time_ms(self): """ The method to get the created_time_ms Returns: int: An int representing the created_time_ms """ return self.__created_time_ms def set_created_time_ms(self, created_time_ms): """ The method to set the value to created_time_ms Parameters: created_time_ms (int) : An int representing the created_time_ms """ if created_time_ms is not None and not isinstance(created_time_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time_ms EXPECTED TYPE: int', None, None) self.__created_time_ms = created_time_ms self.__key_modified['created_time_ms'] = 1 def get_created_time(self): """ The method to get the created_time Returns: string: A string representing the created_time """ return self.__created_time def set_created_time(self, created_time): """ The method to set the value to created_time Parameters: created_time (string) : A string representing the created_time """ if created_time is not None and not isinstance(created_time, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: str', None, None) self.__created_time = created_time self.__key_modified['created_time'] = 1 def get_expires_on_ms(self): """ The method to get the expires_on_ms Returns: int: An int representing the expires_on_ms """ return self.__expires_on_ms def set_expires_on_ms(self, expires_on_ms): """ The method to set the value to expires_on_ms Parameters: expires_on_ms (int) : An int representing the expires_on_ms """ if expires_on_ms is not None and not isinstance(expires_on_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expires_on_ms EXPECTED TYPE: int', None, None) self.__expires_on_ms = expires_on_ms self.__key_modified['expires_on_ms'] = 1 def get_expires_on(self): """ The method to get the expires_on Returns: string: A string representing the expires_on """ return self.__expires_on def set_expires_on(self, expires_on): """ The method to set the value to expires_on Parameters: expires_on (string) : A string representing the expires_on """ if expires_on is not None and not isinstance(expires_on, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expires_on EXPECTED TYPE: str', None, None) self.__expires_on = expires_on self.__key_modified['expires_on'] = 1 def get_session_url(self): """ The method to get the session_url Returns: string: A string representing the session_url """ return self.__session_url def set_session_url(self, session_url): """ The method to set the value to session_url Parameters: session_url (string) : A string representing the session_url """ if session_url is not None and not isinstance(session_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_url EXPECTED TYPE: str', None, None) self.__session_url = session_url self.__key_modified['session_url'] = 1 def get_session_delete_url(self): """ The method to get the session_delete_url Returns: string: A string representing the session_delete_url """ return self.__session_delete_url def set_session_delete_url(self, session_delete_url): """ The method to set the value to session_delete_url Parameters: session_delete_url (string) : A string representing the session_delete_url """ if session_delete_url is not None and not isinstance(session_delete_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete_url EXPECTED TYPE: str', None, None) self.__session_delete_url = session_delete_url self.__key_modified['session_delete_url'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/session_info.py
session_info.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class DocumentConversionOutputOptions(object): def __init__(self): """Creates an instance of DocumentConversionOutputOptions""" self.__format = None self.__document_name = None self.__password = None self.__include_changes = None self.__include_comments = None self.__key_modified = dict() def get_format(self): """ The method to get the format Returns: string: A string representing the format """ return self.__format def set_format(self, format): """ The method to set the value to format Parameters: format (string) : A string representing the format """ if format is not None and not isinstance(format, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) self.__format = format self.__key_modified['format'] = 1 def get_document_name(self): """ The method to get the document_name Returns: string: A string representing the document_name """ return self.__document_name def set_document_name(self, document_name): """ The method to set the value to document_name Parameters: document_name (string) : A string representing the document_name """ if document_name is not None and not isinstance(document_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) self.__document_name = document_name self.__key_modified['document_name'] = 1 def get_password(self): """ The method to get the password Returns: string: A string representing the password """ return self.__password def set_password(self, password): """ The method to set the value to password Parameters: password (string) : A string representing the password """ if password is not None and not isinstance(password, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: password EXPECTED TYPE: str', None, None) self.__password = password self.__key_modified['password'] = 1 def get_include_changes(self): """ The method to get the include_changes Returns: string: A string representing the include_changes """ return self.__include_changes def set_include_changes(self, include_changes): """ The method to set the value to include_changes Parameters: include_changes (string) : A string representing the include_changes """ if include_changes is not None and not isinstance(include_changes, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: include_changes EXPECTED TYPE: str', None, None) self.__include_changes = include_changes self.__key_modified['include_changes'] = 1 def get_include_comments(self): """ The method to get the include_comments Returns: string: A string representing the include_comments """ return self.__include_comments def set_include_comments(self, include_comments): """ The method to set the value to include_comments Parameters: include_comments (string) : A string representing the include_comments """ if include_comments is not None and not isinstance(include_comments, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: include_comments EXPECTED TYPE: str', None, None) self.__include_comments = include_comments self.__key_modified['include_comments'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/document_conversion_output_options.py
document_conversion_output_options.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class WatermarkSettings(object): def __init__(self): """Creates an instance of WatermarkSettings""" self.__text = None self.__type = None self.__orientation = None self.__font_name = None self.__font_size = None self.__font_color = None self.__opacity = None self.__key_modified = dict() def get_text(self): """ The method to get the text Returns: string: A string representing the text """ return self.__text def set_text(self, text): """ The method to set the value to text Parameters: text (string) : A string representing the text """ if text is not None and not isinstance(text, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: text EXPECTED TYPE: str', None, None) self.__text = text self.__key_modified['text'] = 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_orientation(self): """ The method to get the orientation Returns: string: A string representing the orientation """ return self.__orientation def set_orientation(self, orientation): """ The method to set the value to orientation Parameters: orientation (string) : A string representing the orientation """ if orientation is not None and not isinstance(orientation, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: orientation EXPECTED TYPE: str', None, None) self.__orientation = orientation self.__key_modified['orientation'] = 1 def get_font_name(self): """ The method to get the font_name Returns: string: A string representing the font_name """ return self.__font_name def set_font_name(self, font_name): """ The method to set the value to font_name Parameters: font_name (string) : A string representing the font_name """ if font_name is not None and not isinstance(font_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: font_name EXPECTED TYPE: str', None, None) self.__font_name = font_name self.__key_modified['font_name'] = 1 def get_font_size(self): """ The method to get the font_size Returns: int: An int representing the font_size """ return self.__font_size def set_font_size(self, font_size): """ The method to set the value to font_size Parameters: font_size (int) : An int representing the font_size """ if font_size is not None and not isinstance(font_size, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: font_size EXPECTED TYPE: int', None, None) self.__font_size = font_size self.__key_modified['font_size'] = 1 def get_font_color(self): """ The method to get the font_color Returns: string: A string representing the font_color """ return self.__font_color def set_font_color(self, font_color): """ The method to set the value to font_color Parameters: font_color (string) : A string representing the font_color """ if font_color is not None and not isinstance(font_color, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: font_color EXPECTED TYPE: str', None, None) self.__font_color = font_color self.__key_modified['font_color'] = 1 def get_opacity(self): """ The method to get the opacity Returns: float: A float representing the opacity """ return self.__opacity def set_opacity(self, opacity): """ The method to set the value to opacity Parameters: opacity (float) : A float representing the opacity """ if opacity is not None and not isinstance(opacity, float): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: opacity EXPECTED TYPE: float', None, None) self.__opacity = opacity self.__key_modified['opacity'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/watermark_settings.py
watermark_settings.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.response_handler import ResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .response_handler import ResponseHandler class PlanDetails(ResponseHandler): def __init__(self): """Creates an instance of PlanDetails""" super().__init__() self.__usage_limit = None self.__apikey_generated_time = None self.__remaining_usage_limit = None self.__last_payment_date_ms = None self.__next_payment_date_ms = None self.__last_payment_date = None self.__apikey_id = None self.__plan_name = None self.__apikey_generated_time_ms = None self.__payment_link = None self.__next_payment_date = None self.__subscription_interval = None self.__total_usage = None self.__subscription_period = None self.__key_modified = dict() def get_usage_limit(self): """ The method to get the usage_limit Returns: int: An int representing the usage_limit """ return self.__usage_limit def set_usage_limit(self, usage_limit): """ The method to set the value to usage_limit Parameters: usage_limit (int) : An int representing the usage_limit """ if usage_limit is not None and not isinstance(usage_limit, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: usage_limit EXPECTED TYPE: int', None, None) self.__usage_limit = usage_limit self.__key_modified['usage_limit'] = 1 def get_apikey_generated_time(self): """ The method to get the apikey_generated_time Returns: string: A string representing the apikey_generated_time """ return self.__apikey_generated_time def set_apikey_generated_time(self, apikey_generated_time): """ The method to set the value to apikey_generated_time Parameters: apikey_generated_time (string) : A string representing the apikey_generated_time """ if apikey_generated_time is not None and not isinstance(apikey_generated_time, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: apikey_generated_time EXPECTED TYPE: str', None, None) self.__apikey_generated_time = apikey_generated_time self.__key_modified['apikey_generated_time'] = 1 def get_remaining_usage_limit(self): """ The method to get the remaining_usage_limit Returns: int: An int representing the remaining_usage_limit """ return self.__remaining_usage_limit def set_remaining_usage_limit(self, remaining_usage_limit): """ The method to set the value to remaining_usage_limit Parameters: remaining_usage_limit (int) : An int representing the remaining_usage_limit """ if remaining_usage_limit is not None and not isinstance(remaining_usage_limit, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: remaining_usage_limit EXPECTED TYPE: int', None, None) self.__remaining_usage_limit = remaining_usage_limit self.__key_modified['remaining_usage_limit'] = 1 def get_last_payment_date_ms(self): """ The method to get the last_payment_date_ms Returns: int: An int representing the last_payment_date_ms """ return self.__last_payment_date_ms def set_last_payment_date_ms(self, last_payment_date_ms): """ The method to set the value to last_payment_date_ms Parameters: last_payment_date_ms (int) : An int representing the last_payment_date_ms """ if last_payment_date_ms is not None and not isinstance(last_payment_date_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: last_payment_date_ms EXPECTED TYPE: int', None, None) self.__last_payment_date_ms = last_payment_date_ms self.__key_modified['last_payment_date_ms'] = 1 def get_next_payment_date_ms(self): """ The method to get the next_payment_date_ms Returns: int: An int representing the next_payment_date_ms """ return self.__next_payment_date_ms def set_next_payment_date_ms(self, next_payment_date_ms): """ The method to set the value to next_payment_date_ms Parameters: next_payment_date_ms (int) : An int representing the next_payment_date_ms """ if next_payment_date_ms is not None and not isinstance(next_payment_date_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: next_payment_date_ms EXPECTED TYPE: int', None, None) self.__next_payment_date_ms = next_payment_date_ms self.__key_modified['next_payment_date_ms'] = 1 def get_last_payment_date(self): """ The method to get the last_payment_date Returns: string: A string representing the last_payment_date """ return self.__last_payment_date def set_last_payment_date(self, last_payment_date): """ The method to set the value to last_payment_date Parameters: last_payment_date (string) : A string representing the last_payment_date """ if last_payment_date is not None and not isinstance(last_payment_date, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: last_payment_date EXPECTED TYPE: str', None, None) self.__last_payment_date = last_payment_date self.__key_modified['last_payment_date'] = 1 def get_apikey_id(self): """ The method to get the apikey_id Returns: int: An int representing the apikey_id """ return self.__apikey_id def set_apikey_id(self, apikey_id): """ The method to set the value to apikey_id Parameters: apikey_id (int) : An int representing the apikey_id """ if apikey_id is not None and not isinstance(apikey_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: apikey_id EXPECTED TYPE: int', None, None) self.__apikey_id = apikey_id self.__key_modified['apikey_id'] = 1 def get_plan_name(self): """ The method to get the plan_name Returns: string: A string representing the plan_name """ return self.__plan_name def set_plan_name(self, plan_name): """ The method to set the value to plan_name Parameters: plan_name (string) : A string representing the plan_name """ if plan_name is not None and not isinstance(plan_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: plan_name EXPECTED TYPE: str', None, None) self.__plan_name = plan_name self.__key_modified['plan_name'] = 1 def get_apikey_generated_time_ms(self): """ The method to get the apikey_generated_time_ms Returns: int: An int representing the apikey_generated_time_ms """ return self.__apikey_generated_time_ms def set_apikey_generated_time_ms(self, apikey_generated_time_ms): """ The method to set the value to apikey_generated_time_ms Parameters: apikey_generated_time_ms (int) : An int representing the apikey_generated_time_ms """ if apikey_generated_time_ms is not None and not isinstance(apikey_generated_time_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: apikey_generated_time_ms EXPECTED TYPE: int', None, None) self.__apikey_generated_time_ms = apikey_generated_time_ms self.__key_modified['apikey_generated_time_ms'] = 1 def get_payment_link(self): """ The method to get the payment_link Returns: string: A string representing the payment_link """ return self.__payment_link def set_payment_link(self, payment_link): """ The method to set the value to payment_link Parameters: payment_link (string) : A string representing the payment_link """ if payment_link is not None and not isinstance(payment_link, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: payment_link EXPECTED TYPE: str', None, None) self.__payment_link = payment_link self.__key_modified['payment_link'] = 1 def get_next_payment_date(self): """ The method to get the next_payment_date Returns: string: A string representing the next_payment_date """ return self.__next_payment_date def set_next_payment_date(self, next_payment_date): """ The method to set the value to next_payment_date Parameters: next_payment_date (string) : A string representing the next_payment_date """ if next_payment_date is not None and not isinstance(next_payment_date, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: next_payment_date EXPECTED TYPE: str', None, None) self.__next_payment_date = next_payment_date self.__key_modified['next_payment_date'] = 1 def get_subscription_interval(self): """ The method to get the subscription_interval Returns: string: A string representing the subscription_interval """ return self.__subscription_interval def set_subscription_interval(self, subscription_interval): """ The method to set the value to subscription_interval Parameters: subscription_interval (string) : A string representing the subscription_interval """ if subscription_interval is not None and not isinstance(subscription_interval, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: subscription_interval EXPECTED TYPE: str', None, None) self.__subscription_interval = subscription_interval self.__key_modified['subscription_interval'] = 1 def get_total_usage(self): """ The method to get the total_usage Returns: int: An int representing the total_usage """ return self.__total_usage def set_total_usage(self, total_usage): """ The method to set the value to total_usage Parameters: total_usage (int) : An int representing the total_usage """ if total_usage is not None and not isinstance(total_usage, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: total_usage EXPECTED TYPE: int', None, None) self.__total_usage = total_usage self.__key_modified['total_usage'] = 1 def get_subscription_period(self): """ The method to get the subscription_period Returns: string: A string representing the subscription_period """ return self.__subscription_period def set_subscription_period(self, subscription_period): """ The method to set the value to subscription_period Parameters: subscription_period (string) : A string representing the subscription_period """ if subscription_period is not None and not isinstance(subscription_period, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: subscription_period EXPECTED TYPE: str', None, None) self.__subscription_period = subscription_period self.__key_modified['subscription_period'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/plan_details.py
plan_details.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .writer_response_handler import WriterResponseHandler class AllSessionsResponse(WriterResponseHandler): def __init__(self): """Creates an instance of AllSessionsResponse""" super().__init__() self.__document_id = None self.__collaborators_count = None self.__active_sessions_count = None self.__document_name = None self.__document_type = None self.__created_time = None self.__created_time_ms = None self.__expires_on = None self.__expires_on_ms = None self.__sessions = None self.__key_modified = dict() def get_document_id(self): """ The method to get the document_id Returns: string: A string representing the document_id """ return self.__document_id def set_document_id(self, document_id): """ The method to set the value to document_id Parameters: document_id (string) : A string representing the document_id """ if document_id is not None and not isinstance(document_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_id EXPECTED TYPE: str', None, None) self.__document_id = document_id self.__key_modified['document_id'] = 1 def get_collaborators_count(self): """ The method to get the collaborators_count Returns: int: An int representing the collaborators_count """ return self.__collaborators_count def set_collaborators_count(self, collaborators_count): """ The method to set the value to collaborators_count Parameters: collaborators_count (int) : An int representing the collaborators_count """ if collaborators_count is not None and not isinstance(collaborators_count, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: collaborators_count EXPECTED TYPE: int', None, None) self.__collaborators_count = collaborators_count self.__key_modified['collaborators_count'] = 1 def get_active_sessions_count(self): """ The method to get the active_sessions_count Returns: int: An int representing the active_sessions_count """ return self.__active_sessions_count def set_active_sessions_count(self, active_sessions_count): """ The method to set the value to active_sessions_count Parameters: active_sessions_count (int) : An int representing the active_sessions_count """ if active_sessions_count is not None and not isinstance(active_sessions_count, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: active_sessions_count EXPECTED TYPE: int', None, None) self.__active_sessions_count = active_sessions_count self.__key_modified['active_sessions_count'] = 1 def get_document_name(self): """ The method to get the document_name Returns: string: A string representing the document_name """ return self.__document_name def set_document_name(self, document_name): """ The method to set the value to document_name Parameters: document_name (string) : A string representing the document_name """ if document_name is not None and not isinstance(document_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) self.__document_name = document_name self.__key_modified['document_name'] = 1 def get_document_type(self): """ The method to get the document_type Returns: string: A string representing the document_type """ return self.__document_type def set_document_type(self, document_type): """ The method to set the value to document_type Parameters: document_type (string) : A string representing the document_type """ if document_type is not None and not isinstance(document_type, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_type EXPECTED TYPE: str', None, None) self.__document_type = document_type self.__key_modified['document_type'] = 1 def get_created_time(self): """ The method to get the created_time Returns: string: A string representing the created_time """ return self.__created_time def set_created_time(self, created_time): """ The method to set the value to created_time Parameters: created_time (string) : A string representing the created_time """ if created_time is not None and not isinstance(created_time, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time EXPECTED TYPE: str', None, None) self.__created_time = created_time self.__key_modified['created_time'] = 1 def get_created_time_ms(self): """ The method to get the created_time_ms Returns: int: An int representing the created_time_ms """ return self.__created_time_ms def set_created_time_ms(self, created_time_ms): """ The method to set the value to created_time_ms Parameters: created_time_ms (int) : An int representing the created_time_ms """ if created_time_ms is not None and not isinstance(created_time_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: created_time_ms EXPECTED TYPE: int', None, None) self.__created_time_ms = created_time_ms self.__key_modified['created_time_ms'] = 1 def get_expires_on(self): """ The method to get the expires_on Returns: string: A string representing the expires_on """ return self.__expires_on def set_expires_on(self, expires_on): """ The method to set the value to expires_on Parameters: expires_on (string) : A string representing the expires_on """ if expires_on is not None and not isinstance(expires_on, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expires_on EXPECTED TYPE: str', None, None) self.__expires_on = expires_on self.__key_modified['expires_on'] = 1 def get_expires_on_ms(self): """ The method to get the expires_on_ms Returns: int: An int representing the expires_on_ms """ return self.__expires_on_ms def set_expires_on_ms(self, expires_on_ms): """ The method to set the value to expires_on_ms Parameters: expires_on_ms (int) : An int representing the expires_on_ms """ if expires_on_ms is not None and not isinstance(expires_on_ms, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: expires_on_ms EXPECTED TYPE: int', None, None) self.__expires_on_ms = expires_on_ms self.__key_modified['expires_on_ms'] = 1 def get_sessions(self): """ The method to get the sessions Returns: list: An instance of list """ return self.__sessions def set_sessions(self, sessions): """ The method to set the value to sessions Parameters: sessions (list) : An instance of list """ if sessions is not None and not isinstance(sessions, list): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: sessions EXPECTED TYPE: list', None, None) self.__sessions = sessions self.__key_modified['sessions'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/all_sessions_response.py
all_sessions_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler from zohosdk.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .show_response_handler import ShowResponseHandler from .sheet_response_handler import SheetResponseHandler class SessionDeleteSuccessResponse(SheetResponseHandler, ShowResponseHandler): def __init__(self): """Creates an instance of SessionDeleteSuccessResponse""" super().__init__() self.__session_delete = None self.__key_modified = dict() def get_session_delete(self): """ The method to get the session_delete Returns: string: A string representing the session_delete """ return self.__session_delete def set_session_delete(self, session_delete): """ The method to set the value to session_delete Parameters: session_delete (string) : A string representing the session_delete """ if session_delete is not None and not isinstance(session_delete, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete EXPECTED TYPE: str', None, None) self.__session_delete = session_delete self.__key_modified['session_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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/session_delete_success_response.py
session_delete_success_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import StreamWrapper, Constants except Exception: from ...exception import SDKException from ...util import StreamWrapper, Constants class PresentationPreviewParameters(object): def __init__(self): """Creates an instance of PresentationPreviewParameters""" self.__url = None self.__document = None self.__language = None self.__document_info = 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_document(self): """ The method to get the document Returns: StreamWrapper: An instance of StreamWrapper """ return self.__document def set_document(self, document): """ The method to set the value to document Parameters: document (StreamWrapper) : An instance of StreamWrapper """ if document is not None and not isinstance(document, StreamWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) self.__document = document self.__key_modified['document'] = 1 def get_language(self): """ The method to get the language Returns: string: A string representing the language """ return self.__language def set_language(self, language): """ The method to set the value to language Parameters: language (string) : A string representing the language """ if language is not None and not isinstance(language, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) self.__language = language self.__key_modified['language'] = 1 def get_document_info(self): """ The method to get the document_info Returns: DocumentInfo: An instance of DocumentInfo """ return self.__document_info def set_document_info(self, document_info): """ The method to set the value to document_info Parameters: document_info (DocumentInfo) : An instance of DocumentInfo """ try: from zohosdk.src.com.zoho.officeintegrator.v1.document_info import DocumentInfo except Exception: from .document_info import DocumentInfo if document_info is not None and not isinstance(document_info, DocumentInfo): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_info EXPECTED TYPE: DocumentInfo', None, None) self.__document_info = document_info self.__key_modified['document_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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/presentation_preview_parameters.py
presentation_preview_parameters.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants from zohosdk.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler from zohosdk.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler except Exception: from ...exception import SDKException from ...util import Constants from .show_response_handler import ShowResponseHandler from .writer_response_handler import WriterResponseHandler class PreviewResponse(WriterResponseHandler, ShowResponseHandler): def __init__(self): """Creates an instance of PreviewResponse""" super().__init__() self.__preview_url = None self.__document_id = None self.__session_id = None self.__session_delete_url = None self.__document_delete_url = None self.__key_modified = dict() def get_preview_url(self): """ The method to get the preview_url Returns: string: A string representing the preview_url """ return self.__preview_url def set_preview_url(self, preview_url): """ The method to set the value to preview_url Parameters: preview_url (string) : A string representing the preview_url """ if preview_url is not None and not isinstance(preview_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: preview_url EXPECTED TYPE: str', None, None) self.__preview_url = preview_url self.__key_modified['preview_url'] = 1 def get_document_id(self): """ The method to get the document_id Returns: string: A string representing the document_id """ return self.__document_id def set_document_id(self, document_id): """ The method to set the value to document_id Parameters: document_id (string) : A string representing the document_id """ if document_id is not None and not isinstance(document_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_id EXPECTED TYPE: str', None, None) self.__document_id = document_id self.__key_modified['document_id'] = 1 def get_session_id(self): """ The method to get the session_id Returns: string: A string representing the session_id """ return self.__session_id def set_session_id(self, session_id): """ The method to set the value to session_id Parameters: session_id (string) : A string representing the session_id """ if session_id is not None and not isinstance(session_id, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_id EXPECTED TYPE: str', None, None) self.__session_id = session_id self.__key_modified['session_id'] = 1 def get_session_delete_url(self): """ The method to get the session_delete_url Returns: string: A string representing the session_delete_url """ return self.__session_delete_url def set_session_delete_url(self, session_delete_url): """ The method to set the value to session_delete_url Parameters: session_delete_url (string) : A string representing the session_delete_url """ if session_delete_url is not None and not isinstance(session_delete_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete_url EXPECTED TYPE: str', None, None) self.__session_delete_url = session_delete_url self.__key_modified['session_delete_url'] = 1 def get_document_delete_url(self): """ The method to get the document_delete_url Returns: string: A string representing the document_delete_url """ return self.__document_delete_url def set_document_delete_url(self, document_delete_url): """ The method to set the value to document_delete_url Parameters: document_delete_url (string) : A string representing the document_delete_url """ if document_delete_url is not None and not isinstance(document_delete_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_delete_url EXPECTED TYPE: str', None, None) self.__document_delete_url = document_delete_url self.__key_modified['document_delete_url'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/preview_response.py
preview_response.py
try: from zohosdk.src.com.zoho.exception import SDKException from zohosdk.src.com.zoho.util import Constants except Exception: from ...exception import SDKException from ...util import Constants class FillableCallbackSettings(object): def __init__(self): """Creates an instance of FillableCallbackSettings""" self.__output = None self.__url = None self.__http_method_type = None self.__retries = None self.__timeout = None self.__key_modified = dict() def get_output(self): """ The method to get the output Returns: FillableLinkOutputSettings: An instance of FillableLinkOutputSettings """ return self.__output def set_output(self, output): """ The method to set the value to output Parameters: output (FillableLinkOutputSettings) : An instance of FillableLinkOutputSettings """ try: from zohosdk.src.com.zoho.officeintegrator.v1.fillable_link_output_settings import FillableLinkOutputSettings except Exception: from .fillable_link_output_settings import FillableLinkOutputSettings if output is not None and not isinstance(output, FillableLinkOutputSettings): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output EXPECTED TYPE: FillableLinkOutputSettings', None, None) self.__output = output self.__key_modified['output'] = 1 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_http_method_type(self): """ The method to get the http_method_type Returns: string: A string representing the http_method_type """ return self.__http_method_type def set_http_method_type(self, http_method_type): """ The method to set the value to http_method_type Parameters: http_method_type (string) : A string representing the http_method_type """ if http_method_type is not None and not isinstance(http_method_type, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: http_method_type EXPECTED TYPE: str', None, None) self.__http_method_type = http_method_type self.__key_modified['http_method_type'] = 1 def get_retries(self): """ The method to get the retries Returns: int: An int representing the retries """ return self.__retries def set_retries(self, retries): """ The method to set the value to retries Parameters: retries (int) : An int representing the retries """ if retries is not None and not isinstance(retries, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: retries EXPECTED TYPE: int', None, None) self.__retries = retries self.__key_modified['retries'] = 1 def get_timeout(self): """ The method to get the timeout Returns: int: An int representing the timeout """ return self.__timeout def set_timeout(self, timeout): """ The method to set the value to timeout Parameters: timeout (int) : An int representing the timeout """ if timeout is not None and not isinstance(timeout, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: timeout EXPECTED TYPE: int', None, None) self.__timeout = timeout self.__key_modified['timeout'] = 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
zoi-python-sdk
/zoi-python-sdk-1.0.1.tar.gz/zoi-python-sdk-1.0.1/zohosdk/src/com/zoho/officeintegrator/v1/fillable_callback_settings.py
fillable_callback_settings.py