Skip to content

Commit f12cc16

Browse files
Mei HsiehMei Hsieh
authored andcommitted
DEVDOCS-10223 add codeDepot markers
1 parent 2caf120 commit f12cc16

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/admin/examples/eg003_bulk_export_user_data.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def worker(cls):
2727
export_api = BulkExportsApi(api_client=api_client)
2828

2929
# Create a user list export request
30-
# Step 3 start
30+
#ds-snippet-start:Admin3Step3
3131
response = export_api.create_user_list_export(
3232
organization_id,
3333
{
3434
"type": "organization_memberships_export"
3535
}
3636
)
37-
# Step 3 end
37+
#ds-snippet-end:Admin3Step3
3838

3939
# Save user_list_export_id in a client session
4040
session['user_list_export_id'] = response.id
@@ -57,22 +57,22 @@ def get_csv_user_list(cls):
5757

5858
organization_id = get_organization_id()
5959

60-
# Step 2 start
60+
#ds-snippet-start:Admin3Step2
6161
api_client = create_admin_api_client(
6262
access_token=session["ds_access_token"]
6363
)
6464

6565
# Create the export API object
6666
export_api = BulkExportsApi(api_client=api_client)
67-
# Step 2 end
67+
#ds-snippet-end:Admin3Step2
6868

6969
# Getting the user list export response
70-
# Step 4 start
70+
#ds-snippet-start:Admin3Step4
7171
response = export_api.get_user_list_export(
7272
organization_id,
7373
session['user_list_export_id']
7474
)
75-
# Step 4 end
75+
#ds-snippet-end:Admin3Step4
7676

7777
# Trying to get the user list export id
7878
try:
@@ -81,7 +81,7 @@ def get_csv_user_list(cls):
8181
return None
8282

8383
# Create the API client object
84-
# Step 5 start
84+
#ds-snippet-start:Admin3Step5
8585
api_client = ApiClient()
8686

8787
# Add headers to the API client object and the desired URL
@@ -93,7 +93,7 @@ def get_csv_user_list(cls):
9393

9494
# Getting a response containing a csv file
9595
response = api_client.request("GET", url, headers=headers)
96-
# Step 5 end
96+
#ds-snippet-end:Admin3Step5
9797

9898
# Returns the csv file
9999
return response.data.decode("UTF8")

0 commit comments

Comments
 (0)