def delete_tax(self, id): """ The method to delete tax 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/org/taxes/' 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.taxes.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_role(self, id): """ The method to get 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/settings/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.roles.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_blueprint(self): """ The method to get blueprint 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/blueprint' 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.blue_print.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def revoke_shared_record(self): """ The method to revoke shared record Returns: APIResponse: An instance of APIResponse Raises: SDKException """ handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' 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/share' 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.share_records.delete_action_handler import DeleteActionHandler except Exception: from .delete_action_handler import DeleteActionHandler return handler_instance.api_call(DeleteActionHandler.__module__, 'application/json')
def get_pipeline(self, pipeline_id): """ The method to get pipeline Parameters: pipeline_id (int) : An int representing the pipeline_id Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(pipeline_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline_id EXPECTED TYPE: int', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/pipeline/' api_path = api_path + str(pipeline_id) handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) handler_instance.add_param( Param('layout_id', 'com.zoho.crm.api.Pipeline.GetPipelineParam'), self.__layout_id) try: from zcrmsdk.src.com.zoho.crm.api.pipeline.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_variable_group_by_api_name(self, api_name): """ The method to get variable group by api name Parameters: api_name (string) : A string representing the api_name Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: api_name EXPECTED TYPE: str', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/settings/variable_groups/' api_path = api_path + str(api_name) handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) try: from zcrmsdk.src.com.zoho.crm.api.variable_groups.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
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')
def download_result(self, job_id): """ The method to download result Parameters: job_id (int) : An int representing the job_id Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(job_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: job_id EXPECTED TYPE: int', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/bulk/v2/read/' api_path = api_path + str(job_id) api_path = api_path + '/result' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) try: from zcrmsdk.src.com.zoho.crm.api.bulk_read.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/x-download')
def download_bulk_write_result(self, download_url): """ The method to download bulk write result Parameters: download_url (string) : A string representing the download_url Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(download_url, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: download_url EXPECTED TYPE: str', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/' api_path = api_path + str(download_url) 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_write.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/octet-stream')
def get_variables(self, param_instance=None): """ The method to get variables Parameters: param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if param_instance is not None and not isinstance( param_instance, ParameterMap): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/variables' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) handler_instance.set_param(param_instance) try: from zcrmsdk.src.com.zoho.crm.api.variables.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_bulk_write_job_details(self, job_id): """ The method to get bulk write 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/write/' 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_write.response_wrapper import ResponseWrapper except Exception: from .response_wrapper import ResponseWrapper return handler_instance.api_call(ResponseWrapper.__module__, 'application/json')
def get_profiles(self): """ The method to get profiles Returns: APIResponse: An instance of APIResponse Raises: SDKException """ handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/settings/profiles' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) handler_instance.add_header( Header('If-Modified-Since', 'com.zoho.crm.api.Profiles.GetProfilesHeader'), self.__if_modified_since) try: from zcrmsdk.src.com.zoho.crm.api.profiles.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_record_count_for_tag(self, id, param_instance=None): """ The method to get record count for tag Parameters: id (int) : An int representing the id param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None) if param_instance is not None and not isinstance(param_instance, ParameterMap): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/tags/' api_path = api_path + str(id) api_path = api_path + '/actions/records_count' 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.tags.count_handler import CountHandler except Exception: from .count_handler import CountHandler return handler_instance.api_call(CountHandler.__module__, 'application/json')
def get_wizard_by_id(self, wizard_id, param_instance=None): """ The method to get wizard by id Parameters: wizard_id (int) : An int representing the wizard_id param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(wizard_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: wizard_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/wizards/' api_path = api_path + str(wizard_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.wizards.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_layouts(self): """ The method to get layouts Returns: APIResponse: An instance of APIResponse Raises: SDKException """ handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/layouts' 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.Layouts.GetLayoutsParam'), self.__module) try: from zcrmsdk.src.com.zoho.crm.api.layouts.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def get_mass_update_status(self, module_api_name, param_instance=None): """ The method to get mass update status Parameters: module_api_name (string) : A string representing the module_api_name param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if param_instance is not None and not isinstance(param_instance, ParameterMap): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' api_path = api_path + str(module_api_name) api_path = api_path + '/actions/mass_update' 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.record.mass_update_response_handler import MassUpdateResponseHandler except Exception: from .mass_update_response_handler import MassUpdateResponseHandler return handler_instance.api_call(MassUpdateResponseHandler.__module__, 'application/json')
def delete_contact_roles(self, param_instance=None): """ The method to delete contact roles Parameters: param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if param_instance is not None and not isinstance(param_instance, ParameterMap): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/Contacts/roles' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE) handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE) handler_instance.set_param(param_instance) try: from zcrmsdk.src.com.zoho.crm.api.contact_roles.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def update_record(self, id, module_api_name, request): """ The method to update record Parameters: id (int) : An int representing the id module_api_name (string) : A string representing the module_api_name request (BodyWrapper) : An instance of BodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.record.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 not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if request is not None and not isinstance(request, BodyWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' api_path = api_path + str(module_api_name) api_path = api_path + '/' 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) Utility.get_fields(module_api_name) handler_instance.set_module_api_name(module_api_name) try: from zcrmsdk.src.com.zoho.crm.api.record.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def upload_photo(self, id, module_api_name, request): """ The method to upload photo Parameters: id (int) : An int representing the id module_api_name (string) : A string representing the module_api_name request (FileBodyWrapper) : An instance of FileBodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.record.file_body_wrapper import FileBodyWrapper except Exception: from .file_body_wrapper import FileBodyWrapper if not isinstance(id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None) if not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if request is not None and not isinstance(request, FileBodyWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: FileBodyWrapper', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' api_path = api_path + str(module_api_name) api_path = api_path + '/' api_path = api_path + str(id) api_path = api_path + '/photo' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_POST) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE) handler_instance.set_content_type('multipart/form-data') handler_instance.set_request(request) handler_instance.set_mandatory_checker(True) try: from zcrmsdk.src.com.zoho.crm.api.record.file_handler import FileHandler except Exception: from .file_handler import FileHandler return handler_instance.api_call(FileHandler.__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 mass_update_records(self, module_api_name, request): """ The method to mass update records Parameters: module_api_name (string) : A string representing the module_api_name request (MassUpdateBodyWrapper) : An instance of MassUpdateBodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.record.mass_update_body_wrapper import MassUpdateBodyWrapper except Exception: from .mass_update_body_wrapper import MassUpdateBodyWrapper if not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if request is not None and not isinstance(request, MassUpdateBodyWrapper): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: MassUpdateBodyWrapper', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' api_path = api_path + str(module_api_name) api_path = api_path + '/actions/mass_update' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_POST) 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) Utility.get_fields(module_api_name) handler_instance.set_module_api_name(module_api_name) try: from zcrmsdk.src.com.zoho.crm.api.record.mass_update_action_handler import MassUpdateActionHandler except Exception: from .mass_update_action_handler import MassUpdateActionHandler return handler_instance.api_call(MassUpdateActionHandler.__module__, 'application/json')
def update_pipeline(self, pipeline_id, request): """ The method to update pipeline Parameters: pipeline_id (int) : An int representing the pipeline_id request (BodyWrapper) : An instance of BodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.pipeline.body_wrapper import BodyWrapper except Exception: from .body_wrapper import BodyWrapper if not isinstance(pipeline_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: pipeline_id EXPECTED TYPE: int', None, None) if request is not None and not isinstance(request, BodyWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: BodyWrapper', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2.1/settings/pipeline/' api_path = api_path + str(pipeline_id) handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE) handler_instance.set_content_type('application/json') handler_instance.set_request(request) handler_instance.add_param( Param('layout_id', 'com.zoho.crm.api.Pipeline.UpdatePipelineParam'), self.__layout_id) try: from zcrmsdk.src.com.zoho.crm.api.pipeline.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_related_records(self, param_instance=None, header_instance=None): """ The method to get related records Parameters: param_instance (ParameterMap) : An instance of ParameterMap header_instance (HeaderMap) : An instance of HeaderMap 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) if header_instance is not None and not isinstance( header_instance, HeaderMap): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: header_instance EXPECTED TYPE: HeaderMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' 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 + '/' api_path = api_path + str(self.__related_list_api_name) handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_GET) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ) handler_instance.set_param(param_instance) handler_instance.set_header(header_instance) Utility.get_related_lists(self.__related_list_api_name, self.__module_api_name, handler_instance) try: from zcrmsdk.src.com.zoho.crm.api.related_records.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
def upload_files(self, request, param_instance=None): """ The method to upload files Parameters: request (BodyWrapper) : An instance of BodyWrapper param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.file.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) 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/files' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_POST) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE) handler_instance.set_content_type('multipart/form-data') handler_instance.set_request(request) handler_instance.set_mandatory_checker(True) handler_instance.set_param(param_instance) try: from zcrmsdk.src.com.zoho.crm.api.file.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def upload_file(self, request, header_instance=None): """ The method to upload file Parameters: request (FileBodyWrapper) : An instance of FileBodyWrapper header_instance (HeaderMap) : An instance of HeaderMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.bulk_write.file_body_wrapper import FileBodyWrapper except Exception: from .file_body_wrapper import FileBodyWrapper if request is not None and not isinstance(request, FileBodyWrapper): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: FileBodyWrapper', None, None) if header_instance is not None and not isinstance( header_instance, HeaderMap): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: header_instance EXPECTED TYPE: HeaderMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + 'https://content.zohoapis.com/crm/v2/upload' handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_POST) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_CREATE) handler_instance.set_content_type('multipart/form-data') handler_instance.set_request(request) handler_instance.set_mandatory_checker(True) handler_instance.set_header(header_instance) try: from zcrmsdk.src.com.zoho.crm.api.bulk_write.action_response import ActionResponse except Exception: from .action_response import ActionResponse return handler_instance.api_call(ActionResponse.__module__, 'application/json')
def delete_record(self, id, module_api_name, param_instance=None): """ The method to delete record Parameters: id (int) : An int representing the id module_api_name (string) : A string representing the module_api_name param_instance (ParameterMap) : An instance of ParameterMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None) if not isinstance(module_api_name, str): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: module_api_name EXPECTED TYPE: str', None, None) if param_instance is not None and not isinstance( param_instance, ParameterMap): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' api_path = api_path + str(module_api_name) api_path = api_path + '/' 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) handler_instance.set_param(param_instance) try: from zcrmsdk.src.com.zoho.crm.api.record.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def convert_lead(self, id, request): """ The method to convert lead Parameters: id (int) : An int representing the id request (ConvertBodyWrapper) : An instance of ConvertBodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.record.convert_body_wrapper import ConvertBodyWrapper except Exception: from .convert_body_wrapper import ConvertBodyWrapper 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, ConvertBodyWrapper): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: request EXPECTED TYPE: ConvertBodyWrapper', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/Leads/' api_path = api_path + str(id) api_path = api_path + '/actions/convert' 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) Utility.get_fields("Deals") try: from zcrmsdk.src.com.zoho.crm.api.record.convert_action_handler import ConvertActionHandler except Exception: from .convert_action_handler import ConvertActionHandler return handler_instance.api_call(ConvertActionHandler.__module__, 'application/json')
def update_related_records(self, request): """ The method to update related records Parameters: request (BodyWrapper) : An instance of BodyWrapper Returns: APIResponse: An instance of APIResponse Raises: SDKException """ try: from zcrmsdk.src.com.zoho.crm.api.related_records.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/' 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 + '/' api_path = api_path + str(self.__related_list_api_name) handler_instance.set_api_path(api_path) handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT) handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE) handler_instance.set_content_type('application/json') handler_instance.set_request(request) handler_instance.set_mandatory_checker(True) Utility.get_related_lists(self.__related_list_api_name, self.__module_api_name, handler_instance) try: from zcrmsdk.src.com.zoho.crm.api.related_records.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def delink_record(self, related_record_id, header_instance=None): """ The method to delink record Parameters: related_record_id (int) : An int representing the related_record_id header_instance (HeaderMap) : An instance of HeaderMap Returns: APIResponse: An instance of APIResponse Raises: SDKException """ if not isinstance(related_record_id, int): raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: related_record_id EXPECTED TYPE: int', None, None) if header_instance is not None and not isinstance( header_instance, HeaderMap): raise SDKException( Constants.DATA_TYPE_ERROR, 'KEY: header_instance EXPECTED TYPE: HeaderMap', None, None) handler_instance = CommonAPIHandler() api_path = '' api_path = api_path + '/crm/v2/' 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 + '/' api_path = api_path + str(self.__related_list_api_name) api_path = api_path + '/' api_path = api_path + str(related_record_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) handler_instance.set_header(header_instance) try: from zcrmsdk.src.com.zoho.crm.api.related_records.action_handler import ActionHandler except Exception: from .action_handler import ActionHandler return handler_instance.api_call(ActionHandler.__module__, 'application/json')
def get_inventory_template_by_id(self, id): """ The method to get inventory template 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/inventory_templates/' 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( 'sort_by', 'com.zoho.crm.api.InventoryTemplates.GetInventoryTemplatebyIDParam' ), self.__sort_by) handler_instance.add_param( Param( 'sort_order', 'com.zoho.crm.api.InventoryTemplates.GetInventoryTemplatebyIDParam' ), self.__sort_order) handler_instance.add_param( Param( 'category', 'com.zoho.crm.api.InventoryTemplates.GetInventoryTemplatebyIDParam' ), self.__category) try: from zcrmsdk.src.com.zoho.crm.api.inventory_templates.response_handler import ResponseHandler except Exception: from .response_handler import ResponseHandler return handler_instance.api_call(ResponseHandler.__module__, 'application/json')