How to use the bingads.util._TimeHelper.get_current_time_milliseconds function in bingads

To help you get started, we’ve selected a few bingads examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BingAds / BingAds-Python-SDK / bingads / v10 / bulk / bulk_service_manager.py View on Github external
def upload_file(self, file_upload_parameters, progress=None):
        """ Uploads the specified Bulk file.

        :param file_upload_parameters: Determines various upload parameters.
        :type file_upload_parameters: FileUploadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The download local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        file_upload_parameters._submit_upload_parameters.timeout_in_milliseconds = file_upload_parameters.timeout_in_milliseconds
        operation = self.submit_upload(file_upload_parameters._submit_upload_parameters)
        upload_operation_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        try:
            operation.track(progress, upload_operation_timeout)
        except TimeoutException:
            raise BulkUploadException("Bulk file upload tracking status timeout.")
        result_file_directory = self.working_directory
        if file_upload_parameters.result_file_directory is not None:
            result_file_directory = file_upload_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=file_upload_parameters.result_file_name,
            decompress=file_upload_parameters.decompress_result_file,
            overwrite=file_upload_parameters.overwrite_result_file,
github BingAds / BingAds-Python-SDK / bingads / v13 / bulk / bulk_service_manager.py View on Github external
def download_upload_result(self, operation, file_upload_parameters, progress=None):
        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        upload_operation_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        try:
            operation.track(progress, upload_operation_timeout)
        except TimeoutException:
            raise BulkUploadException("Bulk file upload tracking status timeout.")
        result_file_directory = self.working_directory
        if file_upload_parameters.result_file_directory is not None:
            result_file_directory = file_upload_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=file_upload_parameters.result_file_name,
            decompress=file_upload_parameters.decompress_result_file,
            overwrite=file_upload_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )
github BingAds / BingAds-Python-SDK / bingads / v11 / bulk / bulk_service_manager.py View on Github external
def download_file(self, download_parameters, progress=None):
        """ Downloads the specified Bulk entities to a local file.

        :param download_parameters: Determines various download parameters, for example where the file should be downloaded.
        :type download_parameters: DownloadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The downloaded local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        operation = self.submit_download(download_parameters._submit_download_parameter)
        try:
            operation.track(progress, download_parameters.timeout_in_milliseconds)
        except TimeoutException:
            raise BulkDownloadException("Bulk file download tracking status timeout.")
        result_file_directory = self.working_directory
        if download_parameters.result_file_directory is not None:
            result_file_directory = download_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, download_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=download_parameters.result_file_name,
            decompress=download_parameters.decompress_result_file,
            overwrite=download_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )
github BingAds / BingAds-Python-SDK / bingads / bulk / bulk_service_manager.py View on Github external
def upload_file(self, file_upload_parameters, progress=None):
        """ Uploads the specified Bulk file.

        :param file_upload_parameters: Determines various upload parameters.
        :type file_upload_parameters: FileUploadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The download local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        file_upload_parameters._submit_upload_parameters.timeout_in_milliseconds = file_upload_parameters.timeout_in_milliseconds
        operation = self.submit_upload(file_upload_parameters._submit_upload_parameters)
        upload_operation_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        try:
            operation.track(progress, upload_operation_timeout)
        except TimeoutException:
            raise BulkUploadException("Bulk file upload tracking status timeout.")
        result_file_directory = self.working_directory
        if file_upload_parameters.result_file_directory is not None:
            result_file_directory = file_upload_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=file_upload_parameters.result_file_name,
            decompress=file_upload_parameters.decompress_result_file,
            overwrite=file_upload_parameters.overwrite_result_file,
github BingAds / BingAds-Python-SDK / bingads / v12 / bulk / bulk_service_manager.py View on Github external
def upload_file(self, file_upload_parameters, progress=None):
        """ Uploads the specified Bulk file.

        :param file_upload_parameters: Determines various upload parameters.
        :type file_upload_parameters: FileUploadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The download local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        file_upload_parameters._submit_upload_parameters.timeout_in_milliseconds = file_upload_parameters.timeout_in_milliseconds
        operation = self.submit_upload(file_upload_parameters._submit_upload_parameters)
        upload_operation_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        try:
            operation.track(progress, upload_operation_timeout)
        except TimeoutException:
            raise BulkUploadException("Bulk file upload tracking status timeout.")
        result_file_directory = self.working_directory
        if file_upload_parameters.result_file_directory is not None:
            result_file_directory = file_upload_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, file_upload_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=file_upload_parameters.result_file_name,
            decompress=file_upload_parameters.decompress_result_file,
            overwrite=file_upload_parameters.overwrite_result_file,
