File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ def get_args():
1313 "account_id" : session .get ("ds_account_id" ), # Represents your {ACCOUNT_ID}
1414 "access_token" : session .get ("ds_access_token" ), # Represents your {ACCESS_TOKEN}
1515 "clickwrap" : request .form .get ("clickwrap" ),
16+ "statuses" : ["inactive" , "draft" ]
1617 }
1718
1819 @staticmethod
@@ -28,12 +29,16 @@ def get_inactive_clickwraps(args):
2829
2930 # Step 2. Get a list of inactive clickwraps
3031 accounts_api = AccountsApi (api_client )
31- response = accounts_api .get_clickwraps (
32- account_id = args ["account_id" ],
33- status = "inactive"
34- )
35-
36- return response
32+ clickwraps = []
33+
34+ for status in args ["statuses" ]:
35+ response = accounts_api .get_clickwraps (
36+ account_id = args ["account_id" ],
37+ status = status
38+ )
39+ clickwraps += response .clickwraps
40+
41+ return {"clickwraps" : clickwraps }
3742
3843 @staticmethod
3944 def worker (args ):
Original file line number Diff line number Diff line change @@ -20,14 +20,17 @@ def worker(args):
2020 2. Create FormGroupForCreate object
2121 3. POST the form using SDK
2222 """
23+
2324 # Create an API with headers
2425 #ds-snippet-start:Rooms7Step2
2526 api_client = create_rooms_api_client (access_token = args ["access_token" ])
2627 #ds-snippet-end:Rooms7Step2
28+
2729 # Create FormGroupForCreate object
2830 #ds-snippet-start:Rooms7Step3
2931 form = FormGroupForCreate (name = args ["form_group_name" ])
3032 #ds-snippet-end:Rooms7Step3
33+
3134 # Post the form object using SDK
3235 #ds-snippet-start:Rooms7Step4
3336 form_groups_api = FormGroupsApi (api_client )
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ def test_activate_clickwrap_worker(self):
3131 args = {
3232 "account_id" : self .account_id ,
3333 "base_path" : self .base_path ,
34- "access_token" : self .access_token
34+ "access_token" : self .access_token ,
35+ "statuses" : ["inactive" , "draft" ]
3536 }
3637 results = Eg002ActivateClickwrapController .get_inactive_clickwraps (args )
37- clickwrap = results . clickwraps [0 ]
38+ clickwrap = results [ " clickwraps" ] [0 ]
3839
3940 clickwrap_args = f"{{\" clickwrap_id\" : \" { clickwrap .clickwrap_id } \" ,\" version_number\" : \" { clickwrap .version_number } \" }}"
4041 args ["clickwrap" ] = clickwrap_args
@@ -48,7 +49,8 @@ def test_activate_clickwrap_get_inactive_clickwraps(self):
4849 args = {
4950 "account_id" : self .account_id ,
5051 "base_path" : self .base_path ,
51- "access_token" : self .access_token
52+ "access_token" : self .access_token ,
53+ "statuses" : ["inactive" , "draft" ]
5254 }
5355
5456 results = Eg002ActivateClickwrapController .get_inactive_clickwraps (args )
You can’t perform that action at this time.
0 commit comments