Exemple #1
0
    def configure_way2():  # Passing the entire configuration as a dictionary
        try:
            config_obj = ZOIRestClient.get_instance()

            user_config = {
                "apikey":
                "5a529635640132330906a23a42b38ede",
                "writer_api_base_url":
                "https://api.office-integrator.com/writer/officeapi/",
                "sheet_api_base_url":
                "https://api.office-integrator.com/sheet/officeapi/",
                "show_api_base_url":
                "https://api.office-integrator.com/show/officeapi/"
            }

            config_obj.initialize(user_config)

            # Used for demonstration only
            from controllers.RestClient import ZOIConfigUtil
            for key in ZOIConfigUtil.config_prop_dict:
                print("{0}: {1}".format(key,
                                        ZOIConfigUtil.config_prop_dict[key]))
        except ZOIException as ex:
            print(ex.status_code)
            print(ex.error_code)
            print(ex.error_message)
            print(ex.error_details)
            print(ex.error_content)
Exemple #2
0
def configure():
    """
    Passing the entire configuration as a dictionary
    """
    try:
        config_obj = ZOIRestClient.get_instance()
        user_config = {
            "apikey":
            "2ae438cf864488657cc9754a27daa480",
            "writer_api_base_url":
            "https://api.office-integrator.com/writer/officeapi/",
            "sheet_api_base_url":
            "https://api.office-integrator.com/sheet/officeapi/",
            "show_api_base_url":
            "https://api.office-integrator.com/show/officeapi/"
        }
        config_obj.initialize(user_config)

        # Used for demonstration only
        from controllers.RestClient import ZOIConfigUtil
        for key in ZOIConfigUtil.config_prop_dict:
            print("{0}: {1}".format(key, ZOIConfigUtil.config_prop_dict[key]))
    except ZOIException as ex:
        print(ex.status_code)
        print(ex.error_code)
        print(ex.error_message)
        print(ex.error_details)
        print(ex.error_content)
Exemple #3
0
    def configure_way1():  # Using in-built Setters
        try:
            config_obj = ZOIRestClient.get_instance()

            config_obj.set_apikey("98b1a012ba17d011b8e61737ebb5c171")
            config_obj.set_writer_api_base_url(
                "https://api.office-integrator.com/writer/officeapi/")
            config_obj.set_sheet_api_base_url(
                "https://api.office-integrator.com/sheet/officeapi/")
            config_obj.set_show_api_base_url(
                "https://api.office-integrator.com/show/officeapi/")

            config_obj.initialize()

            # Used for demonstration only
            from controllers.RestClient import ZOIConfigUtil
            for key in ZOIConfigUtil.config_prop_dict:
                print("{0}: {1}".format(key,
                                        ZOIConfigUtil.config_prop_dict[key]))
        except ZOIException as ex:
            print(ex.status_code)
            print(ex.error_code)
            print(ex.error_message)
            print(ex.error_details)
            print(ex.error_content)
 def configure3():
     """
     Passing the configuration file
     """
     try:
         config_obj = ZOIRestClient.get_instance()
         config_obj.upload_configuration_file(
             "../configurations/AppConfiguration.json")
         config_obj.initialize()
     except ZOIException as ex:
         print(ex.status_code)
         print(ex.error_code)
         print(ex.error_message)
         print(ex.error_details)
         print(ex.error_content)
Exemple #5
0
    def configure_way3():  # Passing the configuration file
        try:
            config_obj = ZOIRestClient.get_instance()

            config_obj.upload_configuration_file(
                "configurations/AppConfiguration.json")

            config_obj.initialize()

            # Used for demonstration only
            from controllers.RestClient import ZOIConfigUtil
            for key in ZOIConfigUtil.config_prop_dict:
                print("{0}: {1}".format(key,
                                        ZOIConfigUtil.config_prop_dict[key]))
        except ZOIException as ex:
            print(ex.status_code)
            print(ex.error_code)
            print(ex.error_message)
            print(ex.error_details)
            print(ex.error_content)
 def configure1():
     """
     Using in-built Setters
     """
     try:
         config_obj = ZOIRestClient.get_instance()
         config_obj.set_apikey("2ae438cf864488657cc9754a27daa480")
         config_obj.set_writer_api_base_url(
             "https://api.office-integrator.com/writer/officeapi/")
         config_obj.set_sheet_api_base_url(
             "https://api.office-integrator.com/sheet/officeapi/")
         config_obj.set_show_api_base_url(
             "https://api.office-integrator.com/show/officeapi/")
         config_obj.initialize()
     except ZOIException as ex:
         print(ex.status_code)
         print(ex.error_code)
         print(ex.error_message)
         print(ex.error_details)
         print(ex.error_content)
 def configure2():
     """
     Passing the entire configuration as a dictionary
     """
     try:
         config_obj = ZOIRestClient.get_instance()
         user_config = {
             "apikey":
             "2ae438cf864488657cc9754a27daa480",
             "writer_api_base_url":
             "https://api.office-integrator.com/writer/officeapi/",
             "sheet_api_base_url":
             "https://api.office-integrator.com/sheet/officeapi/",
             "show_api_base_url":
             "https://api.office-integrator.com/show/officeapi/"
         }
         config_obj.initialize(user_config)
     except ZOIException as ex:
         print(ex.status_code)
         print(ex.error_code)
         print(ex.error_message)
         print(ex.error_details)
         print(ex.error_content)