def to_json()

in datahub/models/connector.py [0:0]


    def to_json(self):
        data = {
            "Project": self._project_name,
            "Table": self._table_name,
            "OdpsEndpoint": self._odps_endpoint,
            "TunnelEndpoint": self._tunnel_endpoint
        }
        if self._access_id:
            data["AccessId"] = self._access_id
        if self._access_key:
            data["AccessKey"] = self._access_key
        if self._partition_mode:
            data['PartitionMode'] = self._partition_mode.value
        if self._time_range and self._time_range > 0:
            data['TimeRange'] = self._time_range
        if self._partition_config:
            data['PartitionConfig'] = self._partition_config
        return data