@@ -343,12 +343,24 @@ def checkin(self, profile):
343343 self .login ()
344344 parts = self ._split_profile_into_parts (profile )
345345
346- self .b . my_access . checkin_by_name (
346+ ids = self ._convert_names_to_ids (
347347 profile_name = parts ['profile' ],
348348 environment_name = parts ['env' ],
349349 application_name = parts ['app' ]
350350 )
351351
352+ transaction_id = None
353+ for profile in self .b .my_access .list_checked_out_profiles ():
354+ if profile ['environmentId' ] == ids ['environment_id' ] and profile ['papId' ] == ids ['profile_id' ]:
355+ transaction_id = profile ['transactionId' ]
356+ break
357+ if not transaction_id :
358+ raise ValueError (f'no checked out profile found for the given profile' )
359+
360+ self .b .my_access .checkin (
361+ transaction_id = transaction_id
362+ )
363+
352364 def _checkout (self , profile_name , env_name , app_name , programmatic , blocktime , maxpolltime , justification ):
353365 try :
354366 self .login ()
@@ -608,10 +620,15 @@ def request_submit(self, profile, justification):
608620 self .login ()
609621 parts = self ._split_profile_into_parts (profile )
610622
611- self .b . my_access . request_approval_by_name (
623+ ids = self ._convert_names_to_ids (
612624 profile_name = parts ['profile' ],
613625 environment_name = parts ['env' ],
614- application_name = parts ['app' ],
626+ application_name = parts ['app' ]
627+ )
628+
629+ self .b .my_access .request_approval (
630+ profile_id = ids ['profile_id' ],
631+ environment_id = ids ['environment_id' ],
615632 block_until_disposition = False ,
616633 justification = justification
617634 )
@@ -620,12 +637,17 @@ def request_withdraw(self, profile):
620637 self .login ()
621638 parts = self ._split_profile_into_parts (profile )
622639
623- self .b . my_access . withdraw_approval_request_by_name (
640+ ids = self ._convert_names_to_ids (
624641 profile_name = parts ['profile' ],
625642 environment_name = parts ['env' ],
626643 application_name = parts ['app' ]
627644 )
628645
646+ self .b .my_access .withdraw_approval_request (
647+ profile_id = ids ['profile_id' ],
648+ environment_id = ids ['environment_id' ]
649+ )
650+
629651 def clear_gcloud_auth_key_files (self ):
630652 self .config .clear_gcloud_auth_key_files ()
631653
0 commit comments