Exemple #1
0
        private static int DeleteServiceAccount(DeleteOptions opts)
        {
            ServiceAccountServiceClient.DeleteServiceAccount(new DeleteServiceAccountRequest
            {
                Id = opts.ServiceAccountId
            });

            Console.WriteLine($"Service account with ID {opts.ServiceAccountId} deleted.");
            return(0);
        }
 /// <summary>
 ///     This deletes the service accounts created in the setup phase.
 /// </summary>
 private static void Cleanup()
 {
     Console.WriteLine("Cleaning up by deleting service accounts created during setup...");
     foreach (var id in ServiceAccountIds)
     {
         ServiceAccountServiceClient.DeleteServiceAccount(new DeleteServiceAccountRequest
         {
             Id = id
         });
     }
 }
Exemple #3
0
 public async Task <object> DeleteServiceAccount(dynamic data)
 {
     return(await Task.Run(() => {
         PlatformRefreshTokenCredential CredentialWithProvidedToken = new PlatformRefreshTokenCredential(data._RefreshToken);
         ServiceAccountServiceClient _serviceAccountServiceClient = ServiceAccountServiceClient.Create(credentials: CredentialWithProvidedToken);
         _serviceAccountServiceClient.DeleteServiceAccount(new DeleteServiceAccountRequest
         {
             Id = data._ServiceAccountID
         });
         return data._ServiceAccountID;
     }));
 }