コード例 #1
0
    def get_settings(environment,
                     settings_file,
                     connector_id,
                     powerapps_url,
                     powerapps_version,
                     api_properties,
                     api_definition,
                     icon,
                     client_id=None,
                     tenant=None,
                     authority_url=None,
                     resource=None):
        """
        Loads settings into a settings object.
        """

        # Load from settings file if it is available
        if settings_file:
            settings = SettingsSerializer.from_json(settings_file)
        else:
            settings = Settings(connector_id=connector_id,
                                environment=environment,
                                powerapps_url=powerapps_url,
                                powerapps_api_version=powerapps_version,
                                api_properties=api_properties,
                                api_definition=api_definition,
                                icon=icon,
                                client_id=client_id,
                                tenant=tenant,
                                authority_url=authority_url,
                                resource=resource)
        return settings
コード例 #2
0
    def deserialize(settings_dict):
        """
        Deserializes a dictionary to a settings object
        """
        settings = Settings(
            # Connector sepecific settings
            connector_id=settings_dict.get(_CONNECTOR_ID, None),
            environment=settings_dict.get(_ENVIRONMENT, None),

            # Files
            api_properties=settings_dict.get(_API_PROPERTIES, None),
            api_definition=settings_dict.get(_API_DEFINITION, None),
            icon=settings_dict.get(_ICON, None),

            # PowerApps RP settings
            powerapps_url=settings_dict.get(_POWERAPPS_URL, None),
            powerapps_api_version=settings_dict.get(_POWERAPPS_API_VERSION,
                                                    None),
            # powerapps_base_path IGNORED

            # Flow RP Settings
            flow_url=settings_dict.get(_FLOW_URL, None),
            flow_api_version=settings_dict.get(_FLOW_API_VERSION, None)
            # flow_base_path IGNORED
        )
        return settings
コード例 #3
0
    def deserialize(settings_dict):
        """
        Deserializes a dictionary to a settings object
        """
        settings = Settings(
            # Connector sepecific settings
            connector_id=settings_dict.get(_CONNECTOR_ID, None),
            environment=settings_dict.get(_ENVIRONMENT, None),

            # Files
            api_properties=settings_dict.get(_API_PROPERTIES, None),
            api_definition=settings_dict.get(_API_DEFINITION, None),
            icon=settings_dict.get(_ICON, None),

            # PowerApps RP settings
            powerapps_url=settings_dict.get(_POWERAPPS_URL, None),
            powerapps_api_version=settings_dict.get(_POWERAPPS_API_VERSION,
                                                    None),
            # powerapps_base_path IGNORED

            # Flow RP Settings
            flow_url=settings_dict.get(_FLOW_URL, None),
            flow_api_version=settings_dict.get(_FLOW_API_VERSION, None),
            # flow_base_path IGNORED

            # Authentication Settings
            client_id=settings_dict.get(_CLIENT_ID, None),
            tenant=settings_dict.get(_TENANT, None),
            authority_url=settings_dict.get(_AUTHORITY_URL, None),
            resource=settings_dict.get(_RESOURCE, None))
        return settings
コード例 #4
0
    def get_settings(environment, settings_file, connector_id, powerapps_url,
                     powerapps_version, command_context, api_properties,
                     api_definition, icon):
        """
        Loads settings into a settings object.
        """

        # Load from settings file if it is available
        if settings_file:
            settings = SettingsSerializer.from_json(settings_file)
        else:
            settings = Settings(connector_id=connector_id,
                                environment=environment,
                                powerapps_url=powerapps_url,
                                powerapps_api_version=powerapps_version,
                                api_properties=api_properties,
                                api_definition=api_definition,
                                icon=icon)
        return settings