Exemple #1
0
        public async Task <ConfigurationProfileSummary> Get(string appId, string cfgName)
        {
            var cfgProfiles = await _client.ListConfigurationProfilesAsync(new ListConfigurationProfilesRequest
            {
                ApplicationId = appId
            });

            return(cfgProfiles.Items.FirstOrDefault(x => x.Name == cfgName));
        }
Exemple #2
0
        public async Task <ConfigurationProfileSummary> AskConfigurationProfile(Application application)
        {
            var configs = await _client.ListConfigurationProfilesAsync(new ListConfigurationProfilesRequest
            {
                ApplicationId = application.Id
            });

            Console.Write($"Config name (available, {string.Join(";", configs.Items.Select(x => $"[{x.Name}]"))}): ");
            var promptedCfgProfile = Console.ReadLine();
            var cfgProfile         = configs.Items.FirstOrDefault(x => x.Name == promptedCfgProfile);

            if (cfgProfile == null)
            {
                throw new Exception($"Can't find configuration profile [{promptedCfgProfile}] for application [{application.Name}]");
            }

            return(cfgProfile);
        }