using Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model; using Pilz.Networking.CloudProviders.Nextcloud.Ocs; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables { public class OcsApiTables : OcsApiBase { public static readonly OcsApiUrlPath OCS_TABLES_TABLE_ROWS = new("/apps/tables/api/1/tables/{0}/rows"); public static readonly OcsApiUrlPath OCS_TABLES_TABLE_ROWS_SIMPLE = new("/apps/tables/api/1/tables/{0}/rows/simple"); public static readonly OcsApiUrlPath OCS_TABLES_TABLE_COLUMNS = new("/apps/tables/api/1/tables/{0}/columns"); public static readonly OcsApiUrlPath OCS_TABLES_ROW = new("/apps/tables/api/1/rows/{0}"); public static readonly OcsApiUrlPath OCS_TABLES_COLUMN = new("/apps/tables/api/1/column/{0}"); public OcsApiTables(OcsApi manager) : base(manager) { } public RowsSimple? GetRowsSimple(long tableId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_TABLE_ROWS_SIMPLE.FillParameters(tableId)); } public Rows? GetRows(long tableId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_TABLE_ROWS.FillParameters(tableId)); } public Row? GetRow(long rowId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_ROW.FillParameters(rowId)); } public Columns? GetColumns(long tableId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_TABLE_COLUMNS.FillParameters(tableId)); } public Column? GetColumn(long columnId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_COLUMN.FillParameters(columnId)); } } }