public async Task <DeploymentProviderDefinition> GetDeploymentProviderDefinition(string id, Config.DeploymentTaskConfig config) { var response = await PostAsync($"managedcertificates/deploymentprovider/{id}", config); return(JsonConvert.DeserializeObject <DeploymentProviderDefinition>(await response.Content.ReadAsStringAsync())); }
/// <summary> /// Get a specific deployment task provider definition dynamically /// </summary> /// <returns></returns> public async Task <DeploymentProviderDefinition> GetDeploymentTaskProviderDefinition(string id, Config.DeploymentTaskConfig config = null) { var definition = await _certifyClient.GetDeploymentProviderDefinition(id, config); if (definition != null) { System.Windows.Application.Current.Dispatcher.Invoke(delegate { var orig = DeploymentTaskProviders.FirstOrDefault(i => i.Id == definition.Id); var index = DeploymentTaskProviders.IndexOf(orig); if (orig != null) { DeploymentTaskProviders.Remove(orig); } // replace definition in list DeploymentTaskProviders.Insert(index >= 0 ? index : 0, definition); }); } return(definition); }