├── setup.cfg ├── officeintegrator ├── __init__.py └── src │ ├── __init__.py │ └── com │ ├── zoho │ ├── __init__.py │ ├── api │ │ ├── __init__.py │ │ └── authenticator │ │ │ ├── store │ │ │ ├── __init__.py │ │ │ └── token_store.py │ │ │ ├── __init__.py │ │ │ ├── authentication_schema.py │ │ │ ├── parsable_enum.py │ │ │ ├── token.py │ │ │ └── auth.py │ └── officeintegrator │ │ ├── exception │ │ ├── __init__.py │ │ └── sdk_exception.py │ │ ├── logger │ │ ├── __init__.py │ │ └── logger.py │ │ ├── dc │ │ ├── __init__.py │ │ ├── environment.py │ │ └── api_server.py │ │ ├── v1 │ │ ├── response_handler.py │ │ ├── show_response_handler.py │ │ ├── sheet_response_handler.py │ │ ├── writer_response_handler.py │ │ ├── sheet_response_handler1.py │ │ ├── authentication.py │ │ ├── combine_pd_fs_output_settings.py │ │ ├── sheet_download_parameters.py │ │ ├── fillable_link_output_settings.py │ │ ├── zoho_show_editor_settings.py │ │ ├── sheet_ui_options.py │ │ ├── sheet_user_settings.py │ │ ├── preview_document_info.py │ │ ├── merge_fields_response.py │ │ ├── fillable_link_response.py │ │ ├── document_delete_success_response.py │ │ ├── document_session_delete_success_response.py │ │ ├── file_delete_success_response.py │ │ ├── session_delete_success_response.py │ │ ├── file_body_wrapper.py │ │ ├── sheet_editor_settings.py │ │ ├── user_info.py │ │ ├── session_user_info.py │ │ ├── sheet_conversion_output_options.py │ │ ├── document_info.py │ │ ├── get_merge_fields_parameters.py │ │ ├── mail_merge_webhook_settings.py │ │ ├── compare_document_response.py │ │ ├── merge_and_deliver_via_webhook_success_response.py │ │ ├── combine_pd_fs_parameters.py │ │ ├── editor_settings.py │ │ ├── merge_fields.py │ │ ├── fillable_form_options.py │ │ ├── convert_presentation_parameters.py │ │ ├── watermark_parameters.py │ │ ├── sheet_conversion_parameters.py │ │ ├── margin.py │ │ ├── __init__.py │ │ ├── fillable_submission_settings.py │ │ ├── merge_and_deliver_records_meta.py │ │ ├── sheet_preview_parameters.py │ │ ├── ui_options.py │ │ ├── sheet_callback_settings.py │ │ ├── session_meta.py │ │ ├── presentation_preview_parameters.py │ │ ├── preview_parameters.py │ │ ├── document_conversion_parameters.py │ │ ├── invalid_configuration_exception.py │ │ ├── document_conversion_output_options.py │ │ └── fillable_callback_settings.py │ │ ├── util │ │ ├── choice.py │ │ ├── __init__.py │ │ ├── text_converter.py │ │ ├── utility.py │ │ ├── xml_converter.py │ │ ├── stream_wrapper.py │ │ ├── api_response.py │ │ ├── datatype_converter.py │ │ └── header_param_validator.py │ │ ├── __init__.py │ │ ├── header.py │ │ ├── param.py │ │ ├── user_signature.py │ │ ├── sdk_config.py │ │ ├── request_proxy.py │ │ ├── parameter_map.py │ │ └── header_map.py │ └── __init__.py ├── MANIFEST.in ├── LICENSE ├── .gitignore ├── setup.py └── README.md /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal=1 -------------------------------------------------------------------------------- /officeintegrator/__init__.py: -------------------------------------------------------------------------------- 1 | from . import src 2 | -------------------------------------------------------------------------------- /officeintegrator/src/__init__.py: -------------------------------------------------------------------------------- 1 | from . import com 2 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/__init__.py: -------------------------------------------------------------------------------- 1 | from . import api -------------------------------------------------------------------------------- /officeintegrator/src/com/__init__.py: -------------------------------------------------------------------------------- 1 | from . import zoho 2 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/__init__.py: -------------------------------------------------------------------------------- 1 | from . import authenticator -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/exception/__init__.py: -------------------------------------------------------------------------------- 1 | from .sdk_exception import SDKException 2 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/logger/__init__.py: -------------------------------------------------------------------------------- 1 | from .logger import Logger, SDKLogger 2 | 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.py 2 | include *.json 3 | include LICENSE 4 | recursive-include zohosdk * 5 | recursive-exclude zohosdk *.pyc -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/dc/__init__.py: -------------------------------------------------------------------------------- 1 | from .environment import Environment 2 | from .api_server import APIServer 3 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/store/__init__.py: -------------------------------------------------------------------------------- 1 | from .db_store import DBStore 2 | from .file_store import FileStore 3 | from .token_store import TokenStore 4 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/response_handler.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class ResponseHandler(ABC): 5 | def __init__(self): 6 | """Creates an instance of ResponseHandler""" 7 | pass 8 | 9 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/show_response_handler.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class ShowResponseHandler(ABC): 5 | def __init__(self): 6 | """Creates an instance of ShowResponseHandler""" 7 | pass 8 | 9 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_response_handler.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class SheetResponseHandler(ABC): 5 | def __init__(self): 6 | """Creates an instance of SheetResponseHandler""" 7 | pass 8 | 9 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/writer_response_handler.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class WriterResponseHandler(ABC): 5 | def __init__(self): 6 | """Creates an instance of WriterResponseHandler""" 7 | pass 8 | 9 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/__init__.py: -------------------------------------------------------------------------------- 1 | from .token import Token 2 | from . import store 3 | from .auth import Auth 4 | from .oauth2 import OAuth2 5 | from .authentication_schema import AuthenticationSchema 6 | from .parsable_enum import ParsableEnum -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/choice.py: -------------------------------------------------------------------------------- 1 | 2 | class Choice(object): 3 | 4 | """ 5 | Common Class to provide or obtain a value, when there are multiple supported values. 6 | """ 7 | 8 | def __init__(self, value): 9 | self.__value = value 10 | 11 | def get_value(self): 12 | return self.__value 13 | 14 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/authentication_schema.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod, ABC 2 | 3 | 4 | class AuthenticationSchema(ABC): 5 | 6 | def get_authentication_type(self): 7 | pass 8 | 9 | def get_token_url(self): 10 | pass 11 | 12 | def get_refresh_url(self): 13 | pass 14 | 15 | def get_schema(self): 16 | pass 17 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/parsable_enum.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | class ParsableEnum(Enum): 4 | 5 | def get_transform_value(self) -> str: 6 | return self.name.lower() 7 | 8 | @classmethod 9 | def parse(cls, value): 10 | 11 | for item in cls: 12 | if item.get_transform_value() == value.lower(): 13 | return item 14 | raise ValueError(f"Given value '{value}' is not a valid '{cls.__name__}'") 15 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/__init__.py: -------------------------------------------------------------------------------- 1 | from . import dc 2 | from . import v1 3 | from . import exception 4 | from . import logger 5 | from . import util 6 | from .header import Header 7 | from .header_map import HeaderMap 8 | from .param import Param 9 | from .parameter_map import ParameterMap 10 | from .initializer import Initializer 11 | from .user_signature import UserSignature 12 | from .request_proxy import RequestProxy 13 | from .sdk_config import SDKConfig 14 | 15 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/header.py: -------------------------------------------------------------------------------- 1 | 2 | class Header(object): 3 | 4 | """ 5 | This class represents the HTTP header. 6 | """ 7 | 8 | def __init__(self, name, class_name=None): 9 | 10 | """ 11 | Creates an Header class instance with the following parameters 12 | 13 | Parameters: 14 | name (str) : A string containing the header name. 15 | class_name (str) : A string containing the header class name. 16 | """ 17 | 18 | self.name = name 19 | self.class_name = class_name 20 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/param.py: -------------------------------------------------------------------------------- 1 | 2 | class Param(object): 3 | 4 | """ 5 | This class represents the HTTP parameter. 6 | """ 7 | 8 | def __init__(self, name, class_name=None): 9 | 10 | """ 11 | Creates an Param class instance with the following parameters 12 | 13 | Parameters: 14 | name (str) : A string containing the parameter name. 15 | class_name (str) : A string containing the parameter class name. 16 | """ 17 | 18 | self.name = name 19 | self.class_name = class_name 20 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/dc/environment.py: -------------------------------------------------------------------------------- 1 | from officeintegrator.src.com.zoho.api.authenticator.token import Token 2 | from abc import abstractmethod, ABC 3 | 4 | class Environment(ABC): 5 | 6 | @abstractmethod 7 | def get_url(self): 8 | pass 9 | 10 | @abstractmethod 11 | def get_dc(self) -> str: 12 | pass 13 | 14 | @abstractmethod 15 | def get_location(self) -> 'Token.Location': 16 | pass 17 | 18 | @abstractmethod 19 | def get_name(self): 20 | pass 21 | 22 | @abstractmethod 23 | def get_value(self): 24 | pass -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024, ZOHO CORPORATION PRIVATE LIMITED 2 | All rights reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/user_signature.py: -------------------------------------------------------------------------------- 1 | 2 | class UserSignature(object): 3 | 4 | """ 5 | This class represents the Zoho User. 6 | """ 7 | 8 | def __init__(self, name): 9 | 10 | """ 11 | Creates an UserSignature class instance with the specified user_name. 12 | 13 | Parameters: 14 | name (str) : A string containing the user_name 15 | """ 16 | 17 | self.__name = name 18 | 19 | def get_name(self): 20 | """ 21 | This is a getter method to get __name. 22 | 23 | Returns: 24 | string: A string representing __name 25 | """ 26 | 27 | return self.__name 28 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/__init__.py: -------------------------------------------------------------------------------- 1 | from .common_api_handler import CommonAPIHandler 2 | from .converter import Converter 3 | from .json_converter import JSONConverter 4 | from .xml_converter import XMLConverter 5 | from .form_data_converter import FormDataConverter 6 | from .downloader import Downloader 7 | from .api_http_connector import APIHTTPConnector 8 | from .api_response import APIResponse 9 | from .constants import Constants 10 | from .utility import Utility 11 | from .datatype_converter import DataTypeConverter 12 | from .stream_wrapper import StreamWrapper 13 | from .choice import Choice 14 | from .header_param_validator import HeaderParamValidator 15 | from .text_converter import TextConverter 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases # 24 | ###################### 25 | *.log 26 | *.sqlite 27 | 28 | # OS generated files # 29 | ###################### 30 | .DS_Store 31 | .DS_Store? 32 | ._* 33 | .Spotlight-V100 34 | .Trashes 35 | ehthumbs.db 36 | Thumbs.db 37 | *.swp 38 | *.swo 39 | *.orig 40 | 41 | # IDE related files # 42 | ###################### 43 | .classpath 44 | .project 45 | .settings 46 | .idea 47 | .metadata 48 | *.iml 49 | *.ipr 50 | /.zide_resources/ 51 | /bin/ 52 | /.antsetup/ 53 | /.zide/ 54 | **/sdk_tokens.txt 55 | **/java-sdk/target 56 | 57 | # Byte-compiled / optimized / DLL files 58 | __pycache__/ 59 | *.py[cod] 60 | *$py.class 61 | **/path/* 62 | **/dist/* -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/text_converter.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.util import Converter 3 | except: 4 | from .converter import Converter 5 | 6 | 7 | class TextConverter(Converter): 8 | def __init__(self, common_api_handler): 9 | super().__init__(common_api_handler) 10 | 11 | def get_wrapped_request(self, response, pack): 12 | return None 13 | 14 | def form_request(self, request_instance, pack, instance_number, class_member_detail, group_type): 15 | return None 16 | 17 | def append_to_request(self, request_base, request_object): 18 | pass 19 | 20 | def get_wrapped_response(self, response, contents): 21 | response_entity = response.content 22 | 23 | if response_entity: 24 | response_object = response_entity.decode('utf-8') # Assuming the response is in UTF-8 25 | 26 | result_object = self.get_response(response_object, None, None) 27 | 28 | return [result_object, None] 29 | 30 | return None 31 | 32 | def get_response(self, response, pack, group_type): 33 | return response 34 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/utility.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 3 | 4 | except Exception: 5 | from ..exception import SDKException 6 | 7 | 8 | class Utility(object): 9 | """ 10 | This class handles module field details. 11 | """ 12 | 13 | @staticmethod 14 | def get_json_object(json, key): 15 | for key_in_json in json.keys(): 16 | if key_in_json.lower() == key.lower(): 17 | return json[key_in_json] 18 | 19 | return None 20 | 21 | @staticmethod 22 | def check_data_type(value, type): 23 | try: 24 | from officeintegrator.src.com.zoho.officeintegrator.util import Constants 25 | except Exception: 26 | from .constants import Constants 27 | if value is None: 28 | return False 29 | if type.lower() == Constants.OBJECT.lower(): 30 | return True 31 | type = Constants.DATA_TYPE.get(type) 32 | class_name = value.__class__ 33 | if class_name == type: 34 | return True 35 | else: 36 | return False -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/token.py: -------------------------------------------------------------------------------- 1 | import enum 2 | from abc import abstractmethod, ABC 3 | 4 | from officeintegrator.src.com.zoho.api.authenticator.parsable_enum import ParsableEnum 5 | 6 | 7 | class Token(ABC): 8 | """ 9 | The class to verify and set token to the APIHTTPConnector instance, to authenticate requests. 10 | """ 11 | 12 | @abstractmethod 13 | def authenticate(self, url_connection, config): pass 14 | 15 | @abstractmethod 16 | def remove(self): pass 17 | 18 | @abstractmethod 19 | def generate_token(self): pass 20 | 21 | def get_id(self): pass 22 | 23 | def get_authentication_schema(self): pass 24 | 25 | class Location(ParsableEnum): 26 | HEADER = "HEADER" 27 | PARAM = "PARAM" 28 | VARIABLE = "VARIABLE" 29 | 30 | @classmethod 31 | def parse(cls, location): 32 | return super().parse(location) 33 | 34 | class AuthenticationType(ParsableEnum): 35 | OAUTH2 = "OAUTH2" 36 | TOKEN = "TOKEN" 37 | 38 | @classmethod 39 | def parse(cls, type): 40 | return super().parse(type) 41 | 42 | def get_name(self): 43 | return self.name 44 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/xml_converter.py: -------------------------------------------------------------------------------- 1 | try: 2 | from .converter import Converter 3 | import logging 4 | 5 | except Exception: 6 | from .converter import Converter 7 | import logging 8 | 9 | 10 | class XMLConverter(Converter): 11 | 12 | """ 13 | This class processes the API response object to the POJO object and POJO object to an XML object. 14 | """ 15 | 16 | logger = logging.getLogger('SDKLogger') 17 | 18 | def __init__(self, common_api_handler): 19 | 20 | super().__init__(common_api_handler) 21 | 22 | self.unique_dict = {} 23 | 24 | self.count = 0 25 | 26 | self.common_api_handler = common_api_handler 27 | 28 | def get_wrapped_request(self, response, pack): 29 | 30 | return None 31 | 32 | def form_request(self, request_instance, pack, instance_number, class_member_detail, group_type): 33 | 34 | return None 35 | 36 | def append_to_request(self, request_base, request_object): 37 | 38 | return None 39 | 40 | def get_wrapped_response(self, response, pack): 41 | 42 | return None 43 | 44 | def get_response(self, response, pack, group_type): 45 | 46 | return None 47 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/exception/sdk_exception.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | 4 | class SDKException(Exception): 5 | 6 | """ 7 | This class is the common SDKException object. 8 | """ 9 | 10 | message = 'Caused By: {code} - {message}' 11 | 12 | def __init__(self, code=None, message=None, details=None, cause=None): 13 | 14 | """ 15 | Creates an SDKException class instance with the specified parameters. 16 | 17 | Parameters: 18 | code (str) : A string containing the Exception error code. 19 | message (str) : A string containing the Exception error message. 20 | details (dict) : A dict containing the error response. 21 | cause (Exception) : A Exception class instance. 22 | """ 23 | 24 | self.code = code 25 | self.cause = cause 26 | self.details = details 27 | self.error_message = "" if message is None else message 28 | 29 | if self.details is not None: 30 | self.error_message = self.error_message + json.dumps(self.details) 31 | 32 | if self.cause is not None: 33 | self.error_message = self.error_message + str(self.cause) 34 | 35 | Exception.__init__(self, code, message) 36 | 37 | def __str__(self): 38 | return_msg = SDKException.__class__.__name__ 39 | if self.details is not None: 40 | self.error_message = self.error_message + self.details.__str__() if self.error_message is not None else self.details.__str__() 41 | 42 | if self.code is not None: 43 | return_msg += self.message.format(code=self.code, message=self.error_message) 44 | return return_msg 45 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | # To use a consistent encoding 3 | from codecs import open 4 | from os import path 5 | 6 | here = path.abspath(path.dirname(__file__)) 7 | 8 | # Get the long description from the README file 9 | with open(path.join(here, 'README.md'), encoding='utf-8') as f: 10 | long_description = f.read() 11 | 12 | setup( 13 | name='office-integrator-sdk', 14 | version='1.0.0b2', 15 | description='Zoho Office Integrator Python SDK', 16 | long_description=long_description, 17 | long_description_content_type='text/markdown', 18 | url='https://github.com/zoho/office-integrator-php-sdk', 19 | author='Team - Zoho Office Integrator', 20 | author_email='support@zohoofficeintegrator.com', 21 | scripts=[], 22 | classifiers=[ 23 | 'Development Status :: 5 - Production/Stable', 24 | 'Intended Audience :: Developers', 25 | 'License :: OSI Approved :: Apache Software License', 26 | 'Topic :: Software Development :: Build Tools', 27 | 'Programming Language :: Python :: 3', 28 | 'Programming Language :: Python :: 3.3', 29 | 'Programming Language :: Python :: 3.4', 30 | 'Programming Language :: Python :: 3.5', 31 | 'Programming Language :: Python :: 3.6', 32 | 'Programming Language :: Python :: 3.7', 33 | 'Programming Language :: Python :: 3.8', 34 | ], 35 | install_requires=[ 36 | 'requests', 37 | 'python-dateutil', 38 | 'urllib3', 39 | 'mysql-connector-python' 40 | ], 41 | license='Apache License 2.0', 42 | keywords=['development', 'zoho', 'api', 'zohosdk', 'sdk', 'Zoho Office Integrator', 'Office Suite Editors', 'Document', 'Presentation', 'Spreadsheet'], 43 | packages=find_packages(), 44 | include_package_data=True 45 | ) 46 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/stream_wrapper.py: -------------------------------------------------------------------------------- 1 | try: 2 | import os 3 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 4 | from officeintegrator.src.com.zoho.officeintegrator.util import Constants 5 | 6 | except Exception: 7 | import os 8 | from ..exception import SDKException 9 | from .constants import Constants 10 | 11 | 12 | class StreamWrapper(object): 13 | 14 | """ 15 | This class handles the file stream and name. 16 | """ 17 | 18 | def __init__(self, name=None, stream=None, file_path=None): 19 | 20 | """ 21 | Creates a StreamWrapper class instance with the specified parameters. 22 | 23 | Parameters: 24 | name (str) : A string containing the file name. 25 | stream (stream) : A stream containing the file stream. 26 | file_path (str) : A string containing the absolute file path. 27 | """ 28 | 29 | if file_path is not None: 30 | if not os.path.exists(file_path): 31 | raise SDKException(Constants.FILE_ERROR, Constants.FILE_DOES_NOT_EXISTS) 32 | 33 | self.__name = os.path.basename(file_path) 34 | self.__stream = open(file_path, 'rb') 35 | 36 | else: 37 | self.__name = name 38 | self.__stream = stream 39 | 40 | def get_name(self): 41 | 42 | """ 43 | This is a getter method to get the file name. 44 | 45 | Returns: 46 | string : A string representing the file name. 47 | """ 48 | 49 | return self.__name 50 | 51 | def get_stream(self): 52 | 53 | """ 54 | This is a getter method to get the file input stream. 55 | 56 | Returns: 57 | stream : A stream representing the file stream. 58 | """ 59 | 60 | return self.__stream 61 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/sdk_config.py: -------------------------------------------------------------------------------- 1 | class SDKConfig(object): 2 | """ 3 | The class to configure the SDK. 4 | """ 5 | 6 | def __init__(self, pick_list_validation=True, read_timeout=None, connect_timeout=None, socket_timeout=None): 7 | """ 8 | Creates an instance of SDKConfig with the following parameters 9 | 10 | Parameters: 11 | pick_list_validation(bool): A bool representing pick_list_validation 12 | read_timeout(float): A Float representing read_timeout 13 | connect_timeout(float): A Float representing connect_timeout 14 | socket_timeout(float): A Float representing socket_timeout 15 | """ 16 | self.__pick_list_validation = pick_list_validation 17 | self.__read_timeout = read_timeout 18 | self.__connect_timeout = connect_timeout 19 | self.__socket_timeout = socket_timeout 20 | 21 | def get_socket_timeout(self): 22 | """ 23 | This is a getter method to get socket_timeout. 24 | 25 | Returns: 26 | Float: A Float representing socket_timeout. 27 | """ 28 | 29 | def get_pick_list_validation(self): 30 | """ 31 | This is a getter method to get pick_list_validation. 32 | 33 | Returns: 34 | bool: A bool representing pick_list_validation 35 | """ 36 | return self.__pick_list_validation 37 | 38 | def get_read_timeout(self): 39 | """ 40 | This is a getter method to get read_timeout. 41 | 42 | Returns: 43 | Float: A Float representing read_timeout 44 | """ 45 | return self.__read_timeout 46 | 47 | def get_connect_timeout(self): 48 | """ 49 | This is a getter method to get connect_timeout. 50 | 51 | Returns: 52 | Float: A Float representing connect_timeout 53 | """ 54 | return self.__connect_timeout 55 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_response_handler1.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .sheet_response_handler import SheetResponseHandler 9 | 10 | 11 | class SheetResponseHandler1(SheetResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of SheetResponseHandler1""" 14 | super().__init__() 15 | 16 | self.__key_modified = dict() 17 | 18 | def is_key_modified(self, key): 19 | """ 20 | The method to check if the user has modified the given key 21 | 22 | Parameters: 23 | key (string) : A string representing the key 24 | 25 | Returns: 26 | int: An int representing the modification 27 | """ 28 | 29 | if key is not None and not isinstance(key, str): 30 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 31 | 32 | if key in self.__key_modified: 33 | return self.__key_modified.get(key) 34 | 35 | return None 36 | 37 | def set_key_modified(self, key, modification): 38 | """ 39 | The method to mark the given key as modified 40 | 41 | Parameters: 42 | key (string) : A string representing the key 43 | modification (int) : An int representing the modification 44 | """ 45 | 46 | if key is not None and not isinstance(key, str): 47 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 48 | 49 | if modification is not None and not isinstance(modification, int): 50 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 51 | 52 | self.__key_modified[key] = modification 53 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/authentication.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.api.authenticator.authentication_schema import AuthenticationSchema 5 | from officeintegrator.src.com.zoho.api.authenticator.token import Token 6 | except Exception: 7 | from ..exception import SDKException 8 | from ..util import Constants 9 | from ....zoho.api.authenticator.authentication_schema import AuthenticationSchema 10 | from ....zoho.api.authenticator.token import Token 11 | 12 | 13 | class Authentication(object): 14 | def __init__(self): 15 | """Creates an instance of Authentication""" 16 | pass 17 | 18 | 19 | 20 | class TokenFlow(AuthenticationSchema): 21 | pass 22 | 23 | def get_token_url(self): 24 | """ 25 | The method to get Token Url 26 | 27 | Returns: 28 | string: A string representing the Token_url 29 | """ 30 | 31 | return '/zest/v1/__internal/ticket' 32 | 33 | def get_authentication_url(self): 34 | """ 35 | The method to get Authentication Url 36 | 37 | Returns: 38 | string: A string representing the Authentication_url 39 | """ 40 | 41 | return '' 42 | 43 | def get_refresh_url(self): 44 | """ 45 | The method to get Refresh Url 46 | 47 | Returns: 48 | string: A string representing the Refresh_url 49 | """ 50 | 51 | return '' 52 | 53 | def get_schema(self): 54 | """ 55 | The method to get Schema 56 | 57 | Returns: 58 | string: A string representing the Schema 59 | """ 60 | 61 | return 'TokenFlow' 62 | 63 | def get_authentication_type(self): 64 | """ 65 | The method to get Authentication Type 66 | 67 | Returns: 68 | AuthenticationType: An instance of AuthenticationType 69 | """ 70 | 71 | return Token.AuthenticationType.TOKEN 72 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/api_response.py: -------------------------------------------------------------------------------- 1 | 2 | class APIResponse(object): 3 | 4 | """ 5 | This class is the common API response object. 6 | """ 7 | 8 | def __init__(self, headers, status_code, object, response_json): 9 | 10 | """ 11 | Creates an APIResponse class instance with the specified parameters. 12 | 13 | Parameters: 14 | headers (dict) : A dict containing the API response headers. 15 | status_code (int) : An integer containing the API response HTTP status code. 16 | object (object) : An object containing the API response class instance. 17 | """ 18 | 19 | self.__headers = headers 20 | self.__status_code = status_code 21 | self.__object = object 22 | self.__response_json = response_json 23 | 24 | def get_response_json(self): 25 | """ 26 | This is a getter method to get API response_json 27 | 28 | Returns: 29 | dict: A dict representing the API response_json 30 | """ 31 | 32 | return self.__response_json 33 | 34 | def get_headers(self): 35 | 36 | """ 37 | This is a getter method to get API response headers. 38 | 39 | Returns: 40 | dict: A dict representing the API response headers. 41 | """ 42 | 43 | return self.__headers 44 | 45 | def get_status_code(self): 46 | 47 | """ 48 | This is a getter method to get the API response HTTP status code. 49 | 50 | Returns: 51 | int: An integer representing the API response HTTP status code. 52 | """ 53 | 54 | return self.__status_code 55 | 56 | def get_object(self): 57 | 58 | """ 59 | This method to get an API response class instance. 60 | 61 | Returns: 62 | object: An object containing the API response class instance. 63 | """ 64 | 65 | return self.__object 66 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/store/token_store.py: -------------------------------------------------------------------------------- 1 | try: 2 | from abc import ABC, abstractmethod 3 | 4 | except Exception as e: 5 | from abc import ABC, abstractmethod 6 | 7 | 8 | class TokenStore(ABC): 9 | 10 | """ 11 | This class is to store user token details. 12 | """ 13 | 14 | @abstractmethod 15 | def find_token(self, token): 16 | 17 | """ 18 | The method to get user token details. 19 | 20 | Parameters: 21 | token (Token) : A Token class instance. 22 | 23 | Returns: 24 | Token : A Token class instance representing the user token details. 25 | """ 26 | 27 | pass 28 | 29 | @abstractmethod 30 | def save_token(self, token): 31 | 32 | """ 33 | The method to store user token details. 34 | 35 | Parameters: 36 | token (Token) : A Token class instance. 37 | """ 38 | 39 | pass 40 | 41 | @abstractmethod 42 | def delete_token(self, id): 43 | 44 | """ 45 | The method to delete user token details. 46 | 47 | Parameters: 48 | id (str) : A Token class instance. 49 | """ 50 | 51 | pass 52 | 53 | @abstractmethod 54 | def get_tokens(self): 55 | 56 | """ 57 | The method to retrieve all the stored tokens. 58 | 59 | Returns: 60 | list : A List of Token instances 61 | """ 62 | 63 | pass 64 | 65 | @abstractmethod 66 | def delete_tokens(self): 67 | 68 | """ 69 | The method to delete all the stored tokens. 70 | """ 71 | 72 | pass 73 | @abstractmethod 74 | def find_token_by_id(self, id): 75 | 76 | """ 77 | The method to get id token details. 78 | 79 | Parameters: 80 | id (String) : A String id. 81 | 82 | Returns: 83 | Token : A Token class instance representing the id token details. 84 | """ 85 | 86 | pass 87 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/dc/api_server.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.api.authenticator.token import Token 5 | from officeintegrator.src.com.zoho.officeintegrator.dc.environment import Environment 6 | except Exception: 7 | from ..exception import SDKException 8 | from ..util import Constants 9 | from ....zoho.api.authenticator.token import Token 10 | from .environment import Environment 11 | 12 | 13 | class APIServer(object): 14 | def __init__(self): 15 | """Creates an instance of APIServer""" 16 | pass 17 | 18 | 19 | 20 | class Production(Environment): 21 | def __init__(self, server_domain): 22 | """ 23 | Creates an instance of Production with the given parameters 24 | 25 | Parameters: 26 | server_domain (string) : A string representing the server_domain 27 | """ 28 | 29 | if server_domain is not None and not isinstance(server_domain, str): 30 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: server_domain EXPECTED TYPE: str', None, None) 31 | 32 | self.__server_domain = server_domain 33 | 34 | 35 | def get_url(self): 36 | """ 37 | The method to get Url 38 | 39 | Returns: 40 | string: A string representing the Url 41 | """ 42 | 43 | return '' + self.__server_domain + '' 44 | 45 | def get_dc(self): 46 | """ 47 | The method to get dc 48 | 49 | Returns: 50 | string: A string representing the dc 51 | """ 52 | 53 | return 'alldc' 54 | 55 | def get_location(self): 56 | """ 57 | The method to get location 58 | 59 | Returns: 60 | Location: An instance of Location 61 | """ 62 | 63 | return None 64 | 65 | def get_name(self): 66 | """ 67 | The method to get name 68 | 69 | Returns: 70 | string: A string representing the name 71 | """ 72 | 73 | return '' 74 | 75 | def get_value(self): 76 | """ 77 | The method to get value 78 | 79 | Returns: 80 | string: A string representing the value 81 | """ 82 | 83 | return '' 84 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/combine_pd_fs_output_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class CombinePDFsOutputSettings(object): 10 | def __init__(self): 11 | """Creates an instance of CombinePDFsOutputSettings""" 12 | 13 | self.__name = None 14 | self.__key_modified = dict() 15 | 16 | def get_name(self): 17 | """ 18 | The method to get the name 19 | 20 | Returns: 21 | string: A string representing the name 22 | """ 23 | 24 | return self.__name 25 | 26 | def set_name(self, name): 27 | """ 28 | The method to set the value to name 29 | 30 | Parameters: 31 | name (string) : A string representing the name 32 | """ 33 | 34 | if name is not None and not isinstance(name, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None) 36 | 37 | self.__name = name 38 | self.__key_modified['name'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_download_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetDownloadParameters(object): 10 | def __init__(self): 11 | """Creates an instance of SheetDownloadParameters""" 12 | 13 | self.__format = None 14 | self.__key_modified = dict() 15 | 16 | def get_format(self): 17 | """ 18 | The method to get the format 19 | 20 | Returns: 21 | string: A string representing the format 22 | """ 23 | 24 | return self.__format 25 | 26 | def set_format(self, format): 27 | """ 28 | The method to set the value to format 29 | 30 | Parameters: 31 | format (string) : A string representing the format 32 | """ 33 | 34 | if format is not None and not isinstance(format, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) 36 | 37 | self.__format = format 38 | self.__key_modified['format'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/fillable_link_output_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class FillableLinkOutputSettings(object): 10 | def __init__(self): 11 | """Creates an instance of FillableLinkOutputSettings""" 12 | 13 | self.__format = None 14 | self.__key_modified = dict() 15 | 16 | def get_format(self): 17 | """ 18 | The method to get the format 19 | 20 | Returns: 21 | string: A string representing the format 22 | """ 23 | 24 | return self.__format 25 | 26 | def set_format(self, format): 27 | """ 28 | The method to set the value to format 29 | 30 | Parameters: 31 | format (string) : A string representing the format 32 | """ 33 | 34 | if format is not None and not isinstance(format, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) 36 | 37 | self.__format = format 38 | self.__key_modified['format'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/zoho_show_editor_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class ZohoShowEditorSettings(object): 10 | def __init__(self): 11 | """Creates an instance of ZohoShowEditorSettings""" 12 | 13 | self.__language = None 14 | self.__key_modified = dict() 15 | 16 | def get_language(self): 17 | """ 18 | The method to get the language 19 | 20 | Returns: 21 | string: A string representing the language 22 | """ 23 | 24 | return self.__language 25 | 26 | def set_language(self, language): 27 | """ 28 | The method to set the value to language 29 | 30 | Parameters: 31 | language (string) : A string representing the language 32 | """ 33 | 34 | if language is not None and not isinstance(language, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) 36 | 37 | self.__language = language 38 | self.__key_modified['language'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_ui_options.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetUiOptions(object): 10 | def __init__(self): 11 | """Creates an instance of SheetUiOptions""" 12 | 13 | self.__save_button = None 14 | self.__key_modified = dict() 15 | 16 | def get_save_button(self): 17 | """ 18 | The method to get the save_button 19 | 20 | Returns: 21 | string: A string representing the save_button 22 | """ 23 | 24 | return self.__save_button 25 | 26 | def set_save_button(self, save_button): 27 | """ 28 | The method to set the value to save_button 29 | 30 | Parameters: 31 | save_button (string) : A string representing the save_button 32 | """ 33 | 34 | if save_button is not None and not isinstance(save_button, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_button EXPECTED TYPE: str', None, None) 36 | 37 | self.__save_button = save_button 38 | self.__key_modified['save_button'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_user_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetUserSettings(object): 10 | def __init__(self): 11 | """Creates an instance of SheetUserSettings""" 12 | 13 | self.__display_name = None 14 | self.__key_modified = dict() 15 | 16 | def get_display_name(self): 17 | """ 18 | The method to get the display_name 19 | 20 | Returns: 21 | string: A string representing the display_name 22 | """ 23 | 24 | return self.__display_name 25 | 26 | def set_display_name(self, display_name): 27 | """ 28 | The method to set the value to display_name 29 | 30 | Parameters: 31 | display_name (string) : A string representing the display_name 32 | """ 33 | 34 | if display_name is not None and not isinstance(display_name, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_name EXPECTED TYPE: str', None, None) 36 | 37 | self.__display_name = display_name 38 | self.__key_modified['display_name'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/preview_document_info.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class PreviewDocumentInfo(object): 10 | def __init__(self): 11 | """Creates an instance of PreviewDocumentInfo""" 12 | 13 | self.__document_name = None 14 | self.__key_modified = dict() 15 | 16 | def get_document_name(self): 17 | """ 18 | The method to get the document_name 19 | 20 | Returns: 21 | string: A string representing the document_name 22 | """ 23 | 24 | return self.__document_name 25 | 26 | def set_document_name(self, document_name): 27 | """ 28 | The method to set the value to document_name 29 | 30 | Parameters: 31 | document_name (string) : A string representing the document_name 32 | """ 33 | 34 | if document_name is not None and not isinstance(document_name, str): 35 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) 36 | 37 | self.__document_name = document_name 38 | self.__key_modified['document_name'] = 1 39 | 40 | def is_key_modified(self, key): 41 | """ 42 | The method to check if the user has modified the given key 43 | 44 | Parameters: 45 | key (string) : A string representing the key 46 | 47 | Returns: 48 | int: An int representing the modification 49 | """ 50 | 51 | if key is not None and not isinstance(key, str): 52 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 53 | 54 | if key in self.__key_modified: 55 | return self.__key_modified.get(key) 56 | 57 | return None 58 | 59 | def set_key_modified(self, key, modification): 60 | """ 61 | The method to mark the given key as modified 62 | 63 | Parameters: 64 | key (string) : A string representing the key 65 | modification (int) : An int representing the modification 66 | """ 67 | 68 | if key is not None and not isinstance(key, str): 69 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 70 | 71 | if modification is not None and not isinstance(modification, int): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 73 | 74 | self.__key_modified[key] = modification 75 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/merge_fields_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class MergeFieldsResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of MergeFieldsResponse""" 14 | super().__init__() 15 | 16 | self.__merge = None 17 | self.__key_modified = dict() 18 | 19 | def get_merge(self): 20 | """ 21 | The method to get the merge 22 | 23 | Returns: 24 | list: An instance of list 25 | """ 26 | 27 | return self.__merge 28 | 29 | def set_merge(self, merge): 30 | """ 31 | The method to set the value to merge 32 | 33 | Parameters: 34 | merge (list) : An instance of list 35 | """ 36 | 37 | if merge is not None and not isinstance(merge, list): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge EXPECTED TYPE: list', None, None) 39 | 40 | self.__merge = merge 41 | self.__key_modified['merge'] = 1 42 | 43 | def is_key_modified(self, key): 44 | """ 45 | The method to check if the user has modified the given key 46 | 47 | Parameters: 48 | key (string) : A string representing the key 49 | 50 | Returns: 51 | int: An int representing the modification 52 | """ 53 | 54 | if key is not None and not isinstance(key, str): 55 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 56 | 57 | if key in self.__key_modified: 58 | return self.__key_modified.get(key) 59 | 60 | return None 61 | 62 | def set_key_modified(self, key, modification): 63 | """ 64 | The method to mark the given key as modified 65 | 66 | Parameters: 67 | key (string) : A string representing the key 68 | modification (int) : An int representing the modification 69 | """ 70 | 71 | if key is not None and not isinstance(key, str): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 73 | 74 | if modification is not None and not isinstance(modification, int): 75 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 76 | 77 | self.__key_modified[key] = modification 78 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/request_proxy.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | 5 | except Exception: 6 | from .exception import SDKException 7 | from .util import Constants 8 | 9 | 10 | class RequestProxy(object): 11 | def __init__(self, host, port, user_domain, user=None, password=""): 12 | 13 | """ 14 | Creates a RequestProxy class instance with the specified parameters. 15 | 16 | Parameters: 17 | host(str): A String containing the hostname or address of the proxy server 18 | port(int): An Integer containing The port number of the proxy server 19 | user_domain(str) A String containing the domain of the proxy server 20 | user(str): A String containing the user name of the proxy server 21 | password(str) : A String containing the password of the proxy server. Default value is an empty string 22 | 23 | Raises: 24 | SDKException 25 | """ 26 | 27 | if host is None: 28 | raise SDKException(Constants.USER_PROXY_ERROR, Constants.HOST_ERROR_MESSAGE) 29 | 30 | if port is None: 31 | raise SDKException(Constants.USER_PROXY_ERROR, Constants.PORT_ERROR_MESSAGE) 32 | 33 | self.__host = host 34 | self.__port = port 35 | self.__user_domain = user_domain 36 | self.__user = user 37 | self.__password = password 38 | 39 | def get_host(self): 40 | """ 41 | This is a getter method to get __host. 42 | 43 | Returns: 44 | string: A string representing __host 45 | """ 46 | 47 | def get_port(self): 48 | """ 49 | This is a getter method to get __port. 50 | 51 | Returns: 52 | string: A string representing __port 53 | """ 54 | 55 | def get_user(self): 56 | """ 57 | This is a getter method to get __user. 58 | 59 | Returns: 60 | string: A string representing __user 61 | """ 62 | 63 | def get_password(self): 64 | """ 65 | This is a getter method to get __password. 66 | 67 | Returns: 68 | string: A string representing __password 69 | """ 70 | 71 | def get_user_domain(self): 72 | """ 73 | This is a getter method to get __user_domain 74 | 75 | Returns: 76 | string: A string representing __user_domain 77 | """ 78 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/parameter_map.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.param import Param 3 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 4 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 5 | from officeintegrator.src.com.zoho.officeintegrator.util.datatype_converter import DataTypeConverter 6 | 7 | except Exception: 8 | from .param import Param 9 | from .exception import SDKException 10 | from .util import Constants 11 | from .util import DataTypeConverter 12 | 13 | 14 | class ParameterMap(object): 15 | """ 16 | This class represents the HTTP parameter name and value. 17 | """ 18 | 19 | def __init__(self): 20 | """Creates an instance of ParameterMap Class""" 21 | 22 | self.request_parameters = dict() 23 | 24 | def add(self, param, value): 25 | 26 | """ 27 | The method to add parameter name and value. 28 | 29 | Parameters: 30 | param (Param): A Param class instance. 31 | value (object): An object containing the parameter value. 32 | """ 33 | 34 | try: 35 | from officeintegrator.src.com.zoho.officeintegrator.util.header_param_validator import HeaderParamValidator 36 | except Exception: 37 | from .util import HeaderParamValidator 38 | 39 | if param is None: 40 | raise SDKException(Constants.PARAMETER_NONE_ERROR, Constants.PARAM_INSTANCE_NONE_ERROR) 41 | 42 | param_name = param.name 43 | 44 | if param_name is None: 45 | raise SDKException(Constants.PARAM_NAME_NONE_ERROR, Constants.PARAM_NAME_NONE_ERROR_MESSAGE) 46 | 47 | if value is None: 48 | raise SDKException(Constants.PARAMETER_NONE_ERROR, param_name + Constants.NONE_VALUE_ERROR_MESSAGE) 49 | 50 | param_class_name = param.class_name 51 | 52 | if param_class_name is not None: 53 | value = HeaderParamValidator().validate(param_name, param_class_name, value) 54 | else: 55 | try: 56 | value = DataTypeConverter.post_convert(value, type(value)) 57 | except Exception as e: 58 | value = str(value) 59 | 60 | if param_name not in self.request_parameters: 61 | self.request_parameters[param_name] = str(value) 62 | 63 | else: 64 | parameter_value = self.request_parameters[param_name] 65 | self.request_parameters[param_name] = parameter_value + ',' + str(value) 66 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/header_map.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.header import Header 3 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 4 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 5 | from officeintegrator.src.com.zoho.officeintegrator.util.datatype_converter import DataTypeConverter 6 | 7 | except Exception: 8 | from .header import Header 9 | from .exception.sdk_exception import SDKException 10 | from .util.constants import Constants 11 | from .util.datatype_converter import DataTypeConverter 12 | 13 | class HeaderMap(object): 14 | 15 | """ 16 | This class represents the HTTP header name and value. 17 | """ 18 | 19 | def __init__(self): 20 | """Creates an instance of HeaderMap Class""" 21 | 22 | self.request_headers = dict() 23 | 24 | def add(self, header, value): 25 | 26 | """ 27 | The method to add the parameter name and value. 28 | 29 | Parameters: 30 | header (Header): A Header class instance. 31 | value (object): An object containing the header value. 32 | """ 33 | 34 | try: 35 | from officeintegrator.src.com.zoho.officeintegrator.util.header_param_validator import HeaderParamValidator 36 | except Exception: 37 | from .util import HeaderParamValidator 38 | 39 | if header is None: 40 | raise SDKException(Constants.HEADER_NONE_ERROR, Constants.HEADER_INSTANCE_NONE_ERROR) 41 | 42 | header_name = header.name 43 | 44 | if header_name is None: 45 | raise SDKException(Constants.HEADER_NAME_NONE_ERROR, Constants.HEADER_NAME_NULL_ERROR_MESSAGE) 46 | 47 | if value is None: 48 | raise SDKException(Constants.HEADER_NONE_ERROR, header_name + Constants.NONE_VALUE_ERROR_MESSAGE) 49 | 50 | header_class_name = header.class_name 51 | 52 | if header_class_name is not None: 53 | value = HeaderParamValidator().validate(header_name, header_class_name, value) 54 | else: 55 | try: 56 | value = DataTypeConverter.post_convert(value, type(value)) 57 | except Exception as e: 58 | value = str(value) 59 | 60 | if header_name not in self.request_headers: 61 | self.request_headers[header_name] = str(value) 62 | 63 | else: 64 | header_value = self.request_headers[header_name] 65 | self.request_headers[header_name] = header_value + ',' + str(value) 66 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/fillable_link_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class FillableLinkResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of FillableLinkResponse""" 14 | super().__init__() 15 | 16 | self.__fillable_form_url = None 17 | self.__key_modified = dict() 18 | 19 | def get_fillable_form_url(self): 20 | """ 21 | The method to get the fillable_form_url 22 | 23 | Returns: 24 | string: A string representing the fillable_form_url 25 | """ 26 | 27 | return self.__fillable_form_url 28 | 29 | def set_fillable_form_url(self, fillable_form_url): 30 | """ 31 | The method to set the value to fillable_form_url 32 | 33 | Parameters: 34 | fillable_form_url (string) : A string representing the fillable_form_url 35 | """ 36 | 37 | if fillable_form_url is not None and not isinstance(fillable_form_url, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: fillable_form_url EXPECTED TYPE: str', None, None) 39 | 40 | self.__fillable_form_url = fillable_form_url 41 | self.__key_modified['fillable_form_url'] = 1 42 | 43 | def is_key_modified(self, key): 44 | """ 45 | The method to check if the user has modified the given key 46 | 47 | Parameters: 48 | key (string) : A string representing the key 49 | 50 | Returns: 51 | int: An int representing the modification 52 | """ 53 | 54 | if key is not None and not isinstance(key, str): 55 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 56 | 57 | if key in self.__key_modified: 58 | return self.__key_modified.get(key) 59 | 60 | return None 61 | 62 | def set_key_modified(self, key, modification): 63 | """ 64 | The method to mark the given key as modified 65 | 66 | Parameters: 67 | key (string) : A string representing the key 68 | modification (int) : An int representing the modification 69 | """ 70 | 71 | if key is not None and not isinstance(key, str): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 73 | 74 | if modification is not None and not isinstance(modification, int): 75 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 76 | 77 | self.__key_modified[key] = modification 78 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/document_delete_success_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class DocumentDeleteSuccessResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of DocumentDeleteSuccessResponse""" 14 | super().__init__() 15 | 16 | self.__document_deleted = None 17 | self.__key_modified = dict() 18 | 19 | def get_document_deleted(self): 20 | """ 21 | The method to get the document_deleted 22 | 23 | Returns: 24 | bool: A bool representing the document_deleted 25 | """ 26 | 27 | return self.__document_deleted 28 | 29 | def set_document_deleted(self, document_deleted): 30 | """ 31 | The method to set the value to document_deleted 32 | 33 | Parameters: 34 | document_deleted (bool) : A bool representing the document_deleted 35 | """ 36 | 37 | if document_deleted is not None and not isinstance(document_deleted, bool): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_deleted EXPECTED TYPE: bool', None, None) 39 | 40 | self.__document_deleted = document_deleted 41 | self.__key_modified['document_deleted'] = 1 42 | 43 | def is_key_modified(self, key): 44 | """ 45 | The method to check if the user has modified the given key 46 | 47 | Parameters: 48 | key (string) : A string representing the key 49 | 50 | Returns: 51 | int: An int representing the modification 52 | """ 53 | 54 | if key is not None and not isinstance(key, str): 55 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 56 | 57 | if key in self.__key_modified: 58 | return self.__key_modified.get(key) 59 | 60 | return None 61 | 62 | def set_key_modified(self, key, modification): 63 | """ 64 | The method to mark the given key as modified 65 | 66 | Parameters: 67 | key (string) : A string representing the key 68 | modification (int) : An int representing the modification 69 | """ 70 | 71 | if key is not None and not isinstance(key, str): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 73 | 74 | if modification is not None and not isinstance(modification, int): 75 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 76 | 77 | self.__key_modified[key] = modification 78 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/document_session_delete_success_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class DocumentSessionDeleteSuccessResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of DocumentSessionDeleteSuccessResponse""" 14 | super().__init__() 15 | 16 | self.__session_deleted = None 17 | self.__key_modified = dict() 18 | 19 | def get_session_deleted(self): 20 | """ 21 | The method to get the session_deleted 22 | 23 | Returns: 24 | bool: A bool representing the session_deleted 25 | """ 26 | 27 | return self.__session_deleted 28 | 29 | def set_session_deleted(self, session_deleted): 30 | """ 31 | The method to set the value to session_deleted 32 | 33 | Parameters: 34 | session_deleted (bool) : A bool representing the session_deleted 35 | """ 36 | 37 | if session_deleted is not None and not isinstance(session_deleted, bool): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_deleted EXPECTED TYPE: bool', None, None) 39 | 40 | self.__session_deleted = session_deleted 41 | self.__key_modified['session_deleted'] = 1 42 | 43 | def is_key_modified(self, key): 44 | """ 45 | The method to check if the user has modified the given key 46 | 47 | Parameters: 48 | key (string) : A string representing the key 49 | 50 | Returns: 51 | int: An int representing the modification 52 | """ 53 | 54 | if key is not None and not isinstance(key, str): 55 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 56 | 57 | if key in self.__key_modified: 58 | return self.__key_modified.get(key) 59 | 60 | return None 61 | 62 | def set_key_modified(self, key, modification): 63 | """ 64 | The method to mark the given key as modified 65 | 66 | Parameters: 67 | key (string) : A string representing the key 68 | modification (int) : An int representing the modification 69 | """ 70 | 71 | if key is not None and not isinstance(key, str): 72 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 73 | 74 | if modification is not None and not isinstance(modification, int): 75 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 76 | 77 | self.__key_modified[key] = modification 78 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/file_delete_success_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler 5 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 6 | except Exception: 7 | from ..exception import SDKException 8 | from ..util import Constants 9 | from .show_response_handler import ShowResponseHandler 10 | from .sheet_response_handler import SheetResponseHandler 11 | 12 | 13 | class FileDeleteSuccessResponse(SheetResponseHandler, ShowResponseHandler): 14 | def __init__(self): 15 | """Creates an instance of FileDeleteSuccessResponse""" 16 | super().__init__() 17 | 18 | self.__doc_delete = None 19 | self.__key_modified = dict() 20 | 21 | def get_doc_delete(self): 22 | """ 23 | The method to get the doc_delete 24 | 25 | Returns: 26 | string: A string representing the doc_delete 27 | """ 28 | 29 | return self.__doc_delete 30 | 31 | def set_doc_delete(self, doc_delete): 32 | """ 33 | The method to set the value to doc_delete 34 | 35 | Parameters: 36 | doc_delete (string) : A string representing the doc_delete 37 | """ 38 | 39 | if doc_delete is not None and not isinstance(doc_delete, str): 40 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: doc_delete EXPECTED TYPE: str', None, None) 41 | 42 | self.__doc_delete = doc_delete 43 | self.__key_modified['doc_delete'] = 1 44 | 45 | def is_key_modified(self, key): 46 | """ 47 | The method to check if the user has modified the given key 48 | 49 | Parameters: 50 | key (string) : A string representing the key 51 | 52 | Returns: 53 | int: An int representing the modification 54 | """ 55 | 56 | if key is not None and not isinstance(key, str): 57 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 58 | 59 | if key in self.__key_modified: 60 | return self.__key_modified.get(key) 61 | 62 | return None 63 | 64 | def set_key_modified(self, key, modification): 65 | """ 66 | The method to mark the given key as modified 67 | 68 | Parameters: 69 | key (string) : A string representing the key 70 | modification (int) : An int representing the modification 71 | """ 72 | 73 | if key is not None and not isinstance(key, str): 74 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 75 | 76 | if modification is not None and not isinstance(modification, int): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 78 | 79 | self.__key_modified[key] = modification 80 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/session_delete_success_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler 5 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 6 | except Exception: 7 | from ..exception import SDKException 8 | from ..util import Constants 9 | from .show_response_handler import ShowResponseHandler 10 | from .sheet_response_handler import SheetResponseHandler 11 | 12 | 13 | class SessionDeleteSuccessResponse(SheetResponseHandler, ShowResponseHandler): 14 | def __init__(self): 15 | """Creates an instance of SessionDeleteSuccessResponse""" 16 | super().__init__() 17 | 18 | self.__session_delete = None 19 | self.__key_modified = dict() 20 | 21 | def get_session_delete(self): 22 | """ 23 | The method to get the session_delete 24 | 25 | Returns: 26 | string: A string representing the session_delete 27 | """ 28 | 29 | return self.__session_delete 30 | 31 | def set_session_delete(self, session_delete): 32 | """ 33 | The method to set the value to session_delete 34 | 35 | Parameters: 36 | session_delete (string) : A string representing the session_delete 37 | """ 38 | 39 | if session_delete is not None and not isinstance(session_delete, str): 40 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete EXPECTED TYPE: str', None, None) 41 | 42 | self.__session_delete = session_delete 43 | self.__key_modified['session_delete'] = 1 44 | 45 | def is_key_modified(self, key): 46 | """ 47 | The method to check if the user has modified the given key 48 | 49 | Parameters: 50 | key (string) : A string representing the key 51 | 52 | Returns: 53 | int: An int representing the modification 54 | """ 55 | 56 | if key is not None and not isinstance(key, str): 57 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 58 | 59 | if key in self.__key_modified: 60 | return self.__key_modified.get(key) 61 | 62 | return None 63 | 64 | def set_key_modified(self, key, modification): 65 | """ 66 | The method to mark the given key as modified 67 | 68 | Parameters: 69 | key (string) : A string representing the key 70 | modification (int) : An int representing the modification 71 | """ 72 | 73 | if key is not None and not isinstance(key, str): 74 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 75 | 76 | if modification is not None and not isinstance(modification, int): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 78 | 79 | self.__key_modified[key] = modification 80 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/file_body_wrapper.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler 5 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 6 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 7 | except Exception: 8 | from ..exception import SDKException 9 | from ..util import StreamWrapper, Constants 10 | from .show_response_handler import ShowResponseHandler 11 | from .sheet_response_handler import SheetResponseHandler 12 | from .writer_response_handler import WriterResponseHandler 13 | 14 | 15 | class FileBodyWrapper(WriterResponseHandler, SheetResponseHandler, ShowResponseHandler): 16 | def __init__(self): 17 | """Creates an instance of FileBodyWrapper""" 18 | super().__init__() 19 | 20 | self.__file = None 21 | self.__key_modified = dict() 22 | 23 | def get_file(self): 24 | """ 25 | The method to get the file 26 | 27 | Returns: 28 | StreamWrapper: An instance of StreamWrapper 29 | """ 30 | 31 | return self.__file 32 | 33 | def set_file(self, file): 34 | """ 35 | The method to set the value to file 36 | 37 | Parameters: 38 | file (StreamWrapper) : An instance of StreamWrapper 39 | """ 40 | 41 | if file is not None and not isinstance(file, StreamWrapper): 42 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file EXPECTED TYPE: StreamWrapper', None, None) 43 | 44 | self.__file = file 45 | self.__key_modified['file'] = 1 46 | 47 | def is_key_modified(self, key): 48 | """ 49 | The method to check if the user has modified the given key 50 | 51 | Parameters: 52 | key (string) : A string representing the key 53 | 54 | Returns: 55 | int: An int representing the modification 56 | """ 57 | 58 | if key is not None and not isinstance(key, str): 59 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 60 | 61 | if key in self.__key_modified: 62 | return self.__key_modified.get(key) 63 | 64 | return None 65 | 66 | def set_key_modified(self, key, modification): 67 | """ 68 | The method to mark the given key as modified 69 | 70 | Parameters: 71 | key (string) : A string representing the key 72 | modification (int) : An int representing the modification 73 | """ 74 | 75 | if key is not None and not isinstance(key, str): 76 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 77 | 78 | if modification is not None and not isinstance(modification, int): 79 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 80 | 81 | self.__key_modified[key] = modification 82 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_editor_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetEditorSettings(object): 10 | def __init__(self): 11 | """Creates an instance of SheetEditorSettings""" 12 | 13 | self.__country = None 14 | self.__language = None 15 | self.__key_modified = dict() 16 | 17 | def get_country(self): 18 | """ 19 | The method to get the country 20 | 21 | Returns: 22 | string: A string representing the country 23 | """ 24 | 25 | return self.__country 26 | 27 | def set_country(self, country): 28 | """ 29 | The method to set the value to country 30 | 31 | Parameters: 32 | country (string) : A string representing the country 33 | """ 34 | 35 | if country is not None and not isinstance(country, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: country EXPECTED TYPE: str', None, None) 37 | 38 | self.__country = country 39 | self.__key_modified['country'] = 1 40 | 41 | def get_language(self): 42 | """ 43 | The method to get the language 44 | 45 | Returns: 46 | string: A string representing the language 47 | """ 48 | 49 | return self.__language 50 | 51 | def set_language(self, language): 52 | """ 53 | The method to set the value to language 54 | 55 | Parameters: 56 | language (string) : A string representing the language 57 | """ 58 | 59 | if language is not None and not isinstance(language, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) 61 | 62 | self.__language = language 63 | self.__key_modified['language'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/user_info.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class UserInfo(object): 10 | def __init__(self): 11 | """Creates an instance of UserInfo""" 12 | 13 | self.__user_id = None 14 | self.__display_name = None 15 | self.__key_modified = dict() 16 | 17 | def get_user_id(self): 18 | """ 19 | The method to get the user_id 20 | 21 | Returns: 22 | string: A string representing the user_id 23 | """ 24 | 25 | return self.__user_id 26 | 27 | def set_user_id(self, user_id): 28 | """ 29 | The method to set the value to user_id 30 | 31 | Parameters: 32 | user_id (string) : A string representing the user_id 33 | """ 34 | 35 | if user_id is not None and not isinstance(user_id, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: user_id EXPECTED TYPE: str', None, None) 37 | 38 | self.__user_id = user_id 39 | self.__key_modified['user_id'] = 1 40 | 41 | def get_display_name(self): 42 | """ 43 | The method to get the display_name 44 | 45 | Returns: 46 | string: A string representing the display_name 47 | """ 48 | 49 | return self.__display_name 50 | 51 | def set_display_name(self, display_name): 52 | """ 53 | The method to set the value to display_name 54 | 55 | Parameters: 56 | display_name (string) : A string representing the display_name 57 | """ 58 | 59 | if display_name is not None and not isinstance(display_name, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_name EXPECTED TYPE: str', None, None) 61 | 62 | self.__display_name = display_name 63 | self.__key_modified['display_name'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/session_user_info.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SessionUserInfo(object): 10 | def __init__(self): 11 | """Creates an instance of SessionUserInfo""" 12 | 13 | self.__display_name = None 14 | self.__user_id = None 15 | self.__key_modified = dict() 16 | 17 | def get_display_name(self): 18 | """ 19 | The method to get the display_name 20 | 21 | Returns: 22 | string: A string representing the display_name 23 | """ 24 | 25 | return self.__display_name 26 | 27 | def set_display_name(self, display_name): 28 | """ 29 | The method to set the value to display_name 30 | 31 | Parameters: 32 | display_name (string) : A string representing the display_name 33 | """ 34 | 35 | if display_name is not None and not isinstance(display_name, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_name EXPECTED TYPE: str', None, None) 37 | 38 | self.__display_name = display_name 39 | self.__key_modified['display_name'] = 1 40 | 41 | def get_user_id(self): 42 | """ 43 | The method to get the user_id 44 | 45 | Returns: 46 | string: A string representing the user_id 47 | """ 48 | 49 | return self.__user_id 50 | 51 | def set_user_id(self, user_id): 52 | """ 53 | The method to set the value to user_id 54 | 55 | Parameters: 56 | user_id (string) : A string representing the user_id 57 | """ 58 | 59 | if user_id is not None and not isinstance(user_id, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: user_id EXPECTED TYPE: str', None, None) 61 | 62 | self.__user_id = user_id 63 | self.__key_modified['user_id'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_conversion_output_options.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetConversionOutputOptions(object): 10 | def __init__(self): 11 | """Creates an instance of SheetConversionOutputOptions""" 12 | 13 | self.__format = None 14 | self.__document_name = None 15 | self.__key_modified = dict() 16 | 17 | def get_format(self): 18 | """ 19 | The method to get the format 20 | 21 | Returns: 22 | string: A string representing the format 23 | """ 24 | 25 | return self.__format 26 | 27 | def set_format(self, format): 28 | """ 29 | The method to set the value to format 30 | 31 | Parameters: 32 | format (string) : A string representing the format 33 | """ 34 | 35 | if format is not None and not isinstance(format, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) 37 | 38 | self.__format = format 39 | self.__key_modified['format'] = 1 40 | 41 | def get_document_name(self): 42 | """ 43 | The method to get the document_name 44 | 45 | Returns: 46 | string: A string representing the document_name 47 | """ 48 | 49 | return self.__document_name 50 | 51 | def set_document_name(self, document_name): 52 | """ 53 | The method to set the value to document_name 54 | 55 | Parameters: 56 | document_name (string) : A string representing the document_name 57 | """ 58 | 59 | if document_name is not None and not isinstance(document_name, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) 61 | 62 | self.__document_name = document_name 63 | self.__key_modified['document_name'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/document_info.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class DocumentInfo(object): 10 | def __init__(self): 11 | """Creates an instance of DocumentInfo""" 12 | 13 | self.__document_name = None 14 | self.__document_id = None 15 | self.__key_modified = dict() 16 | 17 | def get_document_name(self): 18 | """ 19 | The method to get the document_name 20 | 21 | Returns: 22 | string: A string representing the document_name 23 | """ 24 | 25 | return self.__document_name 26 | 27 | def set_document_name(self, document_name): 28 | """ 29 | The method to set the value to document_name 30 | 31 | Parameters: 32 | document_name (string) : A string representing the document_name 33 | """ 34 | 35 | if document_name is not None and not isinstance(document_name, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) 37 | 38 | self.__document_name = document_name 39 | self.__key_modified['document_name'] = 1 40 | 41 | def get_document_id(self): 42 | """ 43 | The method to get the document_id 44 | 45 | Returns: 46 | string: A string representing the document_id 47 | """ 48 | 49 | return self.__document_id 50 | 51 | def set_document_id(self, document_id): 52 | """ 53 | The method to set the value to document_id 54 | 55 | Parameters: 56 | document_id (string) : A string representing the document_id 57 | """ 58 | 59 | if document_id is not None and not isinstance(document_id, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_id EXPECTED TYPE: str', None, None) 61 | 62 | self.__document_id = document_id 63 | self.__key_modified['document_id'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/get_merge_fields_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class GetMergeFieldsParameters(object): 10 | def __init__(self): 11 | """Creates an instance of GetMergeFieldsParameters""" 12 | 13 | self.__file_content = None 14 | self.__file_url = None 15 | self.__key_modified = dict() 16 | 17 | def get_file_content(self): 18 | """ 19 | The method to get the file_content 20 | 21 | Returns: 22 | StreamWrapper: An instance of StreamWrapper 23 | """ 24 | 25 | return self.__file_content 26 | 27 | def set_file_content(self, file_content): 28 | """ 29 | The method to set the value to file_content 30 | 31 | Parameters: 32 | file_content (StreamWrapper) : An instance of StreamWrapper 33 | """ 34 | 35 | if file_content is not None and not isinstance(file_content, StreamWrapper): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_content EXPECTED TYPE: StreamWrapper', None, None) 37 | 38 | self.__file_content = file_content 39 | self.__key_modified['file_content'] = 1 40 | 41 | def get_file_url(self): 42 | """ 43 | The method to get the file_url 44 | 45 | Returns: 46 | string: A string representing the file_url 47 | """ 48 | 49 | return self.__file_url 50 | 51 | def set_file_url(self, file_url): 52 | """ 53 | The method to set the value to file_url 54 | 55 | Parameters: 56 | file_url (string) : A string representing the file_url 57 | """ 58 | 59 | if file_url is not None and not isinstance(file_url, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_url EXPECTED TYPE: str', None, None) 61 | 62 | self.__file_url = file_url 63 | self.__key_modified['file_url'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/mail_merge_webhook_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class MailMergeWebhookSettings(object): 10 | def __init__(self): 11 | """Creates an instance of MailMergeWebhookSettings""" 12 | 13 | self.__invoke_url = None 14 | self.__invoke_period = None 15 | self.__key_modified = dict() 16 | 17 | def get_invoke_url(self): 18 | """ 19 | The method to get the invoke_url 20 | 21 | Returns: 22 | string: A string representing the invoke_url 23 | """ 24 | 25 | return self.__invoke_url 26 | 27 | def set_invoke_url(self, invoke_url): 28 | """ 29 | The method to set the value to invoke_url 30 | 31 | Parameters: 32 | invoke_url (string) : A string representing the invoke_url 33 | """ 34 | 35 | if invoke_url is not None and not isinstance(invoke_url, str): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: invoke_url EXPECTED TYPE: str', None, None) 37 | 38 | self.__invoke_url = invoke_url 39 | self.__key_modified['invoke_url'] = 1 40 | 41 | def get_invoke_period(self): 42 | """ 43 | The method to get the invoke_period 44 | 45 | Returns: 46 | string: A string representing the invoke_period 47 | """ 48 | 49 | return self.__invoke_period 50 | 51 | def set_invoke_period(self, invoke_period): 52 | """ 53 | The method to set the value to invoke_period 54 | 55 | Parameters: 56 | invoke_period (string) : A string representing the invoke_period 57 | """ 58 | 59 | if invoke_period is not None and not isinstance(invoke_period, str): 60 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: invoke_period EXPECTED TYPE: str', None, None) 61 | 62 | self.__invoke_period = invoke_period 63 | self.__key_modified['invoke_period'] = 1 64 | 65 | def is_key_modified(self, key): 66 | """ 67 | The method to check if the user has modified the given key 68 | 69 | Parameters: 70 | key (string) : A string representing the key 71 | 72 | Returns: 73 | int: An int representing the modification 74 | """ 75 | 76 | if key is not None and not isinstance(key, str): 77 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 78 | 79 | if key in self.__key_modified: 80 | return self.__key_modified.get(key) 81 | 82 | return None 83 | 84 | def set_key_modified(self, key, modification): 85 | """ 86 | The method to mark the given key as modified 87 | 88 | Parameters: 89 | key (string) : A string representing the key 90 | modification (int) : An int representing the modification 91 | """ 92 | 93 | if key is not None and not isinstance(key, str): 94 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 95 | 96 | if modification is not None and not isinstance(modification, int): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 98 | 99 | self.__key_modified[key] = modification 100 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/logger/logger.py: -------------------------------------------------------------------------------- 1 | try: 2 | import logging 3 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 4 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 5 | 6 | except Exception as e: 7 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 8 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 9 | 10 | 11 | class Logger(object): 12 | 13 | """ 14 | This class represents the Logger level and the file path. 15 | """ 16 | 17 | def __init__(self, level, file_path=None): 18 | self.__level = level 19 | self.__file_path = file_path 20 | 21 | def get_level(self): 22 | """ 23 | This is a getter method to get __level. 24 | 25 | Returns: 26 | string: A enum representing __level 27 | """ 28 | 29 | return self.__level 30 | 31 | def get_file_path(self): 32 | """ 33 | This is a getter method to get __file_path. 34 | 35 | Returns: 36 | string: A string representing __file_path 37 | """ 38 | 39 | return self.__file_path 40 | 41 | @staticmethod 42 | def get_instance(level, file_path=None): 43 | 44 | """ 45 | Creates an Logger class instance with the specified log level and file path. 46 | :param level: A Levels class instance containing the log level. 47 | :param file_path: A str containing the log file path. 48 | :return: A Logger class instance. 49 | """ 50 | 51 | return Logger(level=level, file_path=file_path) 52 | 53 | import enum 54 | 55 | class Levels(enum.Enum): 56 | 57 | """ 58 | This class represents the possible logger levels 59 | """ 60 | 61 | CRITICAL = logging.CRITICAL 62 | ERROR = logging.ERROR 63 | WARNING = logging.WARNING 64 | INFO = logging.INFO 65 | DEBUG = logging.DEBUG 66 | NOTSET = logging.NOTSET 67 | 68 | 69 | class SDKLogger(object): 70 | 71 | """ 72 | The class to initialize the SDK logger. 73 | """ 74 | 75 | def __init__(self, logger_instance): 76 | 77 | logger = logging.getLogger('SDKLogger') 78 | logger_level = logger_instance.get_level() 79 | logger_file_path = logger_instance.get_file_path() 80 | if logger_level is not None and logger_level != logging.NOTSET and logger_file_path is not None and logger_file_path != "": 81 | file_handler = logging.FileHandler(logger_file_path) 82 | formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(module)s - %(filename)s - %(funcName)s - %(lineno)d - %(message)s') 83 | file_handler.setLevel(logger_level.name) 84 | file_handler.setFormatter(formatter) 85 | logger.addHandler(file_handler) 86 | if logger_level is not None and Constants.LOGGER_LEVELS.__contains__(logger_level.name): 87 | logger.setLevel(logger_level.name) 88 | 89 | @staticmethod 90 | def initialize(logger_instance): 91 | try: 92 | SDKLogger(logger_instance=logger_instance) 93 | except Exception as ex: 94 | raise SDKException(code=Constants.LOGGER_INITIALIZATION_ERROR, cause=ex) 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | # Python SDK 6 | ![PyPI](https://img.shields.io/pypi/v/office-integrator-sdk) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/office-integrator-sdk) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/office-integrator-sdk) ![PyPI - License](https://img.shields.io/pypi/l/office-integrator-sdk) 7 | * [Getting Started](#Getting-Started) 8 | * [Prerequisites](#prerequisites) 9 | * [Registering a Zoho Office Integrator APIKey](#registering-a-zoho-office-integrator-apikey) 10 | * [Including the SDK in your project](#including-the-sdk-in-your-project) 11 | * [Sample Code](#sdk-sample-code) 12 | * [Release Notes](#release-notes) 13 | * [License](#license) 14 | 15 | ## Getting Started 16 | 17 | Zoho Office Integrator Pythod SDK used to help you quickly integrator Zoho Office Integrator editors in side your web application. 18 | 19 | * [Python SDK Source code](https://github.com/zoho/office-integrator-python-sdk) 20 | * [API reference documentation](https://www.zoho.com/officeintegrator/api/v1) 21 | * [SDK example code](https://github.com/zoho/office-integrator-python-sdk-examples) 22 | 23 | ## Prerequisites 24 | 25 | - To start working with this SDK you need a an account in office integrator service. [Sign Up](https://officeintegrator.zoho.com) 26 | 27 | - You need to install suitable version of [Python](https://www.python.org/) and [pip](https://pip.pypa.io/en/stable/installation/) 28 | 29 | 30 | ## Registering a Zoho Office Integrator APIKey 31 | 32 | Since Zoho Office Integrator APIs are authenticated with apikey, you should register your with Zoho to get an apikey. To register your app: 33 | 34 | - Follow the steps mentioned in this help [page](https://www.zoho.com/officeintegrator/api/v1/getting-started.html) ( Sign-up for a Zoho Account if you don't have one) 35 | 36 | - Enter your company name and short discription about how you are going to using zoho office integrator with your application in apikey sign-up form. Choose the type of your application(commerial or non-commercial) and generate the apikey. 37 | 38 | - After sign-up completed for Zoho Office Integrator service, copy the apikey from the dashboard. 39 | 40 | ## Including the SDK in your project 41 | 42 | You can include the SDK to your project using: 43 | 44 | - Install **Python SDK** 45 | - Navigate to the workspace of your client app. 46 | - Run the command below: 47 | 48 | ```sh 49 | pip install office-integrator-sdk 50 | ``` 51 | 52 | - Another method to install the SDK 53 | - Add following line in requirements.txt file of your application. 54 | 55 | ```sh 56 | office-integrator-sdk==1.0.0b2 57 | ``` 58 | - Run the follwoing comment install the sdk files 59 | ```sh 60 | pip3 install -r requirements.txt 61 | ``` 62 | 63 | ## SDK Sample code 64 | 65 | Refer this **[repository](https://github.com/zoho/office-integrator-python-sdk-examples)** for example codes to all Office Integrator API endpoints. 66 | 67 | ## Release Notes 68 | 69 | *Version 1.0.b2* 70 | 71 | - Readme file and license details updated 72 | 73 | *Version 1.0.b1* 74 | 75 | - Initial sdk version release 76 | 77 | ## License 78 | 79 | This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt for more information. -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/compare_document_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class CompareDocumentResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of CompareDocumentResponse""" 14 | super().__init__() 15 | 16 | self.__compare_url = None 17 | self.__session_delete_url = None 18 | self.__key_modified = dict() 19 | 20 | def get_compare_url(self): 21 | """ 22 | The method to get the compare_url 23 | 24 | Returns: 25 | string: A string representing the compare_url 26 | """ 27 | 28 | return self.__compare_url 29 | 30 | def set_compare_url(self, compare_url): 31 | """ 32 | The method to set the value to compare_url 33 | 34 | Parameters: 35 | compare_url (string) : A string representing the compare_url 36 | """ 37 | 38 | if compare_url is not None and not isinstance(compare_url, str): 39 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: compare_url EXPECTED TYPE: str', None, None) 40 | 41 | self.__compare_url = compare_url 42 | self.__key_modified['compare_url'] = 1 43 | 44 | def get_session_delete_url(self): 45 | """ 46 | The method to get the session_delete_url 47 | 48 | Returns: 49 | string: A string representing the session_delete_url 50 | """ 51 | 52 | return self.__session_delete_url 53 | 54 | def set_session_delete_url(self, session_delete_url): 55 | """ 56 | The method to set the value to session_delete_url 57 | 58 | Parameters: 59 | session_delete_url (string) : A string representing the session_delete_url 60 | """ 61 | 62 | if session_delete_url is not None and not isinstance(session_delete_url, str): 63 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: session_delete_url EXPECTED TYPE: str', None, None) 64 | 65 | self.__session_delete_url = session_delete_url 66 | self.__key_modified['session_delete_url'] = 1 67 | 68 | def is_key_modified(self, key): 69 | """ 70 | The method to check if the user has modified the given key 71 | 72 | Parameters: 73 | key (string) : A string representing the key 74 | 75 | Returns: 76 | int: An int representing the modification 77 | """ 78 | 79 | if key is not None and not isinstance(key, str): 80 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 81 | 82 | if key in self.__key_modified: 83 | return self.__key_modified.get(key) 84 | 85 | return None 86 | 87 | def set_key_modified(self, key, modification): 88 | """ 89 | The method to mark the given key as modified 90 | 91 | Parameters: 92 | key (string) : A string representing the key 93 | modification (int) : An int representing the modification 94 | """ 95 | 96 | if key is not None and not isinstance(key, str): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 98 | 99 | if modification is not None and not isinstance(modification, int): 100 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 101 | 102 | self.__key_modified[key] = modification 103 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/merge_and_deliver_via_webhook_success_response.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 5 | except Exception: 6 | from ..exception import SDKException 7 | from ..util import Constants 8 | from .writer_response_handler import WriterResponseHandler 9 | 10 | 11 | class MergeAndDeliverViaWebhookSuccessResponse(WriterResponseHandler): 12 | def __init__(self): 13 | """Creates an instance of MergeAndDeliverViaWebhookSuccessResponse""" 14 | super().__init__() 15 | 16 | self.__merge_report_data_url = None 17 | self.__records = None 18 | self.__key_modified = dict() 19 | 20 | def get_merge_report_data_url(self): 21 | """ 22 | The method to get the merge_report_data_url 23 | 24 | Returns: 25 | string: A string representing the merge_report_data_url 26 | """ 27 | 28 | return self.__merge_report_data_url 29 | 30 | def set_merge_report_data_url(self, merge_report_data_url): 31 | """ 32 | The method to set the value to merge_report_data_url 33 | 34 | Parameters: 35 | merge_report_data_url (string) : A string representing the merge_report_data_url 36 | """ 37 | 38 | if merge_report_data_url is not None and not isinstance(merge_report_data_url, str): 39 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: merge_report_data_url EXPECTED TYPE: str', None, None) 40 | 41 | self.__merge_report_data_url = merge_report_data_url 42 | self.__key_modified['merge_report_data_url'] = 1 43 | 44 | def get_records(self): 45 | """ 46 | The method to get the records 47 | 48 | Returns: 49 | list: An instance of list 50 | """ 51 | 52 | return self.__records 53 | 54 | def set_records(self, records): 55 | """ 56 | The method to set the value to records 57 | 58 | Parameters: 59 | records (list) : An instance of list 60 | """ 61 | 62 | if records is not None and not isinstance(records, list): 63 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: records EXPECTED TYPE: list', None, None) 64 | 65 | self.__records = records 66 | self.__key_modified['records'] = 1 67 | 68 | def is_key_modified(self, key): 69 | """ 70 | The method to check if the user has modified the given key 71 | 72 | Parameters: 73 | key (string) : A string representing the key 74 | 75 | Returns: 76 | int: An int representing the modification 77 | """ 78 | 79 | if key is not None and not isinstance(key, str): 80 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 81 | 82 | if key in self.__key_modified: 83 | return self.__key_modified.get(key) 84 | 85 | return None 86 | 87 | def set_key_modified(self, key, modification): 88 | """ 89 | The method to mark the given key as modified 90 | 91 | Parameters: 92 | key (string) : A string representing the key 93 | modification (int) : An int representing the modification 94 | """ 95 | 96 | if key is not None and not isinstance(key, str): 97 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 98 | 99 | if modification is not None and not isinstance(modification, int): 100 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 101 | 102 | self.__key_modified[key] = modification 103 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/combine_pd_fs_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class CombinePDFsParameters(object): 10 | def __init__(self): 11 | """Creates an instance of CombinePDFsParameters""" 12 | 13 | self.__input_options = None 14 | self.__output_settings = None 15 | self.__key_modified = dict() 16 | 17 | def get_input_options(self): 18 | """ 19 | The method to get the input_options 20 | 21 | Returns: 22 | dict: An instance of dict 23 | """ 24 | 25 | return self.__input_options 26 | 27 | def set_input_options(self, input_options): 28 | """ 29 | The method to set the value to input_options 30 | 31 | Parameters: 32 | input_options (dict) : An instance of dict 33 | """ 34 | 35 | if input_options is not None and not isinstance(input_options, dict): 36 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: input_options EXPECTED TYPE: dict', None, None) 37 | 38 | self.__input_options = input_options 39 | self.__key_modified['input_options'] = 1 40 | 41 | def get_output_settings(self): 42 | """ 43 | The method to get the output_settings 44 | 45 | Returns: 46 | CombinePDFsOutputSettings: An instance of CombinePDFsOutputSettings 47 | """ 48 | 49 | return self.__output_settings 50 | 51 | def set_output_settings(self, output_settings): 52 | """ 53 | The method to set the value to output_settings 54 | 55 | Parameters: 56 | output_settings (CombinePDFsOutputSettings) : An instance of CombinePDFsOutputSettings 57 | """ 58 | 59 | try: 60 | from officeintegrator.src.com.zoho.officeintegrator.v1.combine_pd_fs_output_settings import CombinePDFsOutputSettings 61 | except Exception: 62 | from .combine_pd_fs_output_settings import CombinePDFsOutputSettings 63 | 64 | if output_settings is not None and not isinstance(output_settings, CombinePDFsOutputSettings): 65 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output_settings EXPECTED TYPE: CombinePDFsOutputSettings', None, None) 66 | 67 | self.__output_settings = output_settings 68 | self.__key_modified['output_settings'] = 1 69 | 70 | def is_key_modified(self, key): 71 | """ 72 | The method to check if the user has modified the given key 73 | 74 | Parameters: 75 | key (string) : A string representing the key 76 | 77 | Returns: 78 | int: An int representing the modification 79 | """ 80 | 81 | if key is not None and not isinstance(key, str): 82 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 83 | 84 | if key in self.__key_modified: 85 | return self.__key_modified.get(key) 86 | 87 | return None 88 | 89 | def set_key_modified(self, key, modification): 90 | """ 91 | The method to mark the given key as modified 92 | 93 | Parameters: 94 | key (string) : A string representing the key 95 | modification (int) : An int representing the modification 96 | """ 97 | 98 | if key is not None and not isinstance(key, str): 99 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 100 | 101 | if modification is not None and not isinstance(modification, int): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 103 | 104 | self.__key_modified[key] = modification 105 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/api/authenticator/auth.py: -------------------------------------------------------------------------------- 1 | from .token import Token 2 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import Constants 4 | from officeintegrator.src.com.zoho.api.authenticator.authentication_schema import AuthenticationSchema 5 | 6 | 7 | class Auth(Token): 8 | parameter_map = {} 9 | header_map = {} 10 | 11 | def __init__(self, parameter_map=None, header_map=None, authentication_schema=None): 12 | self.parameter_map = parameter_map 13 | self.header_map = header_map 14 | self.authentication_schema = authentication_schema 15 | 16 | def get_authentication_schema(self): 17 | return self.authentication_schema 18 | 19 | def set_authentication_schema(self, authentication_schema): 20 | self.authentication_schema = authentication_schema 21 | 22 | def authenticate(self, url_connection, config): 23 | if len(self.header_map) > 0: 24 | for header in self.header_map.keys(): 25 | url_connection.add_header(header, self.header_map.get(header)) 26 | if len(self.parameter_map) > 0: 27 | for param in self.parameter_map.keys(): 28 | url_connection.add_param(param, self.parameter_map.get(param)) 29 | 30 | def remove(self): 31 | return super().remove() 32 | 33 | def get_id(self): 34 | return None 35 | 36 | def generate_token(self): 37 | return super().generate_token() 38 | 39 | class Builder: 40 | def __init__(self): 41 | self.parameter_map = {} 42 | self.header_map = {} 43 | self.authentication_schema = None 44 | 45 | def add_param(self, param_name, param_value): 46 | if param_name in self.parameter_map and len(self.parameter_map.get(param_name)) == 0: 47 | existing_param_value = self.parameter_map.get(param_name) 48 | existing_param_value = existing_param_value + "," + param_value 49 | self.parameter_map[param_name] = existing_param_value 50 | else: 51 | self.parameter_map[param_name] = param_value 52 | return self 53 | 54 | def add_header(self, header_name, header_value): 55 | if header_name in self.header_map and len(self.header_map.get(header_name)) == 0: 56 | existing_header_value = self.header_map.get(header_name) 57 | existing_header_value = existing_header_value + "," + header_value 58 | self.header_map[header_name] = existing_header_value 59 | else: 60 | self.header_map[header_name] = header_value 61 | return self 62 | 63 | def parameter_map(self, parameter_map): 64 | self.parameter_map = parameter_map 65 | return self 66 | 67 | def header_map(self, header_map): 68 | self.header_map = header_map 69 | return self 70 | 71 | def set_authentication_schema(self, authentication_schema): 72 | if (isinstance(authentication_schema, AuthenticationSchema)): 73 | self.authentication_schema = authentication_schema 74 | return self 75 | 76 | def build(self): 77 | if self.authentication_schema is None: 78 | raise SDKException(Constants.MANDATORY_VALUE_ERROR, 79 | Constants.MANDATORY_KEY_ERROR + "-" + Constants.OAUTH_MANDATORY_KEYS_1) 80 | return Auth(parameter_map=self.parameter_map, header_map=self.header_map, 81 | authentication_schema=self.authentication_schema) -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/editor_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class EditorSettings(object): 10 | def __init__(self): 11 | """Creates an instance of EditorSettings""" 12 | 13 | self.__unit = None 14 | self.__language = None 15 | self.__view = None 16 | self.__key_modified = dict() 17 | 18 | def get_unit(self): 19 | """ 20 | The method to get the unit 21 | 22 | Returns: 23 | string: A string representing the unit 24 | """ 25 | 26 | return self.__unit 27 | 28 | def set_unit(self, unit): 29 | """ 30 | The method to set the value to unit 31 | 32 | Parameters: 33 | unit (string) : A string representing the unit 34 | """ 35 | 36 | if unit is not None and not isinstance(unit, str): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: unit EXPECTED TYPE: str', None, None) 38 | 39 | self.__unit = unit 40 | self.__key_modified['unit'] = 1 41 | 42 | def get_language(self): 43 | """ 44 | The method to get the language 45 | 46 | Returns: 47 | string: A string representing the language 48 | """ 49 | 50 | return self.__language 51 | 52 | def set_language(self, language): 53 | """ 54 | The method to set the value to language 55 | 56 | Parameters: 57 | language (string) : A string representing the language 58 | """ 59 | 60 | if language is not None and not isinstance(language, str): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) 62 | 63 | self.__language = language 64 | self.__key_modified['language'] = 1 65 | 66 | def get_view(self): 67 | """ 68 | The method to get the view 69 | 70 | Returns: 71 | string: A string representing the view 72 | """ 73 | 74 | return self.__view 75 | 76 | def set_view(self, view): 77 | """ 78 | The method to set the value to view 79 | 80 | Parameters: 81 | view (string) : A string representing the view 82 | """ 83 | 84 | if view is not None and not isinstance(view, str): 85 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: view EXPECTED TYPE: str', None, None) 86 | 87 | self.__view = view 88 | self.__key_modified['view'] = 1 89 | 90 | def is_key_modified(self, key): 91 | """ 92 | The method to check if the user has modified the given key 93 | 94 | Parameters: 95 | key (string) : A string representing the key 96 | 97 | Returns: 98 | int: An int representing the modification 99 | """ 100 | 101 | if key is not None and not isinstance(key, str): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 103 | 104 | if key in self.__key_modified: 105 | return self.__key_modified.get(key) 106 | 107 | return None 108 | 109 | def set_key_modified(self, key, modification): 110 | """ 111 | The method to mark the given key as modified 112 | 113 | Parameters: 114 | key (string) : A string representing the key 115 | modification (int) : An int representing the modification 116 | """ 117 | 118 | if key is not None and not isinstance(key, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 120 | 121 | if modification is not None and not isinstance(modification, int): 122 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 123 | 124 | self.__key_modified[key] = modification 125 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/merge_fields.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class MergeFields(object): 10 | def __init__(self): 11 | """Creates an instance of MergeFields""" 12 | 13 | self.__id = None 14 | self.__display_name = None 15 | self.__type = None 16 | self.__key_modified = dict() 17 | 18 | def get_id(self): 19 | """ 20 | The method to get the id 21 | 22 | Returns: 23 | string: A string representing the id 24 | """ 25 | 26 | return self.__id 27 | 28 | def set_id(self, id): 29 | """ 30 | The method to set the value to id 31 | 32 | Parameters: 33 | id (string) : A string representing the id 34 | """ 35 | 36 | if id is not None and not isinstance(id, str): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: str', None, None) 38 | 39 | self.__id = id 40 | self.__key_modified['id'] = 1 41 | 42 | def get_display_name(self): 43 | """ 44 | The method to get the display_name 45 | 46 | Returns: 47 | string: A string representing the display_name 48 | """ 49 | 50 | return self.__display_name 51 | 52 | def set_display_name(self, display_name): 53 | """ 54 | The method to set the value to display_name 55 | 56 | Parameters: 57 | display_name (string) : A string representing the display_name 58 | """ 59 | 60 | if display_name is not None and not isinstance(display_name, str): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: display_name EXPECTED TYPE: str', None, None) 62 | 63 | self.__display_name = display_name 64 | self.__key_modified['display_name'] = 1 65 | 66 | def get_type(self): 67 | """ 68 | The method to get the type 69 | 70 | Returns: 71 | string: A string representing the type 72 | """ 73 | 74 | return self.__type 75 | 76 | def set_type(self, type): 77 | """ 78 | The method to set the value to type 79 | 80 | Parameters: 81 | type (string) : A string representing the type 82 | """ 83 | 84 | if type is not None and not isinstance(type, str): 85 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: type EXPECTED TYPE: str', None, None) 86 | 87 | self.__type = type 88 | self.__key_modified['type'] = 1 89 | 90 | def is_key_modified(self, key): 91 | """ 92 | The method to check if the user has modified the given key 93 | 94 | Parameters: 95 | key (string) : A string representing the key 96 | 97 | Returns: 98 | int: An int representing the modification 99 | """ 100 | 101 | if key is not None and not isinstance(key, str): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 103 | 104 | if key in self.__key_modified: 105 | return self.__key_modified.get(key) 106 | 107 | return None 108 | 109 | def set_key_modified(self, key, modification): 110 | """ 111 | The method to mark the given key as modified 112 | 113 | Parameters: 114 | key (string) : A string representing the key 115 | modification (int) : An int representing the modification 116 | """ 117 | 118 | if key is not None and not isinstance(key, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 120 | 121 | if modification is not None and not isinstance(modification, int): 122 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 123 | 124 | self.__key_modified[key] = modification 125 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/fillable_form_options.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class FillableFormOptions(object): 10 | def __init__(self): 11 | """Creates an instance of FillableFormOptions""" 12 | 13 | self.__download = None 14 | self.__print = None 15 | self.__submit = None 16 | self.__key_modified = dict() 17 | 18 | def get_download(self): 19 | """ 20 | The method to get the download 21 | 22 | Returns: 23 | bool: A bool representing the download 24 | """ 25 | 26 | return self.__download 27 | 28 | def set_download(self, download): 29 | """ 30 | The method to set the value to download 31 | 32 | Parameters: 33 | download (bool) : A bool representing the download 34 | """ 35 | 36 | if download is not None and not isinstance(download, bool): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: download EXPECTED TYPE: bool', None, None) 38 | 39 | self.__download = download 40 | self.__key_modified['download'] = 1 41 | 42 | def get_print(self): 43 | """ 44 | The method to get the print 45 | 46 | Returns: 47 | bool: A bool representing the print 48 | """ 49 | 50 | return self.__print 51 | 52 | def set_print(self, print): 53 | """ 54 | The method to set the value to print 55 | 56 | Parameters: 57 | print (bool) : A bool representing the print 58 | """ 59 | 60 | if print is not None and not isinstance(print, bool): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: print EXPECTED TYPE: bool', None, None) 62 | 63 | self.__print = print 64 | self.__key_modified['print'] = 1 65 | 66 | def get_submit(self): 67 | """ 68 | The method to get the submit 69 | 70 | Returns: 71 | bool: A bool representing the submit 72 | """ 73 | 74 | return self.__submit 75 | 76 | def set_submit(self, submit): 77 | """ 78 | The method to set the value to submit 79 | 80 | Parameters: 81 | submit (bool) : A bool representing the submit 82 | """ 83 | 84 | if submit is not None and not isinstance(submit, bool): 85 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: submit EXPECTED TYPE: bool', None, None) 86 | 87 | self.__submit = submit 88 | self.__key_modified['submit'] = 1 89 | 90 | def is_key_modified(self, key): 91 | """ 92 | The method to check if the user has modified the given key 93 | 94 | Parameters: 95 | key (string) : A string representing the key 96 | 97 | Returns: 98 | int: An int representing the modification 99 | """ 100 | 101 | if key is not None and not isinstance(key, str): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 103 | 104 | if key in self.__key_modified: 105 | return self.__key_modified.get(key) 106 | 107 | return None 108 | 109 | def set_key_modified(self, key, modification): 110 | """ 111 | The method to mark the given key as modified 112 | 113 | Parameters: 114 | key (string) : A string representing the key 115 | modification (int) : An int representing the modification 116 | """ 117 | 118 | if key is not None and not isinstance(key, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 120 | 121 | if modification is not None and not isinstance(modification, int): 122 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 123 | 124 | self.__key_modified[key] = modification 125 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/convert_presentation_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class ConvertPresentationParameters(object): 10 | def __init__(self): 11 | """Creates an instance of ConvertPresentationParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__format = None 16 | self.__key_modified = dict() 17 | 18 | def get_url(self): 19 | """ 20 | The method to get the url 21 | 22 | Returns: 23 | string: A string representing the url 24 | """ 25 | 26 | return self.__url 27 | 28 | def set_url(self, url): 29 | """ 30 | The method to set the value to url 31 | 32 | Parameters: 33 | url (string) : A string representing the url 34 | """ 35 | 36 | if url is not None and not isinstance(url, str): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 38 | 39 | self.__url = url 40 | self.__key_modified['url'] = 1 41 | 42 | def get_document(self): 43 | """ 44 | The method to get the document 45 | 46 | Returns: 47 | StreamWrapper: An instance of StreamWrapper 48 | """ 49 | 50 | return self.__document 51 | 52 | def set_document(self, document): 53 | """ 54 | The method to set the value to document 55 | 56 | Parameters: 57 | document (StreamWrapper) : An instance of StreamWrapper 58 | """ 59 | 60 | if document is not None and not isinstance(document, StreamWrapper): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 62 | 63 | self.__document = document 64 | self.__key_modified['document'] = 1 65 | 66 | def get_format(self): 67 | """ 68 | The method to get the format 69 | 70 | Returns: 71 | string: A string representing the format 72 | """ 73 | 74 | return self.__format 75 | 76 | def set_format(self, format): 77 | """ 78 | The method to set the value to format 79 | 80 | Parameters: 81 | format (string) : A string representing the format 82 | """ 83 | 84 | if format is not None and not isinstance(format, str): 85 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) 86 | 87 | self.__format = format 88 | self.__key_modified['format'] = 1 89 | 90 | def is_key_modified(self, key): 91 | """ 92 | The method to check if the user has modified the given key 93 | 94 | Parameters: 95 | key (string) : A string representing the key 96 | 97 | Returns: 98 | int: An int representing the modification 99 | """ 100 | 101 | if key is not None and not isinstance(key, str): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 103 | 104 | if key in self.__key_modified: 105 | return self.__key_modified.get(key) 106 | 107 | return None 108 | 109 | def set_key_modified(self, key, modification): 110 | """ 111 | The method to mark the given key as modified 112 | 113 | Parameters: 114 | key (string) : A string representing the key 115 | modification (int) : An int representing the modification 116 | """ 117 | 118 | if key is not None and not isinstance(key, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 120 | 121 | if modification is not None and not isinstance(modification, int): 122 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 123 | 124 | self.__key_modified[key] = modification 125 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/watermark_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class WatermarkParameters(object): 10 | def __init__(self): 11 | """Creates an instance of WatermarkParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__watermark_settings = None 16 | self.__key_modified = dict() 17 | 18 | def get_url(self): 19 | """ 20 | The method to get the url 21 | 22 | Returns: 23 | string: A string representing the url 24 | """ 25 | 26 | return self.__url 27 | 28 | def set_url(self, url): 29 | """ 30 | The method to set the value to url 31 | 32 | Parameters: 33 | url (string) : A string representing the url 34 | """ 35 | 36 | if url is not None and not isinstance(url, str): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 38 | 39 | self.__url = url 40 | self.__key_modified['url'] = 1 41 | 42 | def get_document(self): 43 | """ 44 | The method to get the document 45 | 46 | Returns: 47 | StreamWrapper: An instance of StreamWrapper 48 | """ 49 | 50 | return self.__document 51 | 52 | def set_document(self, document): 53 | """ 54 | The method to set the value to document 55 | 56 | Parameters: 57 | document (StreamWrapper) : An instance of StreamWrapper 58 | """ 59 | 60 | if document is not None and not isinstance(document, StreamWrapper): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 62 | 63 | self.__document = document 64 | self.__key_modified['document'] = 1 65 | 66 | def get_watermark_settings(self): 67 | """ 68 | The method to get the watermark_settings 69 | 70 | Returns: 71 | WatermarkSettings: An instance of WatermarkSettings 72 | """ 73 | 74 | return self.__watermark_settings 75 | 76 | def set_watermark_settings(self, watermark_settings): 77 | """ 78 | The method to set the value to watermark_settings 79 | 80 | Parameters: 81 | watermark_settings (WatermarkSettings) : An instance of WatermarkSettings 82 | """ 83 | 84 | try: 85 | from officeintegrator.src.com.zoho.officeintegrator.v1.watermark_settings import WatermarkSettings 86 | except Exception: 87 | from .watermark_settings import WatermarkSettings 88 | 89 | if watermark_settings is not None and not isinstance(watermark_settings, WatermarkSettings): 90 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: watermark_settings EXPECTED TYPE: WatermarkSettings', None, None) 91 | 92 | self.__watermark_settings = watermark_settings 93 | self.__key_modified['watermark_settings'] = 1 94 | 95 | def is_key_modified(self, key): 96 | """ 97 | The method to check if the user has modified the given key 98 | 99 | Parameters: 100 | key (string) : A string representing the key 101 | 102 | Returns: 103 | int: An int representing the modification 104 | """ 105 | 106 | if key is not None and not isinstance(key, str): 107 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 108 | 109 | if key in self.__key_modified: 110 | return self.__key_modified.get(key) 111 | 112 | return None 113 | 114 | def set_key_modified(self, key, modification): 115 | """ 116 | The method to mark the given key as modified 117 | 118 | Parameters: 119 | key (string) : A string representing the key 120 | modification (int) : An int representing the modification 121 | """ 122 | 123 | if key is not None and not isinstance(key, str): 124 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 125 | 126 | if modification is not None and not isinstance(modification, int): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 128 | 129 | self.__key_modified[key] = modification 130 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_conversion_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class SheetConversionParameters(object): 10 | def __init__(self): 11 | """Creates an instance of SheetConversionParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__output_options = None 16 | self.__key_modified = dict() 17 | 18 | def get_url(self): 19 | """ 20 | The method to get the url 21 | 22 | Returns: 23 | string: A string representing the url 24 | """ 25 | 26 | return self.__url 27 | 28 | def set_url(self, url): 29 | """ 30 | The method to set the value to url 31 | 32 | Parameters: 33 | url (string) : A string representing the url 34 | """ 35 | 36 | if url is not None and not isinstance(url, str): 37 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 38 | 39 | self.__url = url 40 | self.__key_modified['url'] = 1 41 | 42 | def get_document(self): 43 | """ 44 | The method to get the document 45 | 46 | Returns: 47 | StreamWrapper: An instance of StreamWrapper 48 | """ 49 | 50 | return self.__document 51 | 52 | def set_document(self, document): 53 | """ 54 | The method to set the value to document 55 | 56 | Parameters: 57 | document (StreamWrapper) : An instance of StreamWrapper 58 | """ 59 | 60 | if document is not None and not isinstance(document, StreamWrapper): 61 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 62 | 63 | self.__document = document 64 | self.__key_modified['document'] = 1 65 | 66 | def get_output_options(self): 67 | """ 68 | The method to get the output_options 69 | 70 | Returns: 71 | SheetConversionOutputOptions: An instance of SheetConversionOutputOptions 72 | """ 73 | 74 | return self.__output_options 75 | 76 | def set_output_options(self, output_options): 77 | """ 78 | The method to set the value to output_options 79 | 80 | Parameters: 81 | output_options (SheetConversionOutputOptions) : An instance of SheetConversionOutputOptions 82 | """ 83 | 84 | try: 85 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_conversion_output_options import SheetConversionOutputOptions 86 | except Exception: 87 | from .sheet_conversion_output_options import SheetConversionOutputOptions 88 | 89 | if output_options is not None and not isinstance(output_options, SheetConversionOutputOptions): 90 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output_options EXPECTED TYPE: SheetConversionOutputOptions', None, None) 91 | 92 | self.__output_options = output_options 93 | self.__key_modified['output_options'] = 1 94 | 95 | def is_key_modified(self, key): 96 | """ 97 | The method to check if the user has modified the given key 98 | 99 | Parameters: 100 | key (string) : A string representing the key 101 | 102 | Returns: 103 | int: An int representing the modification 104 | """ 105 | 106 | if key is not None and not isinstance(key, str): 107 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 108 | 109 | if key in self.__key_modified: 110 | return self.__key_modified.get(key) 111 | 112 | return None 113 | 114 | def set_key_modified(self, key, modification): 115 | """ 116 | The method to mark the given key as modified 117 | 118 | Parameters: 119 | key (string) : A string representing the key 120 | modification (int) : An int representing the modification 121 | """ 122 | 123 | if key is not None and not isinstance(key, str): 124 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 125 | 126 | if modification is not None and not isinstance(modification, int): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 128 | 129 | self.__key_modified[key] = modification 130 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/margin.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class Margin(object): 10 | def __init__(self): 11 | """Creates an instance of Margin""" 12 | 13 | self.__left = None 14 | self.__right = None 15 | self.__top = None 16 | self.__bottom = None 17 | self.__key_modified = dict() 18 | 19 | def get_left(self): 20 | """ 21 | The method to get the left 22 | 23 | Returns: 24 | string: A string representing the left 25 | """ 26 | 27 | return self.__left 28 | 29 | def set_left(self, left): 30 | """ 31 | The method to set the value to left 32 | 33 | Parameters: 34 | left (string) : A string representing the left 35 | """ 36 | 37 | if left is not None and not isinstance(left, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: left EXPECTED TYPE: str', None, None) 39 | 40 | self.__left = left 41 | self.__key_modified['left'] = 1 42 | 43 | def get_right(self): 44 | """ 45 | The method to get the right 46 | 47 | Returns: 48 | string: A string representing the right 49 | """ 50 | 51 | return self.__right 52 | 53 | def set_right(self, right): 54 | """ 55 | The method to set the value to right 56 | 57 | Parameters: 58 | right (string) : A string representing the right 59 | """ 60 | 61 | if right is not None and not isinstance(right, str): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: right EXPECTED TYPE: str', None, None) 63 | 64 | self.__right = right 65 | self.__key_modified['right'] = 1 66 | 67 | def get_top(self): 68 | """ 69 | The method to get the top 70 | 71 | Returns: 72 | string: A string representing the top 73 | """ 74 | 75 | return self.__top 76 | 77 | def set_top(self, top): 78 | """ 79 | The method to set the value to top 80 | 81 | Parameters: 82 | top (string) : A string representing the top 83 | """ 84 | 85 | if top is not None and not isinstance(top, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: top EXPECTED TYPE: str', None, None) 87 | 88 | self.__top = top 89 | self.__key_modified['top'] = 1 90 | 91 | def get_bottom(self): 92 | """ 93 | The method to get the bottom 94 | 95 | Returns: 96 | string: A string representing the bottom 97 | """ 98 | 99 | return self.__bottom 100 | 101 | def set_bottom(self, bottom): 102 | """ 103 | The method to set the value to bottom 104 | 105 | Parameters: 106 | bottom (string) : A string representing the bottom 107 | """ 108 | 109 | if bottom is not None and not isinstance(bottom, str): 110 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: bottom EXPECTED TYPE: str', None, None) 111 | 112 | self.__bottom = bottom 113 | self.__key_modified['bottom'] = 1 114 | 115 | def is_key_modified(self, key): 116 | """ 117 | The method to check if the user has modified the given key 118 | 119 | Parameters: 120 | key (string) : A string representing the key 121 | 122 | Returns: 123 | int: An int representing the modification 124 | """ 125 | 126 | if key is not None and not isinstance(key, str): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 128 | 129 | if key in self.__key_modified: 130 | return self.__key_modified.get(key) 131 | 132 | return None 133 | 134 | def set_key_modified(self, key, modification): 135 | """ 136 | The method to mark the given key as modified 137 | 138 | Parameters: 139 | key (string) : A string representing the key 140 | modification (int) : An int representing the modification 141 | """ 142 | 143 | if key is not None and not isinstance(key, str): 144 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 145 | 146 | if modification is not None and not isinstance(modification, int): 147 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 148 | 149 | self.__key_modified[key] = modification 150 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .editor_settings import EditorSettings 2 | from .show_response_handler import ShowResponseHandler 3 | from .document_session_delete_success_response import DocumentSessionDeleteSuccessResponse 4 | from .presentation_preview_parameters import PresentationPreviewParameters 5 | from .watermark_parameters import WatermarkParameters 6 | from .fillable_callback_settings import FillableCallbackSettings 7 | from .document_delete_success_response import DocumentDeleteSuccessResponse 8 | from .create_document_response import CreateDocumentResponse 9 | from .user_info import UserInfo 10 | from .sheet_preview_response import SheetPreviewResponse 11 | from .compare_document_parameters import CompareDocumentParameters 12 | from .session_meta import SessionMeta 13 | from .fillable_submission_settings import FillableSubmissionSettings 14 | from .file_delete_success_response import FileDeleteSuccessResponse 15 | from .preview_response import PreviewResponse 16 | from .writer_response_handler import WriterResponseHandler 17 | from .fillable_link_parameters import FillableLinkParameters 18 | from .merge_and_deliver_via_webhook_parameters import MergeAndDeliverViaWebhookParameters 19 | from .fillable_link_response import FillableLinkResponse 20 | from .mail_merge_webhook_settings import MailMergeWebhookSettings 21 | from .get_merge_fields_parameters import GetMergeFieldsParameters 22 | from .sheet_ui_options import SheetUiOptions 23 | from .margin import Margin 24 | from .session_info import SessionInfo 25 | from .sheet_response_handler import SheetResponseHandler 26 | from .merge_fields_response import MergeFieldsResponse 27 | from .sheet_user_settings import SheetUserSettings 28 | from .document_info import DocumentInfo 29 | from .session_delete_success_response import SessionDeleteSuccessResponse 30 | from .v1_operations import V1Operations 31 | from .merge_and_deliver_via_webhook_success_response import MergeAndDeliverViaWebhookSuccessResponse 32 | from .session_user_info import SessionUserInfo 33 | from .create_presentation_parameters import CreatePresentationParameters 34 | from .watermark_settings import WatermarkSettings 35 | from .merge_and_deliver_records_meta import MergeAndDeliverRecordsMeta 36 | from .invalid_configuration_exception import InvalidConfigurationException 37 | from .sheet_callback_settings import SheetCallbackSettings 38 | from .compare_document_response import CompareDocumentResponse 39 | from .sheet_preview_parameters import SheetPreviewParameters 40 | from .combine_pd_fs_parameters import CombinePDFsParameters 41 | from .create_document_parameters import CreateDocumentParameters 42 | from .fillable_form_options import FillableFormOptions 43 | from .mail_merge_template_parameters import MailMergeTemplateParameters 44 | from .zoho_show_editor_settings import ZohoShowEditorSettings 45 | from .callback_settings import CallbackSettings 46 | from .merge_fields import MergeFields 47 | from .sheet_response_handler1 import SheetResponseHandler1 48 | from .ui_options import UiOptions 49 | from .sheet_conversion_parameters import SheetConversionParameters 50 | from .response_handler import ResponseHandler 51 | from .sheet_download_parameters import SheetDownloadParameters 52 | from .file_body_wrapper import FileBodyWrapper 53 | from .document_meta import DocumentMeta 54 | from .convert_presentation_parameters import ConvertPresentationParameters 55 | from .sheet_editor_settings import SheetEditorSettings 56 | from .preview_parameters import PreviewParameters 57 | from .document_conversion_output_options import DocumentConversionOutputOptions 58 | from .authentication import Authentication 59 | from .merge_and_download_document_parameters import MergeAndDownloadDocumentParameters 60 | from .create_sheet_parameters import CreateSheetParameters 61 | from .fillable_link_output_settings import FillableLinkOutputSettings 62 | from .preview_document_info import PreviewDocumentInfo 63 | from .all_sessions_response import AllSessionsResponse 64 | from .document_conversion_parameters import DocumentConversionParameters 65 | from .plan_details import PlanDetails 66 | from .sheet_conversion_output_options import SheetConversionOutputOptions 67 | from .create_sheet_response import CreateSheetResponse 68 | from .combine_pd_fs_output_settings import CombinePDFsOutputSettings 69 | from .document_defaults import DocumentDefaults 70 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/fillable_submission_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class FillableSubmissionSettings(object): 10 | def __init__(self): 11 | """Creates an instance of FillableSubmissionSettings""" 12 | 13 | self.__callback_options = None 14 | self.__redirect_url = None 15 | self.__onsubmit_message = None 16 | self.__key_modified = dict() 17 | 18 | def get_callback_options(self): 19 | """ 20 | The method to get the callback_options 21 | 22 | Returns: 23 | FillableCallbackSettings: An instance of FillableCallbackSettings 24 | """ 25 | 26 | return self.__callback_options 27 | 28 | def set_callback_options(self, callback_options): 29 | """ 30 | The method to set the value to callback_options 31 | 32 | Parameters: 33 | callback_options (FillableCallbackSettings) : An instance of FillableCallbackSettings 34 | """ 35 | 36 | try: 37 | from officeintegrator.src.com.zoho.officeintegrator.v1.fillable_callback_settings import FillableCallbackSettings 38 | except Exception: 39 | from .fillable_callback_settings import FillableCallbackSettings 40 | 41 | if callback_options is not None and not isinstance(callback_options, FillableCallbackSettings): 42 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: callback_options EXPECTED TYPE: FillableCallbackSettings', None, None) 43 | 44 | self.__callback_options = callback_options 45 | self.__key_modified['callback_options'] = 1 46 | 47 | def get_redirect_url(self): 48 | """ 49 | The method to get the redirect_url 50 | 51 | Returns: 52 | string: A string representing the redirect_url 53 | """ 54 | 55 | return self.__redirect_url 56 | 57 | def set_redirect_url(self, redirect_url): 58 | """ 59 | The method to set the value to redirect_url 60 | 61 | Parameters: 62 | redirect_url (string) : A string representing the redirect_url 63 | """ 64 | 65 | if redirect_url is not None and not isinstance(redirect_url, str): 66 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: redirect_url EXPECTED TYPE: str', None, None) 67 | 68 | self.__redirect_url = redirect_url 69 | self.__key_modified['redirect_url'] = 1 70 | 71 | def get_onsubmit_message(self): 72 | """ 73 | The method to get the onsubmit_message 74 | 75 | Returns: 76 | string: A string representing the onsubmit_message 77 | """ 78 | 79 | return self.__onsubmit_message 80 | 81 | def set_onsubmit_message(self, onsubmit_message): 82 | """ 83 | The method to set the value to onsubmit_message 84 | 85 | Parameters: 86 | onsubmit_message (string) : A string representing the onsubmit_message 87 | """ 88 | 89 | if onsubmit_message is not None and not isinstance(onsubmit_message, str): 90 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: onsubmit_message EXPECTED TYPE: str', None, None) 91 | 92 | self.__onsubmit_message = onsubmit_message 93 | self.__key_modified['onsubmit_message'] = 1 94 | 95 | def is_key_modified(self, key): 96 | """ 97 | The method to check if the user has modified the given key 98 | 99 | Parameters: 100 | key (string) : A string representing the key 101 | 102 | Returns: 103 | int: An int representing the modification 104 | """ 105 | 106 | if key is not None and not isinstance(key, str): 107 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 108 | 109 | if key in self.__key_modified: 110 | return self.__key_modified.get(key) 111 | 112 | return None 113 | 114 | def set_key_modified(self, key, modification): 115 | """ 116 | The method to mark the given key as modified 117 | 118 | Parameters: 119 | key (string) : A string representing the key 120 | modification (int) : An int representing the modification 121 | """ 122 | 123 | if key is not None and not isinstance(key, str): 124 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 125 | 126 | if modification is not None and not isinstance(modification, int): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 128 | 129 | self.__key_modified[key] = modification 130 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/merge_and_deliver_records_meta.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class MergeAndDeliverRecordsMeta(object): 10 | def __init__(self): 11 | """Creates an instance of MergeAndDeliverRecordsMeta""" 12 | 13 | self.__download_link = None 14 | self.__email = None 15 | self.__name = None 16 | self.__status = None 17 | self.__key_modified = dict() 18 | 19 | def get_download_link(self): 20 | """ 21 | The method to get the download_link 22 | 23 | Returns: 24 | string: A string representing the download_link 25 | """ 26 | 27 | return self.__download_link 28 | 29 | def set_download_link(self, download_link): 30 | """ 31 | The method to set the value to download_link 32 | 33 | Parameters: 34 | download_link (string) : A string representing the download_link 35 | """ 36 | 37 | if download_link is not None and not isinstance(download_link, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: download_link EXPECTED TYPE: str', None, None) 39 | 40 | self.__download_link = download_link 41 | self.__key_modified['download_link'] = 1 42 | 43 | def get_email(self): 44 | """ 45 | The method to get the email 46 | 47 | Returns: 48 | string: A string representing the email 49 | """ 50 | 51 | return self.__email 52 | 53 | def set_email(self, email): 54 | """ 55 | The method to set the value to email 56 | 57 | Parameters: 58 | email (string) : A string representing the email 59 | """ 60 | 61 | if email is not None and not isinstance(email, str): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: email EXPECTED TYPE: str', None, None) 63 | 64 | self.__email = email 65 | self.__key_modified['email'] = 1 66 | 67 | def get_name(self): 68 | """ 69 | The method to get the name 70 | 71 | Returns: 72 | string: A string representing the name 73 | """ 74 | 75 | return self.__name 76 | 77 | def set_name(self, name): 78 | """ 79 | The method to set the value to name 80 | 81 | Parameters: 82 | name (string) : A string representing the name 83 | """ 84 | 85 | if name is not None and not isinstance(name, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: name EXPECTED TYPE: str', None, None) 87 | 88 | self.__name = name 89 | self.__key_modified['name'] = 1 90 | 91 | def get_status(self): 92 | """ 93 | The method to get the status 94 | 95 | Returns: 96 | string: A string representing the status 97 | """ 98 | 99 | return self.__status 100 | 101 | def set_status(self, status): 102 | """ 103 | The method to set the value to status 104 | 105 | Parameters: 106 | status (string) : A string representing the status 107 | """ 108 | 109 | if status is not None and not isinstance(status, str): 110 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: str', None, None) 111 | 112 | self.__status = status 113 | self.__key_modified['status'] = 1 114 | 115 | def is_key_modified(self, key): 116 | """ 117 | The method to check if the user has modified the given key 118 | 119 | Parameters: 120 | key (string) : A string representing the key 121 | 122 | Returns: 123 | int: An int representing the modification 124 | """ 125 | 126 | if key is not None and not isinstance(key, str): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 128 | 129 | if key in self.__key_modified: 130 | return self.__key_modified.get(key) 131 | 132 | return None 133 | 134 | def set_key_modified(self, key, modification): 135 | """ 136 | The method to mark the given key as modified 137 | 138 | Parameters: 139 | key (string) : A string representing the key 140 | modification (int) : An int representing the modification 141 | """ 142 | 143 | if key is not None and not isinstance(key, str): 144 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 145 | 146 | if modification is not None and not isinstance(modification, int): 147 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 148 | 149 | self.__key_modified[key] = modification 150 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_preview_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class SheetPreviewParameters(object): 10 | def __init__(self): 11 | """Creates an instance of SheetPreviewParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__language = None 16 | self.__permissions = None 17 | self.__key_modified = dict() 18 | 19 | def get_url(self): 20 | """ 21 | The method to get the url 22 | 23 | Returns: 24 | string: A string representing the url 25 | """ 26 | 27 | return self.__url 28 | 29 | def set_url(self, url): 30 | """ 31 | The method to set the value to url 32 | 33 | Parameters: 34 | url (string) : A string representing the url 35 | """ 36 | 37 | if url is not None and not isinstance(url, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 39 | 40 | self.__url = url 41 | self.__key_modified['url'] = 1 42 | 43 | def get_document(self): 44 | """ 45 | The method to get the document 46 | 47 | Returns: 48 | StreamWrapper: An instance of StreamWrapper 49 | """ 50 | 51 | return self.__document 52 | 53 | def set_document(self, document): 54 | """ 55 | The method to set the value to document 56 | 57 | Parameters: 58 | document (StreamWrapper) : An instance of StreamWrapper 59 | """ 60 | 61 | if document is not None and not isinstance(document, StreamWrapper): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 63 | 64 | self.__document = document 65 | self.__key_modified['document'] = 1 66 | 67 | def get_language(self): 68 | """ 69 | The method to get the language 70 | 71 | Returns: 72 | string: A string representing the language 73 | """ 74 | 75 | return self.__language 76 | 77 | def set_language(self, language): 78 | """ 79 | The method to set the value to language 80 | 81 | Parameters: 82 | language (string) : A string representing the language 83 | """ 84 | 85 | if language is not None and not isinstance(language, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) 87 | 88 | self.__language = language 89 | self.__key_modified['language'] = 1 90 | 91 | def get_permissions(self): 92 | """ 93 | The method to get the permissions 94 | 95 | Returns: 96 | dict: An instance of dict 97 | """ 98 | 99 | return self.__permissions 100 | 101 | def set_permissions(self, permissions): 102 | """ 103 | The method to set the value to permissions 104 | 105 | Parameters: 106 | permissions (dict) : An instance of dict 107 | """ 108 | 109 | if permissions is not None and not isinstance(permissions, dict): 110 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permissions EXPECTED TYPE: dict', None, None) 111 | 112 | self.__permissions = permissions 113 | self.__key_modified['permissions'] = 1 114 | 115 | def is_key_modified(self, key): 116 | """ 117 | The method to check if the user has modified the given key 118 | 119 | Parameters: 120 | key (string) : A string representing the key 121 | 122 | Returns: 123 | int: An int representing the modification 124 | """ 125 | 126 | if key is not None and not isinstance(key, str): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 128 | 129 | if key in self.__key_modified: 130 | return self.__key_modified.get(key) 131 | 132 | return None 133 | 134 | def set_key_modified(self, key, modification): 135 | """ 136 | The method to mark the given key as modified 137 | 138 | Parameters: 139 | key (string) : A string representing the key 140 | modification (int) : An int representing the modification 141 | """ 142 | 143 | if key is not None and not isinstance(key, str): 144 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 145 | 146 | if modification is not None and not isinstance(modification, int): 147 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 148 | 149 | self.__key_modified[key] = modification 150 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/ui_options.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class UiOptions(object): 10 | def __init__(self): 11 | """Creates an instance of UiOptions""" 12 | 13 | self.__save_button = None 14 | self.__chat_panel = None 15 | self.__file_menu = None 16 | self.__dark_mode = None 17 | self.__key_modified = dict() 18 | 19 | def get_save_button(self): 20 | """ 21 | The method to get the save_button 22 | 23 | Returns: 24 | string: A string representing the save_button 25 | """ 26 | 27 | return self.__save_button 28 | 29 | def set_save_button(self, save_button): 30 | """ 31 | The method to set the value to save_button 32 | 33 | Parameters: 34 | save_button (string) : A string representing the save_button 35 | """ 36 | 37 | if save_button is not None and not isinstance(save_button, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_button EXPECTED TYPE: str', None, None) 39 | 40 | self.__save_button = save_button 41 | self.__key_modified['save_button'] = 1 42 | 43 | def get_chat_panel(self): 44 | """ 45 | The method to get the chat_panel 46 | 47 | Returns: 48 | string: A string representing the chat_panel 49 | """ 50 | 51 | return self.__chat_panel 52 | 53 | def set_chat_panel(self, chat_panel): 54 | """ 55 | The method to set the value to chat_panel 56 | 57 | Parameters: 58 | chat_panel (string) : A string representing the chat_panel 59 | """ 60 | 61 | if chat_panel is not None and not isinstance(chat_panel, str): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: chat_panel EXPECTED TYPE: str', None, None) 63 | 64 | self.__chat_panel = chat_panel 65 | self.__key_modified['chat_panel'] = 1 66 | 67 | def get_file_menu(self): 68 | """ 69 | The method to get the file_menu 70 | 71 | Returns: 72 | string: A string representing the file_menu 73 | """ 74 | 75 | return self.__file_menu 76 | 77 | def set_file_menu(self, file_menu): 78 | """ 79 | The method to set the value to file_menu 80 | 81 | Parameters: 82 | file_menu (string) : A string representing the file_menu 83 | """ 84 | 85 | if file_menu is not None and not isinstance(file_menu, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: file_menu EXPECTED TYPE: str', None, None) 87 | 88 | self.__file_menu = file_menu 89 | self.__key_modified['file_menu'] = 1 90 | 91 | def get_dark_mode(self): 92 | """ 93 | The method to get the dark_mode 94 | 95 | Returns: 96 | string: A string representing the dark_mode 97 | """ 98 | 99 | return self.__dark_mode 100 | 101 | def set_dark_mode(self, dark_mode): 102 | """ 103 | The method to set the value to dark_mode 104 | 105 | Parameters: 106 | dark_mode (string) : A string representing the dark_mode 107 | """ 108 | 109 | if dark_mode is not None and not isinstance(dark_mode, str): 110 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: dark_mode EXPECTED TYPE: str', None, None) 111 | 112 | self.__dark_mode = dark_mode 113 | self.__key_modified['dark_mode'] = 1 114 | 115 | def is_key_modified(self, key): 116 | """ 117 | The method to check if the user has modified the given key 118 | 119 | Parameters: 120 | key (string) : A string representing the key 121 | 122 | Returns: 123 | int: An int representing the modification 124 | """ 125 | 126 | if key is not None and not isinstance(key, str): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 128 | 129 | if key in self.__key_modified: 130 | return self.__key_modified.get(key) 131 | 132 | return None 133 | 134 | def set_key_modified(self, key, modification): 135 | """ 136 | The method to mark the given key as modified 137 | 138 | Parameters: 139 | key (string) : A string representing the key 140 | modification (int) : An int representing the modification 141 | """ 142 | 143 | if key is not None and not isinstance(key, str): 144 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 145 | 146 | if modification is not None and not isinstance(modification, int): 147 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 148 | 149 | self.__key_modified[key] = modification 150 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/sheet_callback_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class SheetCallbackSettings(object): 10 | def __init__(self): 11 | """Creates an instance of SheetCallbackSettings""" 12 | 13 | self.__save_format = None 14 | self.__save_url = None 15 | self.__save_url_params = None 16 | self.__save_url_headers = None 17 | self.__key_modified = dict() 18 | 19 | def get_save_format(self): 20 | """ 21 | The method to get the save_format 22 | 23 | Returns: 24 | string: A string representing the save_format 25 | """ 26 | 27 | return self.__save_format 28 | 29 | def set_save_format(self, save_format): 30 | """ 31 | The method to set the value to save_format 32 | 33 | Parameters: 34 | save_format (string) : A string representing the save_format 35 | """ 36 | 37 | if save_format is not None and not isinstance(save_format, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_format EXPECTED TYPE: str', None, None) 39 | 40 | self.__save_format = save_format 41 | self.__key_modified['save_format'] = 1 42 | 43 | def get_save_url(self): 44 | """ 45 | The method to get the save_url 46 | 47 | Returns: 48 | string: A string representing the save_url 49 | """ 50 | 51 | return self.__save_url 52 | 53 | def set_save_url(self, save_url): 54 | """ 55 | The method to set the value to save_url 56 | 57 | Parameters: 58 | save_url (string) : A string representing the save_url 59 | """ 60 | 61 | if save_url is not None and not isinstance(save_url, str): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url EXPECTED TYPE: str', None, None) 63 | 64 | self.__save_url = save_url 65 | self.__key_modified['save_url'] = 1 66 | 67 | def get_save_url_params(self): 68 | """ 69 | The method to get the save_url_params 70 | 71 | Returns: 72 | dict: An instance of dict 73 | """ 74 | 75 | return self.__save_url_params 76 | 77 | def set_save_url_params(self, save_url_params): 78 | """ 79 | The method to set the value to save_url_params 80 | 81 | Parameters: 82 | save_url_params (dict) : An instance of dict 83 | """ 84 | 85 | if save_url_params is not None and not isinstance(save_url_params, dict): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_params EXPECTED TYPE: dict', None, None) 87 | 88 | self.__save_url_params = save_url_params 89 | self.__key_modified['save_url_params'] = 1 90 | 91 | def get_save_url_headers(self): 92 | """ 93 | The method to get the save_url_headers 94 | 95 | Returns: 96 | dict: An instance of dict 97 | """ 98 | 99 | return self.__save_url_headers 100 | 101 | def set_save_url_headers(self, save_url_headers): 102 | """ 103 | The method to set the value to save_url_headers 104 | 105 | Parameters: 106 | save_url_headers (dict) : An instance of dict 107 | """ 108 | 109 | if save_url_headers is not None and not isinstance(save_url_headers, dict): 110 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: save_url_headers EXPECTED TYPE: dict', None, None) 111 | 112 | self.__save_url_headers = save_url_headers 113 | self.__key_modified['save_url_headers'] = 1 114 | 115 | def is_key_modified(self, key): 116 | """ 117 | The method to check if the user has modified the given key 118 | 119 | Parameters: 120 | key (string) : A string representing the key 121 | 122 | Returns: 123 | int: An int representing the modification 124 | """ 125 | 126 | if key is not None and not isinstance(key, str): 127 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 128 | 129 | if key in self.__key_modified: 130 | return self.__key_modified.get(key) 131 | 132 | return None 133 | 134 | def set_key_modified(self, key, modification): 135 | """ 136 | The method to mark the given key as modified 137 | 138 | Parameters: 139 | key (string) : A string representing the key 140 | modification (int) : An int representing the modification 141 | """ 142 | 143 | if key is not None and not isinstance(key, str): 144 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 145 | 146 | if modification is not None and not isinstance(modification, int): 147 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 148 | 149 | self.__key_modified[key] = modification 150 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/session_meta.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler 5 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 6 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 7 | except Exception: 8 | from ..exception import SDKException 9 | from ..util import Constants 10 | from .show_response_handler import ShowResponseHandler 11 | from .sheet_response_handler import SheetResponseHandler 12 | from .writer_response_handler import WriterResponseHandler 13 | 14 | 15 | class SessionMeta(WriterResponseHandler, SheetResponseHandler, ShowResponseHandler): 16 | def __init__(self): 17 | """Creates an instance of SessionMeta""" 18 | super().__init__() 19 | 20 | self.__status = None 21 | self.__info = None 22 | self.__user_info = None 23 | self.__key_modified = dict() 24 | 25 | def get_status(self): 26 | """ 27 | The method to get the status 28 | 29 | Returns: 30 | string: A string representing the status 31 | """ 32 | 33 | return self.__status 34 | 35 | def set_status(self, status): 36 | """ 37 | The method to set the value to status 38 | 39 | Parameters: 40 | status (string) : A string representing the status 41 | """ 42 | 43 | if status is not None and not isinstance(status, str): 44 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: status EXPECTED TYPE: str', None, None) 45 | 46 | self.__status = status 47 | self.__key_modified['status'] = 1 48 | 49 | def get_info(self): 50 | """ 51 | The method to get the info 52 | 53 | Returns: 54 | SessionInfo: An instance of SessionInfo 55 | """ 56 | 57 | return self.__info 58 | 59 | def set_info(self, info): 60 | """ 61 | The method to set the value to info 62 | 63 | Parameters: 64 | info (SessionInfo) : An instance of SessionInfo 65 | """ 66 | 67 | try: 68 | from officeintegrator.src.com.zoho.officeintegrator.v1.session_info import SessionInfo 69 | except Exception: 70 | from .session_info import SessionInfo 71 | 72 | if info is not None and not isinstance(info, SessionInfo): 73 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: info EXPECTED TYPE: SessionInfo', None, None) 74 | 75 | self.__info = info 76 | self.__key_modified['info'] = 1 77 | 78 | def get_user_info(self): 79 | """ 80 | The method to get the user_info 81 | 82 | Returns: 83 | SessionUserInfo: An instance of SessionUserInfo 84 | """ 85 | 86 | return self.__user_info 87 | 88 | def set_user_info(self, user_info): 89 | """ 90 | The method to set the value to user_info 91 | 92 | Parameters: 93 | user_info (SessionUserInfo) : An instance of SessionUserInfo 94 | """ 95 | 96 | try: 97 | from officeintegrator.src.com.zoho.officeintegrator.v1.session_user_info import SessionUserInfo 98 | except Exception: 99 | from .session_user_info import SessionUserInfo 100 | 101 | if user_info is not None and not isinstance(user_info, SessionUserInfo): 102 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: user_info EXPECTED TYPE: SessionUserInfo', None, None) 103 | 104 | self.__user_info = user_info 105 | self.__key_modified['user_info'] = 1 106 | 107 | def is_key_modified(self, key): 108 | """ 109 | The method to check if the user has modified the given key 110 | 111 | Parameters: 112 | key (string) : A string representing the key 113 | 114 | Returns: 115 | int: An int representing the modification 116 | """ 117 | 118 | if key is not None and not isinstance(key, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 120 | 121 | if key in self.__key_modified: 122 | return self.__key_modified.get(key) 123 | 124 | return None 125 | 126 | def set_key_modified(self, key, modification): 127 | """ 128 | The method to mark the given key as modified 129 | 130 | Parameters: 131 | key (string) : A string representing the key 132 | modification (int) : An int representing the modification 133 | """ 134 | 135 | if key is not None and not isinstance(key, str): 136 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 137 | 138 | if modification is not None and not isinstance(modification, int): 139 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 140 | 141 | self.__key_modified[key] = modification 142 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/presentation_preview_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class PresentationPreviewParameters(object): 10 | def __init__(self): 11 | """Creates an instance of PresentationPreviewParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__language = None 16 | self.__document_info = None 17 | self.__key_modified = dict() 18 | 19 | def get_url(self): 20 | """ 21 | The method to get the url 22 | 23 | Returns: 24 | string: A string representing the url 25 | """ 26 | 27 | return self.__url 28 | 29 | def set_url(self, url): 30 | """ 31 | The method to set the value to url 32 | 33 | Parameters: 34 | url (string) : A string representing the url 35 | """ 36 | 37 | if url is not None and not isinstance(url, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 39 | 40 | self.__url = url 41 | self.__key_modified['url'] = 1 42 | 43 | def get_document(self): 44 | """ 45 | The method to get the document 46 | 47 | Returns: 48 | StreamWrapper: An instance of StreamWrapper 49 | """ 50 | 51 | return self.__document 52 | 53 | def set_document(self, document): 54 | """ 55 | The method to set the value to document 56 | 57 | Parameters: 58 | document (StreamWrapper) : An instance of StreamWrapper 59 | """ 60 | 61 | if document is not None and not isinstance(document, StreamWrapper): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 63 | 64 | self.__document = document 65 | self.__key_modified['document'] = 1 66 | 67 | def get_language(self): 68 | """ 69 | The method to get the language 70 | 71 | Returns: 72 | string: A string representing the language 73 | """ 74 | 75 | return self.__language 76 | 77 | def set_language(self, language): 78 | """ 79 | The method to set the value to language 80 | 81 | Parameters: 82 | language (string) : A string representing the language 83 | """ 84 | 85 | if language is not None and not isinstance(language, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: language EXPECTED TYPE: str', None, None) 87 | 88 | self.__language = language 89 | self.__key_modified['language'] = 1 90 | 91 | def get_document_info(self): 92 | """ 93 | The method to get the document_info 94 | 95 | Returns: 96 | DocumentInfo: An instance of DocumentInfo 97 | """ 98 | 99 | return self.__document_info 100 | 101 | def set_document_info(self, document_info): 102 | """ 103 | The method to set the value to document_info 104 | 105 | Parameters: 106 | document_info (DocumentInfo) : An instance of DocumentInfo 107 | """ 108 | 109 | try: 110 | from officeintegrator.src.com.zoho.officeintegrator.v1.document_info import DocumentInfo 111 | except Exception: 112 | from .document_info import DocumentInfo 113 | 114 | if document_info is not None and not isinstance(document_info, DocumentInfo): 115 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_info EXPECTED TYPE: DocumentInfo', None, None) 116 | 117 | self.__document_info = document_info 118 | self.__key_modified['document_info'] = 1 119 | 120 | def is_key_modified(self, key): 121 | """ 122 | The method to check if the user has modified the given key 123 | 124 | Parameters: 125 | key (string) : A string representing the key 126 | 127 | Returns: 128 | int: An int representing the modification 129 | """ 130 | 131 | if key is not None and not isinstance(key, str): 132 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 133 | 134 | if key in self.__key_modified: 135 | return self.__key_modified.get(key) 136 | 137 | return None 138 | 139 | def set_key_modified(self, key, modification): 140 | """ 141 | The method to mark the given key as modified 142 | 143 | Parameters: 144 | key (string) : A string representing the key 145 | modification (int) : An int representing the modification 146 | """ 147 | 148 | if key is not None and not isinstance(key, str): 149 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 150 | 151 | if modification is not None and not isinstance(modification, int): 152 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 153 | 154 | self.__key_modified[key] = modification 155 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/preview_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class PreviewParameters(object): 10 | def __init__(self): 11 | """Creates an instance of PreviewParameters""" 12 | 13 | self.__url = None 14 | self.__document = None 15 | self.__document_info = None 16 | self.__permissions = None 17 | self.__key_modified = dict() 18 | 19 | def get_url(self): 20 | """ 21 | The method to get the url 22 | 23 | Returns: 24 | string: A string representing the url 25 | """ 26 | 27 | return self.__url 28 | 29 | def set_url(self, url): 30 | """ 31 | The method to set the value to url 32 | 33 | Parameters: 34 | url (string) : A string representing the url 35 | """ 36 | 37 | if url is not None and not isinstance(url, str): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 39 | 40 | self.__url = url 41 | self.__key_modified['url'] = 1 42 | 43 | def get_document(self): 44 | """ 45 | The method to get the document 46 | 47 | Returns: 48 | StreamWrapper: An instance of StreamWrapper 49 | """ 50 | 51 | return self.__document 52 | 53 | def set_document(self, document): 54 | """ 55 | The method to set the value to document 56 | 57 | Parameters: 58 | document (StreamWrapper) : An instance of StreamWrapper 59 | """ 60 | 61 | if document is not None and not isinstance(document, StreamWrapper): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 63 | 64 | self.__document = document 65 | self.__key_modified['document'] = 1 66 | 67 | def get_document_info(self): 68 | """ 69 | The method to get the document_info 70 | 71 | Returns: 72 | PreviewDocumentInfo: An instance of PreviewDocumentInfo 73 | """ 74 | 75 | return self.__document_info 76 | 77 | def set_document_info(self, document_info): 78 | """ 79 | The method to set the value to document_info 80 | 81 | Parameters: 82 | document_info (PreviewDocumentInfo) : An instance of PreviewDocumentInfo 83 | """ 84 | 85 | try: 86 | from officeintegrator.src.com.zoho.officeintegrator.v1.preview_document_info import PreviewDocumentInfo 87 | except Exception: 88 | from .preview_document_info import PreviewDocumentInfo 89 | 90 | if document_info is not None and not isinstance(document_info, PreviewDocumentInfo): 91 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_info EXPECTED TYPE: PreviewDocumentInfo', None, None) 92 | 93 | self.__document_info = document_info 94 | self.__key_modified['document_info'] = 1 95 | 96 | def get_permissions(self): 97 | """ 98 | The method to get the permissions 99 | 100 | Returns: 101 | dict: An instance of dict 102 | """ 103 | 104 | return self.__permissions 105 | 106 | def set_permissions(self, permissions): 107 | """ 108 | The method to set the value to permissions 109 | 110 | Parameters: 111 | permissions (dict) : An instance of dict 112 | """ 113 | 114 | if permissions is not None and not isinstance(permissions, dict): 115 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: permissions EXPECTED TYPE: dict', None, None) 116 | 117 | self.__permissions = permissions 118 | self.__key_modified['permissions'] = 1 119 | 120 | def is_key_modified(self, key): 121 | """ 122 | The method to check if the user has modified the given key 123 | 124 | Parameters: 125 | key (string) : A string representing the key 126 | 127 | Returns: 128 | int: An int representing the modification 129 | """ 130 | 131 | if key is not None and not isinstance(key, str): 132 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 133 | 134 | if key in self.__key_modified: 135 | return self.__key_modified.get(key) 136 | 137 | return None 138 | 139 | def set_key_modified(self, key, modification): 140 | """ 141 | The method to mark the given key as modified 142 | 143 | Parameters: 144 | key (string) : A string representing the key 145 | modification (int) : An int representing the modification 146 | """ 147 | 148 | if key is not None and not isinstance(key, str): 149 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 150 | 151 | if modification is not None and not isinstance(modification, int): 152 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 153 | 154 | self.__key_modified[key] = modification 155 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/datatype_converter.py: -------------------------------------------------------------------------------- 1 | try: 2 | from dateutil.tz import tz 3 | import dateutil.parser 4 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 5 | from datetime import date, datetime 6 | except Exception: 7 | from dateutil.tz import tz 8 | import dateutil.parser 9 | from .constants import Constants 10 | from datetime import date, datetime 11 | 12 | 13 | class DataTypeConverter(object): 14 | 15 | """ 16 | This class converts JSON value to the expected object type and vice versa. 17 | """ 18 | 19 | pre_converter_map = {} 20 | 21 | post_converter_map = {} 22 | 23 | @staticmethod 24 | def init(): 25 | 26 | """ 27 | The method to initialize the PreConverter and PostConverter lambda functions. 28 | """ 29 | 30 | if len(DataTypeConverter.pre_converter_map) != 0 and len(DataTypeConverter.post_converter_map) != 0: 31 | return 32 | 33 | DataTypeConverter.add_to_map("String", lambda obj: str(obj), lambda obj: str(obj)) 34 | DataTypeConverter.add_to_map("Integer", lambda obj: int(obj), lambda obj: int(obj)) 35 | DataTypeConverter.add_to_map("Long", lambda obj: int(obj) if str(obj) != Constants.NULL_VALUE else None, lambda obj: int(obj)) 36 | DataTypeConverter.add_to_map("Boolean", lambda obj: bool(obj), lambda obj: bool(obj)) 37 | DataTypeConverter.add_to_map("Float", lambda obj: float(obj), lambda obj: float(obj)) 38 | DataTypeConverter.add_to_map("Double", lambda obj: float(obj), lambda obj: float(obj)) 39 | DataTypeConverter.add_to_map("Date", lambda obj: dateutil.parser.isoparse(obj).date(), lambda obj: obj.isoformat()) 40 | DataTypeConverter.add_to_map("DateTime", lambda obj: dateutil.parser.isoparse(obj).astimezone(tz.tzlocal()), lambda obj: obj.replace(microsecond=0).astimezone(tz.tzlocal()).isoformat()) 41 | DataTypeConverter.add_to_map("Object", lambda obj: DataTypeConverter.pre_convert_object_data(obj), lambda obj: DataTypeConverter.post_convert_object_data(obj)) 42 | DataTypeConverter.add_to_map("TimeZone", lambda obj: str(obj), lambda obj: str(obj)) 43 | 44 | @staticmethod 45 | def pre_convert_object_data(obj): 46 | return obj 47 | 48 | @staticmethod 49 | def post_convert_object_data(obj): 50 | 51 | if obj is None: 52 | return None 53 | if isinstance(obj, list): 54 | list_value = [] 55 | for data in obj: 56 | list_value.append(DataTypeConverter.post_convert_object_data(data)) 57 | 58 | return list_value 59 | 60 | elif isinstance(obj, dict): 61 | dict_value = {} 62 | for key, value in obj.items(): 63 | dict_value[key] = DataTypeConverter.post_convert_object_data(value) 64 | 65 | return dict_value 66 | 67 | elif isinstance(obj, date): 68 | return DataTypeConverter.post_convert(obj, Constants.DATE_NAMESPACE) 69 | 70 | elif isinstance(obj, datetime): 71 | return DataTypeConverter.post_convert(obj, Constants.DATETIME_NAMESPACE) 72 | 73 | else: 74 | return obj 75 | 76 | @staticmethod 77 | def add_to_map(name, pre_converter, post_converter): 78 | 79 | """ 80 | This method to add PreConverter and PostConverter instance. 81 | :param name: A str containing the data type class name. 82 | :param pre_converter: A pre_converter instance. 83 | :param post_converter: A post_converter instance. 84 | """ 85 | 86 | DataTypeConverter.pre_converter_map[name] = pre_converter 87 | DataTypeConverter.post_converter_map[name] = post_converter 88 | 89 | @staticmethod 90 | def pre_convert(obj, data_type): 91 | 92 | """ 93 | The method to convert JSON value to expected data value. 94 | :param obj: An object containing the JSON value. 95 | :param data_type: A str containing the expected method return type. 96 | :return: An object containing the expected data value. 97 | """ 98 | 99 | DataTypeConverter.init() 100 | if data_type in DataTypeConverter.pre_converter_map: 101 | return DataTypeConverter.pre_converter_map[data_type](obj) 102 | 103 | @staticmethod 104 | def post_convert(obj, data_type): 105 | 106 | """ 107 | The method to convert python data to JSON data value. 108 | :param obj: A object containing the python data value. 109 | :param data_type: A str containing the expected method return type. 110 | :return: An object containing the expected data value. 111 | """ 112 | 113 | DataTypeConverter.init() 114 | if data_type in DataTypeConverter.post_converter_map: 115 | return DataTypeConverter.post_converter_map[data_type](obj) 116 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/document_conversion_parameters.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util import StreamWrapper, Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import StreamWrapper, Constants 7 | 8 | 9 | class DocumentConversionParameters(object): 10 | def __init__(self): 11 | """Creates an instance of DocumentConversionParameters""" 12 | 13 | self.__document = None 14 | self.__url = None 15 | self.__password = None 16 | self.__output_options = None 17 | self.__key_modified = dict() 18 | 19 | def get_document(self): 20 | """ 21 | The method to get the document 22 | 23 | Returns: 24 | StreamWrapper: An instance of StreamWrapper 25 | """ 26 | 27 | return self.__document 28 | 29 | def set_document(self, document): 30 | """ 31 | The method to set the value to document 32 | 33 | Parameters: 34 | document (StreamWrapper) : An instance of StreamWrapper 35 | """ 36 | 37 | if document is not None and not isinstance(document, StreamWrapper): 38 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document EXPECTED TYPE: StreamWrapper', None, None) 39 | 40 | self.__document = document 41 | self.__key_modified['document'] = 1 42 | 43 | def get_url(self): 44 | """ 45 | The method to get the url 46 | 47 | Returns: 48 | string: A string representing the url 49 | """ 50 | 51 | return self.__url 52 | 53 | def set_url(self, url): 54 | """ 55 | The method to set the value to url 56 | 57 | Parameters: 58 | url (string) : A string representing the url 59 | """ 60 | 61 | if url is not None and not isinstance(url, str): 62 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 63 | 64 | self.__url = url 65 | self.__key_modified['url'] = 1 66 | 67 | def get_password(self): 68 | """ 69 | The method to get the password 70 | 71 | Returns: 72 | string: A string representing the password 73 | """ 74 | 75 | return self.__password 76 | 77 | def set_password(self, password): 78 | """ 79 | The method to set the value to password 80 | 81 | Parameters: 82 | password (string) : A string representing the password 83 | """ 84 | 85 | if password is not None and not isinstance(password, str): 86 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: password EXPECTED TYPE: str', None, None) 87 | 88 | self.__password = password 89 | self.__key_modified['password'] = 1 90 | 91 | def get_output_options(self): 92 | """ 93 | The method to get the output_options 94 | 95 | Returns: 96 | DocumentConversionOutputOptions: An instance of DocumentConversionOutputOptions 97 | """ 98 | 99 | return self.__output_options 100 | 101 | def set_output_options(self, output_options): 102 | """ 103 | The method to set the value to output_options 104 | 105 | Parameters: 106 | output_options (DocumentConversionOutputOptions) : An instance of DocumentConversionOutputOptions 107 | """ 108 | 109 | try: 110 | from officeintegrator.src.com.zoho.officeintegrator.v1.document_conversion_output_options import DocumentConversionOutputOptions 111 | except Exception: 112 | from .document_conversion_output_options import DocumentConversionOutputOptions 113 | 114 | if output_options is not None and not isinstance(output_options, DocumentConversionOutputOptions): 115 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output_options EXPECTED TYPE: DocumentConversionOutputOptions', None, None) 116 | 117 | self.__output_options = output_options 118 | self.__key_modified['output_options'] = 1 119 | 120 | def is_key_modified(self, key): 121 | """ 122 | The method to check if the user has modified the given key 123 | 124 | Parameters: 125 | key (string) : A string representing the key 126 | 127 | Returns: 128 | int: An int representing the modification 129 | """ 130 | 131 | if key is not None and not isinstance(key, str): 132 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 133 | 134 | if key in self.__key_modified: 135 | return self.__key_modified.get(key) 136 | 137 | return None 138 | 139 | def set_key_modified(self, key, modification): 140 | """ 141 | The method to mark the given key as modified 142 | 143 | Parameters: 144 | key (string) : A string representing the key 145 | modification (int) : An int representing the modification 146 | """ 147 | 148 | if key is not None and not isinstance(key, str): 149 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 150 | 151 | if modification is not None and not isinstance(modification, int): 152 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 153 | 154 | self.__key_modified[key] = modification 155 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/invalid_configuration_exception.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | from officeintegrator.src.com.zoho.officeintegrator.v1.response_handler import ResponseHandler 5 | from officeintegrator.src.com.zoho.officeintegrator.v1.show_response_handler import ShowResponseHandler 6 | from officeintegrator.src.com.zoho.officeintegrator.v1.sheet_response_handler import SheetResponseHandler 7 | from officeintegrator.src.com.zoho.officeintegrator.v1.writer_response_handler import WriterResponseHandler 8 | except Exception: 9 | from ..exception import SDKException 10 | from ..util import Constants 11 | from .response_handler import ResponseHandler 12 | from .show_response_handler import ShowResponseHandler 13 | from .sheet_response_handler import SheetResponseHandler 14 | from .writer_response_handler import WriterResponseHandler 15 | 16 | 17 | class InvalidConfigurationException(WriterResponseHandler, SheetResponseHandler, ShowResponseHandler, ResponseHandler): 18 | def __init__(self): 19 | """Creates an instance of InvalidConfigurationException""" 20 | super().__init__() 21 | 22 | self.__key_name = None 23 | self.__code = None 24 | self.__parameter_name = None 25 | self.__message = None 26 | self.__key_modified = dict() 27 | 28 | def get_key_name(self): 29 | """ 30 | The method to get the key_name 31 | 32 | Returns: 33 | string: A string representing the key_name 34 | """ 35 | 36 | return self.__key_name 37 | 38 | def set_key_name(self, key_name): 39 | """ 40 | The method to set the value to key_name 41 | 42 | Parameters: 43 | key_name (string) : A string representing the key_name 44 | """ 45 | 46 | if key_name is not None and not isinstance(key_name, str): 47 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key_name EXPECTED TYPE: str', None, None) 48 | 49 | self.__key_name = key_name 50 | self.__key_modified['key_name'] = 1 51 | 52 | def get_code(self): 53 | """ 54 | The method to get the code 55 | 56 | Returns: 57 | int: An int representing the code 58 | """ 59 | 60 | return self.__code 61 | 62 | def set_code(self, code): 63 | """ 64 | The method to set the value to code 65 | 66 | Parameters: 67 | code (int) : An int representing the code 68 | """ 69 | 70 | if code is not None and not isinstance(code, int): 71 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: code EXPECTED TYPE: int', None, None) 72 | 73 | self.__code = code 74 | self.__key_modified['code'] = 1 75 | 76 | def get_parameter_name(self): 77 | """ 78 | The method to get the parameter_name 79 | 80 | Returns: 81 | string: A string representing the parameter_name 82 | """ 83 | 84 | return self.__parameter_name 85 | 86 | def set_parameter_name(self, parameter_name): 87 | """ 88 | The method to set the value to parameter_name 89 | 90 | Parameters: 91 | parameter_name (string) : A string representing the parameter_name 92 | """ 93 | 94 | if parameter_name is not None and not isinstance(parameter_name, str): 95 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: parameter_name EXPECTED TYPE: str', None, None) 96 | 97 | self.__parameter_name = parameter_name 98 | self.__key_modified['parameter_name'] = 1 99 | 100 | def get_message(self): 101 | """ 102 | The method to get the message 103 | 104 | Returns: 105 | string: A string representing the message 106 | """ 107 | 108 | return self.__message 109 | 110 | def set_message(self, message): 111 | """ 112 | The method to set the value to message 113 | 114 | Parameters: 115 | message (string) : A string representing the message 116 | """ 117 | 118 | if message is not None and not isinstance(message, str): 119 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: message EXPECTED TYPE: str', None, None) 120 | 121 | self.__message = message 122 | self.__key_modified['message'] = 1 123 | 124 | def is_key_modified(self, key): 125 | """ 126 | The method to check if the user has modified the given key 127 | 128 | Parameters: 129 | key (string) : A string representing the key 130 | 131 | Returns: 132 | int: An int representing the modification 133 | """ 134 | 135 | if key is not None and not isinstance(key, str): 136 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 137 | 138 | if key in self.__key_modified: 139 | return self.__key_modified.get(key) 140 | 141 | return None 142 | 143 | def set_key_modified(self, key, modification): 144 | """ 145 | The method to mark the given key as modified 146 | 147 | Parameters: 148 | key (string) : A string representing the key 149 | modification (int) : An int representing the modification 150 | """ 151 | 152 | if key is not None and not isinstance(key, str): 153 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 154 | 155 | if modification is not None and not isinstance(modification, int): 156 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 157 | 158 | self.__key_modified[key] = modification 159 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/document_conversion_output_options.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class DocumentConversionOutputOptions(object): 10 | def __init__(self): 11 | """Creates an instance of DocumentConversionOutputOptions""" 12 | 13 | self.__format = None 14 | self.__document_name = None 15 | self.__password = None 16 | self.__include_changes = None 17 | self.__include_comments = None 18 | self.__key_modified = dict() 19 | 20 | def get_format(self): 21 | """ 22 | The method to get the format 23 | 24 | Returns: 25 | string: A string representing the format 26 | """ 27 | 28 | return self.__format 29 | 30 | def set_format(self, format): 31 | """ 32 | The method to set the value to format 33 | 34 | Parameters: 35 | format (string) : A string representing the format 36 | """ 37 | 38 | if format is not None and not isinstance(format, str): 39 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: format EXPECTED TYPE: str', None, None) 40 | 41 | self.__format = format 42 | self.__key_modified['format'] = 1 43 | 44 | def get_document_name(self): 45 | """ 46 | The method to get the document_name 47 | 48 | Returns: 49 | string: A string representing the document_name 50 | """ 51 | 52 | return self.__document_name 53 | 54 | def set_document_name(self, document_name): 55 | """ 56 | The method to set the value to document_name 57 | 58 | Parameters: 59 | document_name (string) : A string representing the document_name 60 | """ 61 | 62 | if document_name is not None and not isinstance(document_name, str): 63 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: document_name EXPECTED TYPE: str', None, None) 64 | 65 | self.__document_name = document_name 66 | self.__key_modified['document_name'] = 1 67 | 68 | def get_password(self): 69 | """ 70 | The method to get the password 71 | 72 | Returns: 73 | string: A string representing the password 74 | """ 75 | 76 | return self.__password 77 | 78 | def set_password(self, password): 79 | """ 80 | The method to set the value to password 81 | 82 | Parameters: 83 | password (string) : A string representing the password 84 | """ 85 | 86 | if password is not None and not isinstance(password, str): 87 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: password EXPECTED TYPE: str', None, None) 88 | 89 | self.__password = password 90 | self.__key_modified['password'] = 1 91 | 92 | def get_include_changes(self): 93 | """ 94 | The method to get the include_changes 95 | 96 | Returns: 97 | string: A string representing the include_changes 98 | """ 99 | 100 | return self.__include_changes 101 | 102 | def set_include_changes(self, include_changes): 103 | """ 104 | The method to set the value to include_changes 105 | 106 | Parameters: 107 | include_changes (string) : A string representing the include_changes 108 | """ 109 | 110 | if include_changes is not None and not isinstance(include_changes, str): 111 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: include_changes EXPECTED TYPE: str', None, None) 112 | 113 | self.__include_changes = include_changes 114 | self.__key_modified['include_changes'] = 1 115 | 116 | def get_include_comments(self): 117 | """ 118 | The method to get the include_comments 119 | 120 | Returns: 121 | string: A string representing the include_comments 122 | """ 123 | 124 | return self.__include_comments 125 | 126 | def set_include_comments(self, include_comments): 127 | """ 128 | The method to set the value to include_comments 129 | 130 | Parameters: 131 | include_comments (string) : A string representing the include_comments 132 | """ 133 | 134 | if include_comments is not None and not isinstance(include_comments, str): 135 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: include_comments EXPECTED TYPE: str', None, None) 136 | 137 | self.__include_comments = include_comments 138 | self.__key_modified['include_comments'] = 1 139 | 140 | def is_key_modified(self, key): 141 | """ 142 | The method to check if the user has modified the given key 143 | 144 | Parameters: 145 | key (string) : A string representing the key 146 | 147 | Returns: 148 | int: An int representing the modification 149 | """ 150 | 151 | if key is not None and not isinstance(key, str): 152 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 153 | 154 | if key in self.__key_modified: 155 | return self.__key_modified.get(key) 156 | 157 | return None 158 | 159 | def set_key_modified(self, key, modification): 160 | """ 161 | The method to mark the given key as modified 162 | 163 | Parameters: 164 | key (string) : A string representing the key 165 | modification (int) : An int representing the modification 166 | """ 167 | 168 | if key is not None and not isinstance(key, str): 169 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 170 | 171 | if modification is not None and not isinstance(modification, int): 172 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 173 | 174 | self.__key_modified[key] = modification 175 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/v1/fillable_callback_settings.py: -------------------------------------------------------------------------------- 1 | try: 2 | from officeintegrator.src.com.zoho.officeintegrator.exception.sdk_exception import SDKException 3 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 4 | except Exception: 5 | from ..exception import SDKException 6 | from ..util import Constants 7 | 8 | 9 | class FillableCallbackSettings(object): 10 | def __init__(self): 11 | """Creates an instance of FillableCallbackSettings""" 12 | 13 | self.__output = None 14 | self.__url = None 15 | self.__http_method_type = None 16 | self.__retries = None 17 | self.__timeout = None 18 | self.__key_modified = dict() 19 | 20 | def get_output(self): 21 | """ 22 | The method to get the output 23 | 24 | Returns: 25 | FillableLinkOutputSettings: An instance of FillableLinkOutputSettings 26 | """ 27 | 28 | return self.__output 29 | 30 | def set_output(self, output): 31 | """ 32 | The method to set the value to output 33 | 34 | Parameters: 35 | output (FillableLinkOutputSettings) : An instance of FillableLinkOutputSettings 36 | """ 37 | 38 | try: 39 | from officeintegrator.src.com.zoho.officeintegrator.v1.fillable_link_output_settings import FillableLinkOutputSettings 40 | except Exception: 41 | from .fillable_link_output_settings import FillableLinkOutputSettings 42 | 43 | if output is not None and not isinstance(output, FillableLinkOutputSettings): 44 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: output EXPECTED TYPE: FillableLinkOutputSettings', None, None) 45 | 46 | self.__output = output 47 | self.__key_modified['output'] = 1 48 | 49 | def get_url(self): 50 | """ 51 | The method to get the url 52 | 53 | Returns: 54 | string: A string representing the url 55 | """ 56 | 57 | return self.__url 58 | 59 | def set_url(self, url): 60 | """ 61 | The method to set the value to url 62 | 63 | Parameters: 64 | url (string) : A string representing the url 65 | """ 66 | 67 | if url is not None and not isinstance(url, str): 68 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: url EXPECTED TYPE: str', None, None) 69 | 70 | self.__url = url 71 | self.__key_modified['url'] = 1 72 | 73 | def get_http_method_type(self): 74 | """ 75 | The method to get the http_method_type 76 | 77 | Returns: 78 | string: A string representing the http_method_type 79 | """ 80 | 81 | return self.__http_method_type 82 | 83 | def set_http_method_type(self, http_method_type): 84 | """ 85 | The method to set the value to http_method_type 86 | 87 | Parameters: 88 | http_method_type (string) : A string representing the http_method_type 89 | """ 90 | 91 | if http_method_type is not None and not isinstance(http_method_type, str): 92 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: http_method_type EXPECTED TYPE: str', None, None) 93 | 94 | self.__http_method_type = http_method_type 95 | self.__key_modified['http_method_type'] = 1 96 | 97 | def get_retries(self): 98 | """ 99 | The method to get the retries 100 | 101 | Returns: 102 | int: An int representing the retries 103 | """ 104 | 105 | return self.__retries 106 | 107 | def set_retries(self, retries): 108 | """ 109 | The method to set the value to retries 110 | 111 | Parameters: 112 | retries (int) : An int representing the retries 113 | """ 114 | 115 | if retries is not None and not isinstance(retries, int): 116 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: retries EXPECTED TYPE: int', None, None) 117 | 118 | self.__retries = retries 119 | self.__key_modified['retries'] = 1 120 | 121 | def get_timeout(self): 122 | """ 123 | The method to get the timeout 124 | 125 | Returns: 126 | int: An int representing the timeout 127 | """ 128 | 129 | return self.__timeout 130 | 131 | def set_timeout(self, timeout): 132 | """ 133 | The method to set the value to timeout 134 | 135 | Parameters: 136 | timeout (int) : An int representing the timeout 137 | """ 138 | 139 | if timeout is not None and not isinstance(timeout, int): 140 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: timeout EXPECTED TYPE: int', None, None) 141 | 142 | self.__timeout = timeout 143 | self.__key_modified['timeout'] = 1 144 | 145 | def is_key_modified(self, key): 146 | """ 147 | The method to check if the user has modified the given key 148 | 149 | Parameters: 150 | key (string) : A string representing the key 151 | 152 | Returns: 153 | int: An int representing the modification 154 | """ 155 | 156 | if key is not None and not isinstance(key, str): 157 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 158 | 159 | if key in self.__key_modified: 160 | return self.__key_modified.get(key) 161 | 162 | return None 163 | 164 | def set_key_modified(self, key, modification): 165 | """ 166 | The method to mark the given key as modified 167 | 168 | Parameters: 169 | key (string) : A string representing the key 170 | modification (int) : An int representing the modification 171 | """ 172 | 173 | if key is not None and not isinstance(key, str): 174 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: key EXPECTED TYPE: str', None, None) 175 | 176 | if modification is not None and not isinstance(modification, int): 177 | raise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: modification EXPECTED TYPE: int', None, None) 178 | 179 | self.__key_modified[key] = modification 180 | -------------------------------------------------------------------------------- /officeintegrator/src/com/zoho/officeintegrator/util/header_param_validator.py: -------------------------------------------------------------------------------- 1 | 2 | try: 3 | import os 4 | import re 5 | import json 6 | from officeintegrator.src.com.zoho.officeintegrator.util.datatype_converter import DataTypeConverter 7 | from officeintegrator.src.com.zoho.officeintegrator.exception import SDKException 8 | from officeintegrator.src.com.zoho.officeintegrator.util.constants import Constants 9 | from officeintegrator.src.com.zoho.officeintegrator.util.json_converter import JSONConverter as JConverter 10 | from officeintegrator.src.com.zoho.officeintegrator.initializer import Initializer 11 | 12 | except Exception: 13 | import os 14 | import re 15 | import json 16 | from .datatype_converter import DataTypeConverter 17 | from ..exception import SDKException 18 | from .constants import Constants 19 | from .json_converter import JSONConverter 20 | from ..initializer import Initializer 21 | 22 | class HeaderParamValidator(object): 23 | """ 24 | This class validates the Header and Parameter values with the type accepted by the APIs. 25 | """ 26 | 27 | def validate(self, name, class_name, value): 28 | class_name = self.get_class_name(class_name) 29 | if class_name in Initializer.json_details: 30 | class_object = Initializer.json_details[class_name] 31 | for key in class_object.keys(): 32 | member_detail = class_object[key] 33 | key_name = member_detail[Constants.NAME] 34 | if name == key_name: 35 | if Constants.STRUCTURE_NAME in member_detail: 36 | if isinstance(value, list): 37 | json_array = [] 38 | request_objects = list(value) 39 | if len(request_objects) > 0: 40 | for request_object in request_objects: 41 | json_array.append(JConverter(None).form_request(request_object, member_detail[ 42 | Constants.STRUCTURE_NAME], None, None, None)) 43 | return json_array.__str__() 44 | return JConverter(None).form_request(value, member_detail[Constants.STRUCTURE_NAME], None, None, 45 | None).__str__() 46 | return self.parse_data(value).__str__() 47 | 48 | for key, value1 in Constants.DATA_TYPE.items(): 49 | if value1 == value.__class__: 50 | data_type = key 51 | break 52 | 53 | return DataTypeConverter.post_convert(value, data_type) 54 | 55 | @staticmethod 56 | def get_class_name(class_name): 57 | return class_name.rsplit('.', 1)[0].lower() + class_name[class_name.rfind('.'):] 58 | 59 | def parse_data(self, value, type): 60 | if type == Constants.MAP_NAMESPACE: 61 | json_object = {} 62 | request_object = dict(value) 63 | if len(request_object) > 0: 64 | for key, field_value in request_object.items(): 65 | json_object[key] = self.parse_data(field_value, type) 66 | return json_object 67 | elif type == Constants.LIST_NAMESPACE: 68 | json_array = [] 69 | request_objects = list(value) 70 | if len(request_objects) > 0: 71 | for request_object in request_objects: 72 | json_array.append(self.parse_data(request_object, type)) 73 | return json_array 74 | else: 75 | DataTypeConverter.post_convert(value, type) 76 | 77 | def get_key_json_details(self, name, json_details): 78 | for key_name in json_details.keys(): 79 | detail = json_details[key_name] 80 | 81 | if Constants.NAME in detail: 82 | if detail[Constants.NAME].lower() == name.lower(): 83 | return detail 84 | 85 | def get_file_name(self, name): 86 | sdk_name = 'officeintegrator.src.' 87 | name_split = str(name).split('.') 88 | class_name = name_split.pop() 89 | 90 | package_name = name_split.pop() 91 | pack_split = re.findall('[A-Z][^A-Z]*', package_name) 92 | if len(pack_split) == 0: 93 | sdk_package_name = package_name 94 | else: 95 | sdk_package_name = pack_split[0].lower() 96 | 97 | if len(pack_split) > 1: 98 | for i in range(1, len(pack_split)): 99 | sdk_package_name += '_' + pack_split[i].lower() 100 | 101 | name_split = list(map(lambda x: x.lower(), name_split)) 102 | sdk_name = sdk_name + '.'.join(name_split) + '.' + sdk_package_name + '.' + class_name 103 | if "operation" in sdk_name or "Operation" in sdk_name: 104 | return sdk_name.lower() 105 | else: 106 | return sdk_name 107 | 108 | @staticmethod 109 | def get_json_details(): 110 | 111 | try: 112 | from officeintegrator.src.com.zoho.officeintegrator.initializer import Initializer 113 | except Exception: 114 | from ..initializer import Initializer 115 | 116 | if Initializer.json_details is None: 117 | dir_name = os.path.dirname(__file__) 118 | filename = os.path.join(dir_name, '..', '..', '..', '..', Constants.JSON_DETAILS_FILE_PATH) 119 | 120 | with open(filename, mode='r') as JSON: 121 | Initializer.json_details = json.load(JSON) 122 | 123 | return Initializer.json_details 124 | --------------------------------------------------------------------------------