private async Task RemovePolicyIfExists(IApprendaSOCPortalApiClient client)
        {
            var policies = await client.GetResourcePolicies();

            var policy = policies.resourcePolicies.FirstOrDefault(p => p.Name == PolicyName);

            if (policy != null)
            {
                var del = await client.DeleteResourcePolicy(policy.Id);
            }
        }
Esempio n. 2
0
        private static async void DeleteIfExists(string bspName, IApprendaSOCPortalApiClient client)
        {
            try
            {
                var bsps = await client.GetBootstrapPolicies();

                var existing = bsps.FirstOrDefault(bsp => string.Equals(bsp.Name, bspName, StringComparison.CurrentCultureIgnoreCase));
                if (existing != null)
                {
                    await client.DeleteBootstrapPolicy(existing.Id);
                }
            }
            catch (Exception)
            {
            }
        }
 public SOCLogScraper(IApprendaSOCPortalApiClient client)
 {
     _client = client;
 }