DescribeApplicationVersionsAsync() public method

Initiates the asynchronous execution of the DescribeApplicationVersions operation.
public DescribeApplicationVersionsAsync ( DescribeApplicationVersionsRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.ElasticBeanstalk.Model.DescribeApplicationVersionsRequest Container for the necessary parameters to execute the DescribeApplicationVersions operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
 public async Task PurgeOldApplicationVersionsAsync()
 {
     using (var ebClient = new AmazonElasticBeanstalkClient(creds, configurationProvider.RegionEndpoint))
     {
         var describeApplicationVersionsResponse =
             await ebClient.DescribeApplicationVersionsAsync(new DescribeApplicationVersionsRequest
             {
                 ApplicationName = configurationProvider.LongApplicationName
             });
         var oldVersions = describeApplicationVersionsResponse.ApplicationVersions
             .Where(av => av.DateCreated < DateTime.UtcNow.AddDays(-7))
             .ToList();
         loggerProvider.GetLogger().Debug($"Found {oldVersions.Count} old versions to delete");
         foreach (var oldVersion in oldVersions)
         {
             var deleteApplicationVersionResponse =
                 await ebClient.DeleteApplicationVersionAsync(new DeleteApplicationVersionRequest
                 {
                     ApplicationName = oldVersion.ApplicationName,
                     VersionLabel = oldVersion.VersionLabel
                 });
             loggerProvider.GetLogger().Debug($"Deleting {oldVersion.VersionLabel} returned {deleteApplicationVersionResponse.HttpStatusCode}");
         }
     }
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="createApplicationVersionRequest"></param>
        /// <returns></returns>
        public async Task CreateOrUpdateApplicationAsync(CreateApplicationVersionRequest createApplicationVersionRequest)
        {
            using (var ebClient = new AmazonElasticBeanstalkClient(creds, configurationProvider.RegionEndpoint))
            {
                if (await IsNewApplicationAsync(ebClient))
                {
                    loggerProvider.GetLogger().Debug("New application - creating...");
                    var createApplicationRequest = new CreateApplicationRequest
                    {
                        ApplicationName = configurationProvider.LongApplicationName
                    };

                    var createApplicationResponse = await ebClient.CreateApplicationAsync(createApplicationRequest);
                    loggerProvider.GetLogger().Debug($"Created application: {createApplicationResponse}");
                }

                var describeApplicationsRequest = new DescribeApplicationVersionsRequest
                {
                    ApplicationName = configurationProvider.LongApplicationName,
                    VersionLabels = new List<string> { configurationProvider.Version }
                };

                var apps = await ebClient.DescribeApplicationVersionsAsync(describeApplicationsRequest);
                if (apps.ApplicationVersions.Any())
                {
                    loggerProvider.GetLogger().Debug("Application Version already exists");
                    return;
                }

                loggerProvider.GetLogger().Debug("Creating application version...");
                var createApplicationVersionResponse = await ebClient.CreateApplicationVersionAsync(createApplicationVersionRequest);
                loggerProvider.GetLogger().Debug($"Created application version: {createApplicationVersionResponse}");

            }
        }