Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Sep 17, 2024
1 parent 14101f4 commit 49234d7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
8 changes: 6 additions & 2 deletions ccai-insights-sample-data/generate-call-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down
32 changes: 18 additions & 14 deletions export-data-from-genesys/genesys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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...")
Expand All @@ -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:
Expand All @@ -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}")
Expand All @@ -101,4 +106,3 @@
except ApiException as e:
print(f"Exception when calling RecordingApi->get_recording_jobs: { e }")
sys.exit()

0 comments on commit 49234d7

Please sign in to comment.