private async static Task QueryDatasets() { var dataClient = new DatasetsClient(pbi); var datasets = await dataClient.List(); foreach (var dataset in datasets.value) { Console.WriteLine("{0}\t{1}", dataset.name, dataset.id); } Console.WriteLine("Create a data set?"); Dataset created; if (Console.ReadKey().KeyChar == 'Y') { created = await dataClient.Create <resourceMeasures>("resourceManager", true); } else { created = (await dataClient.List()).value.First(ds => ds.name == "resourceManager"); } var tables = await dataClient.ListTables(created.id); ListTables(tables); //var table = dataClient.GetTable(created.id, tables.value.First().name); //ListColumns(table.columns); var table = await dataClient.UpdateTableSchema <resourceMeasures2>(created.id, tables.value.First().name); }
//Groups: The Update Table Schema operation updates a Table schema in a Dataset in a Group. //PUT https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/tables/{table_name} //Update Table Schema operation: https://msdn.microsoft.com/en-US/library/mt203560.aspx static void UpdateTableSchema(string groupId, string datasetId, string tableName) { var datasetsClient = new DatasetsClient(pbi); datasetsClient.UpdateTableSchema<Product2>(groupId, datasetId, tableName); }
private async static Task QueryDatasets() { var dataClient = new DatasetsClient(pbi); var datasets = await dataClient.List(); foreach (var dataset in datasets.value) { Console.WriteLine("{0}\t{1}", dataset.name, dataset.id); } Console.WriteLine("Create a data set?"); Dataset created; if (Console.ReadKey().KeyChar == 'Y') { created = await dataClient.Create<resourceMeasures>("resourceManager", true); } else { created = (await dataClient.List()).value.First(ds => ds.name == "resourceManager"); } var tables = await dataClient.ListTables(created.id); ListTables(tables); //var table = dataClient.GetTable(created.id, tables.value.First().name); //ListColumns(table.columns); var table = await dataClient.UpdateTableSchema<resourceMeasures2>(created.id, tables.value.First().name); }
//Groups: The Update Table Schema operation updates a Table schema in a Dataset in a Group. //PUT https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/tables/{table_name} //Update Table Schema operation: https://msdn.microsoft.com/en-US/library/mt203560.aspx static void UpdateTableSchema(string groupId, string datasetId, string tableName) { var datasetsClient = new DatasetsClient(pbi); datasetsClient.UpdateTableSchema <Product2>(groupId, datasetId, tableName); }