github BingAds / BingAds-Python-SDK / bingads / v12 / reporting / reporting_service_manager.py View on Github external
def download_file(self, download_parameters):
        """ Downloads the specified reporting to a local file.

        :param download_parameters: Determines various download parameters, for example where the file should be downloaded.
        :type download_parameters: ReportingDownloadParameters
        :return: The downloaded local reporting file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        operation = self.submit_download(download_parameters.report_request)
        try:
            operation.track(download_parameters.timeout_in_milliseconds)
        except TimeoutException:
            raise ReportingDownloadException("Reporting file download tracking status timeout.")
        result_file_directory = self.working_directory
        if download_parameters.result_file_directory is not None:
            result_file_directory = download_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, download_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=download_parameters.result_file_name,
            decompress=download_parameters.decompress_result_file,
            overwrite=download_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )
github BingAds / BingAds-Python-SDK / bingads / bulk / bulk_service_manager.py View on Github external
def download_file(self, download_parameters, progress=None):
        """ Downloads the specified Bulk entities to a local file.

        :param download_parameters: Determines various download parameters, for example where the file should be downloaded.
        :type download_parameters: DownloadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The downloaded local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        operation = self.submit_download(download_parameters._submit_download_parameter)
        try:
            operation.track(progress, download_parameters.timeout_in_milliseconds)
        except TimeoutException:
            raise BulkDownloadException("Bulk file download tracking status timeout.")
        result_file_directory = self.working_directory
        if download_parameters.result_file_directory is not None:
            result_file_directory = download_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, download_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=download_parameters.result_file_name,
            decompress=download_parameters.decompress_result_file,
            overwrite=download_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )
github BingAds / BingAds-Python-SDK / bingads / reporting / reporting_service_manager.py View on Github external
def download_file(self, download_parameters):
        """ Downloads the specified reporting to a local file.

        :param download_parameters: Determines various download parameters, for example where the file should be downloaded.
        :type download_parameters: ReportingDownloadParameters
        :return: The downloaded local reporting file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        operation = self.submit_download(download_parameters.report_request)
        try:
            operation.track(download_parameters.timeout_in_milliseconds)
        except TimeoutException:
            raise ReportingDownloadException("Reporting file download tracking status timeout.")
        result_file_directory = self.working_directory
        if download_parameters.result_file_directory is not None:
            result_file_directory = download_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, download_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=download_parameters.result_file_name,
            decompress=download_parameters.decompress_result_file,
            overwrite=download_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )
github BingAds / BingAds-Python-SDK / bingads / v12 / bulk / bulk_service_manager.py View on Github external
def download_file(self, download_parameters, progress=None):
        """ Downloads the specified Bulk entities to a local file.

        :param download_parameters: Determines various download parameters, for example where the file should be downloaded.
        :type download_parameters: DownloadParameters
        :param progress: (optional) Tracking the percent complete progress information for the bulk operation.
        :type progress: BulkOperationProgressInfo -> None
        :return: The downloaded local bulk file path.
        :rtype: str
        """

        start_timestamp = _TimeHelper.get_current_time_milliseconds()
        operation = self.submit_download(download_parameters._submit_download_parameter)
        try:
            operation.track(progress, download_parameters.timeout_in_milliseconds)
        except TimeoutException:
            raise BulkDownloadException("Bulk file download tracking status timeout.")
        result_file_directory = self.working_directory
        if download_parameters.result_file_directory is not None:
            result_file_directory = download_parameters.result_file_directory
        download_result_file_timeout = _TimeHelper.get_remaining_time_milliseconds_with_min_value(start_timestamp, download_parameters.timeout_in_milliseconds)
        result_file_path = operation.download_result_file(
            result_file_directory=result_file_directory,
            result_file_name=download_parameters.result_file_name,
            decompress=download_parameters.decompress_result_file,
            overwrite=download_parameters.overwrite_result_file,
            timeout_in_milliseconds=download_result_file_timeout,
        )