Skip to content

Commit 49234d7

Browse files
1 parent 14101f4 commit 49234d7

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

ccai-insights-sample-data/generate-call-logs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ def generate_log():
121121
},
122122
{
123123
"start_timestamp_usec": timestamp + response_delay * 4,
124-
"text": "Can you give me more details about the problem with your {0}?".format(device),
124+
"text": "Can you give me more details about the problem with your {0}?".format(
125+
device
126+
),
125127
"role": "AGENT",
126128
"user_id": 2,
127129
},
@@ -133,7 +135,9 @@ def generate_log():
133135
},
134136
{
135137
"start_timestamp_usec": timestamp + response_delay * 6,
136-
"text": "And what is the status shown in the settings on the {0}?".format(device),
138+
"text": "And what is the status shown in the settings on the {0}?".format(
139+
device
140+
),
137141
"role": "AGENT",
138142
"user_id": 2,
139143
},

export-data-from-genesys/genesys.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@
44
import PureCloudPlatformClientV2
55
from PureCloudPlatformClientV2.rest import ApiException
66

7-
print('-------------------------------------------------------------')
8-
print('- Execute Bulk Action on recordings-')
9-
print('-------------------------------------------------------------')
7+
print("-------------------------------------------------------------")
8+
print("- Execute Bulk Action on recordings-")
9+
print("-------------------------------------------------------------")
1010

1111
# Credentials for the aws bucket
12-
CLIENT_ID = ''
13-
CLIENT_SECRET = ''
14-
ORG_REGION = ''
12+
CLIENT_ID = ""
13+
CLIENT_SECRET = ""
14+
ORG_REGION = ""
1515

1616
# Set environment
1717
region = PureCloudPlatformClientV2.PureCloudRegionHosts[ORG_REGION]
1818
PureCloudPlatformClientV2.configuration.host = region.get_api_host()
1919

2020
# OAuth when using Client Credentials
21-
api_client = PureCloudPlatformClientV2.api_client.ApiClient() \
22-
.get_client_credentials_token(CLIENT_ID, CLIENT_SECRET)
21+
api_client = (
22+
PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(
23+
CLIENT_ID, CLIENT_SECRET
24+
)
25+
)
2326

2427

2528
# Get the api
@@ -36,7 +39,7 @@
3639
query.conversation_query = {
3740
"interval": "2023-12-01T00:00:00.000Z/2024-01-07T00:00:00.000Z",
3841
"order": "asc",
39-
"orderBy": "conversationStart"
42+
"orderBy": "conversationStart",
4043
}
4144
print(query)
4245
try:
@@ -55,7 +58,7 @@
5558
try:
5659
get_recording_job_response = recording_api.get_recording_job(job_id)
5760
job_state = get_recording_job_response.state
58-
if job_state != 'PENDING':
61+
if job_state != "PENDING":
5962
break
6063
else:
6164
print("Job state PENDING...")
@@ -65,9 +68,11 @@
6568
sys.exit()
6669

6770

68-
if job_state == 'READY':
71+
if job_state == "READY":
6972
try:
70-
execute_job_response = recording_api.put_recording_job(job_id, {"state": "PROCESSING"})
73+
execute_job_response = recording_api.put_recording_job(
74+
job_id, {"state": "PROCESSING"}
75+
)
7176
job_state = execute_job_response.state
7277
print(f"Successfully execute recording bulk job { execute_job_response}")
7378
except ApiException as e:
@@ -79,7 +84,7 @@
7984

8085
# Call delete_recording_job api
8186
# Can be canceled also in READY and PENDING states
82-
if job_state == 'PROCESSING':
87+
if job_state == "PROCESSING":
8388
try:
8489
cancel_job_response = recording_api.delete_recording_job(job_id)
8590
print(f"Successfully cancelled recording bulk job { cancel_job_response}")
@@ -101,4 +106,3 @@
101106
except ApiException as e:
102107
print(f"Exception when calling RecordingApi->get_recording_jobs: { e }")
103108
sys.exit()
104-

0 commit comments

Comments
 (0)