Exemple #1
0
    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')
Exemple #2
0
    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')
Exemple #3
0
    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')
Exemple #4
0
    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')
Exemple #5
0
	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')
Exemple #6
0
	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')
Exemple #7
0
	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')
Exemple #8
0
	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')
Exemple #9
0
    def delete_photo(self, id, module_api_name):
        """
		The method to delete photo

		Parameters:
			id (int) : An int representing the id
			module_api_name (string) : A string representing the module_api_name

		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)

        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_DELETE)
        handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
        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')
Exemple #10
0
    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')
Exemple #11
0
	def get_currencies(self):
		"""
		The method to get currencies

		Returns:
			APIResponse: An instance of APIResponse

		Raises:
			SDKException
		"""

		handler_instance = CommonAPIHandler()
		api_path = ''
		api_path = api_path + '/crm/v2/org/currencies'
		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.currencies.response_handler import ResponseHandler
		except Exception:
			from .response_handler import ResponseHandler
		return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
Exemple #12
0
	def get_related_lists(self):
		"""
		The method to get related lists

		Returns:
			APIResponse: An instance of APIResponse

		Raises:
			SDKException
		"""

		handler_instance = CommonAPIHandler()
		api_path = ''
		api_path = api_path + '/crm/v2/settings/related_lists'
		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.RelatedLists.GetRelatedListsParam'), self.__module)
		try:
			from zcrmsdk.src.com.zoho.crm.api.related_lists.response_handler import ResponseHandler
		except Exception:
			from .response_handler import ResponseHandler
		return handler_instance.api_call(ResponseHandler.__module__, 'application/json')
Exemple #13
0
    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')
Exemple #14
0
    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')
Exemple #15
0
    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')
Exemple #16
0
    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')
Exemple #17
0
    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')
Exemple #18
0
    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')
Exemple #19
0
    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')
Exemple #20
0
    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')
Exemple #21
0
    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')
Exemple #22
0
    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')
Exemple #23
0
    def update_variable_by_api_name(self, api_name, request):
        """
		The method to update variable by api name

		Parameters:
			api_name (string) : A string representing the api_name
			request (BodyWrapper) : An instance of BodyWrapper

		Returns:
			APIResponse: An instance of APIResponse

		Raises:
			SDKException
		"""

        try:
            from zcrmsdk.src.com.zoho.crm.api.variables.body_wrapper import BodyWrapper
        except Exception:
            from .body_wrapper import BodyWrapper

        if not isinstance(api_name, str):
            raise SDKException(Constants.DATA_TYPE_ERROR,
                               'KEY: api_name EXPECTED TYPE: str', None, None)

        if request is not None and not isinstance(request, BodyWrapper):
            raise SDKException(Constants.DATA_TYPE_ERROR,
                               'KEY: request EXPECTED TYPE: BodyWrapper', None,
                               None)

        handler_instance = CommonAPIHandler()
        api_path = ''
        api_path = api_path + '/crm/v2.1/settings/variables/'
        api_path = api_path + str(api_name)
        handler_instance.set_api_path(api_path)
        handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
        handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
        handler_instance.set_content_type('application/json')
        handler_instance.set_request(request)
        try:
            from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
        except Exception:
            from .action_handler import ActionHandler
        return handler_instance.api_call(ActionHandler.__module__,
                                         'application/json')
Exemple #24
0
    def delete_variables(self, param_instance=None):
        """
		The method to delete variables

		Parameters:
			param_instance (ParameterMap) : An instance of ParameterMap

		Returns:
			APIResponse: An instance of APIResponse

		Raises:
			SDKException
		"""

        if param_instance is not None and not isinstance(
                param_instance, ParameterMap):
            raise SDKException(
                Constants.DATA_TYPE_ERROR,
                'KEY: param_instance EXPECTED TYPE: ParameterMap', None, None)

        handler_instance = CommonAPIHandler()
        api_path = ''
        api_path = api_path + '/crm/v2.1/settings/variables'
        handler_instance.set_api_path(api_path)
        handler_instance.set_http_method(Constants.REQUEST_METHOD_DELETE)
        handler_instance.set_category_method(Constants.REQUEST_METHOD_DELETE)
        handler_instance.set_param(param_instance)
        try:
            from zcrmsdk.src.com.zoho.crm.api.variables.action_handler import ActionHandler
        except Exception:
            from .action_handler import ActionHandler
        return handler_instance.api_call(ActionHandler.__module__,
                                         'application/json')
Exemple #25
0
	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.1/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')
Exemple #26
0
	def create_bulk_write_job(self, request):
		"""
		The method to create bulk write 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_write.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/write'
		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_write.action_response import ActionResponse
		except Exception:
			from .action_response import ActionResponse
		return handler_instance.api_call(ActionResponse.__module__, 'application/json')
Exemple #27
0
    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')
Exemple #28
0
	def add_currencies(self, request):
		"""
		The method to add currencies

		Parameters:
			request (BodyWrapper) : An instance of BodyWrapper

		Returns:
			APIResponse: An instance of APIResponse

		Raises:
			SDKException
		"""

		try:
			from zcrmsdk.src.com.zoho.crm.api.currencies.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/org/currencies'
		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.currencies.action_handler import ActionHandler
		except Exception:
			from .action_handler import ActionHandler
		return handler_instance.api_call(ActionHandler.__module__, 'application/json')
Exemple #29
0
    def get_record(self,
                   id,
                   module_api_name,
                   param_instance=None,
                   header_instance=None):
        """
		The method to get 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
			header_instance (HeaderMap) : An instance of HeaderMap

		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)

        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(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_GET)
        handler_instance.set_category_method(Constants.REQUEST_CATEGORY_READ)
        handler_instance.set_param(param_instance)
        handler_instance.set_header(header_instance)
        Utility.get_fields(module_api_name)
        handler_instance.set_module_api_name(module_api_name)
        try:
            from zcrmsdk.src.com.zoho.crm.api.record.response_handler import ResponseHandler
        except Exception:
            from .response_handler import ResponseHandler
        return handler_instance.api_call(ResponseHandler.__module__,
                                         'application/json')
Exemple #30
0
	def update_tags(self, request, param_instance=None):
		"""
		The method to update tags

		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.tags.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.1/settings/tags'
		handler_instance.set_api_path(api_path)
		handler_instance.set_http_method(Constants.REQUEST_METHOD_PUT)
		handler_instance.set_category_method(Constants.REQUEST_CATEGORY_UPDATE)
		handler_instance.set_content_type('application/json')
		handler_instance.set_request(request)
		handler_instance.set_mandatory_checker(True)
		handler_instance.set_param(param_instance)
		try:
			from zcrmsdk.src.com.zoho.crm.api.tags.action_handler import ActionHandler
		except Exception:
			from .action_handler import ActionHandler
		return handler_instance.api_call(ActionHandler.__module__, 'application/json')