diff --git a/ccai-insights-sample-data/generate-call-logs.py b/ccai-insights-sample-data/generate-call-logs.py index 65d6bcfa..ad15a857 100644 --- a/ccai-insights-sample-data/generate-call-logs.py +++ b/ccai-insights-sample-data/generate-call-logs.py @@ -121,7 +121,9 @@ def generate_log(): }, { "start_timestamp_usec": timestamp + response_delay * 4, - "text": "Can you give me more details about the problem with your {0}?".format(device), + "text": "Can you give me more details about the problem with your {0}?".format( + device + ), "role": "AGENT", "user_id": 2, }, @@ -133,7 +135,9 @@ def generate_log(): }, { "start_timestamp_usec": timestamp + response_delay * 6, - "text": "And what is the status shown in the settings on the {0}?".format(device), + "text": "And what is the status shown in the settings on the {0}?".format( + device + ), "role": "AGENT", "user_id": 2, }, diff --git a/export-data-from-genesys/genesys.py b/export-data-from-genesys/genesys.py index 9eefa3fc..1c765fa6 100644 --- a/export-data-from-genesys/genesys.py +++ b/export-data-from-genesys/genesys.py @@ -4,22 +4,25 @@ import PureCloudPlatformClientV2 from PureCloudPlatformClientV2.rest import ApiException -print('-------------------------------------------------------------') -print('- Execute Bulk Action on recordings-') -print('-------------------------------------------------------------') +print("-------------------------------------------------------------") +print("- Execute Bulk Action on recordings-") +print("-------------------------------------------------------------") # Credentials for the aws bucket -CLIENT_ID = '' -CLIENT_SECRET = '' -ORG_REGION = '' +CLIENT_ID = "" +CLIENT_SECRET = "" +ORG_REGION = "" # Set environment region = PureCloudPlatformClientV2.PureCloudRegionHosts[ORG_REGION] PureCloudPlatformClientV2.configuration.host = region.get_api_host() # OAuth when using Client Credentials -api_client = PureCloudPlatformClientV2.api_client.ApiClient() \ - .get_client_credentials_token(CLIENT_ID, CLIENT_SECRET) +api_client = ( + PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token( + CLIENT_ID, CLIENT_SECRET + ) +) # Get the api @@ -36,7 +39,7 @@ query.conversation_query = { "interval": "2023-12-01T00:00:00.000Z/2024-01-07T00:00:00.000Z", "order": "asc", - "orderBy": "conversationStart" + "orderBy": "conversationStart", } print(query) try: @@ -55,7 +58,7 @@ try: get_recording_job_response = recording_api.get_recording_job(job_id) job_state = get_recording_job_response.state - if job_state != 'PENDING': + if job_state != "PENDING": break else: print("Job state PENDING...") @@ -65,9 +68,11 @@ sys.exit() -if job_state == 'READY': +if job_state == "READY": try: - execute_job_response = recording_api.put_recording_job(job_id, {"state": "PROCESSING"}) + execute_job_response = recording_api.put_recording_job( + job_id, {"state": "PROCESSING"} + ) job_state = execute_job_response.state print(f"Successfully execute recording bulk job { execute_job_response}") except ApiException as e: @@ -79,7 +84,7 @@ # Call delete_recording_job api # Can be canceled also in READY and PENDING states -if job_state == 'PROCESSING': +if job_state == "PROCESSING": try: cancel_job_response = recording_api.delete_recording_job(job_id) print(f"Successfully cancelled recording bulk job { cancel_job_response}") @@ -101,4 +106,3 @@ except ApiException as e: print(f"Exception when calling RecordingApi->get_recording_jobs: { e }") sys.exit() -