diff --git a/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/OcsApiTables.cs b/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/OcsApiTables.cs index a4cf758..4d9ef31 100644 --- a/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/OcsApiTables.cs +++ b/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/OcsApiTables.cs @@ -12,8 +12,10 @@ 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_VIEW_ROWS = new("/apps/tables/api/1/views/{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_VIEW_COLUMNS = new("/apps/tables/api/1/views/{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}"); @@ -31,6 +33,11 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_TABLE_ROWS.FillParameters(tableId)); } + public Rows? GetViewRows(long viewId) + { + return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_VIEW_ROWS.FillParameters(viewId)); + } + public Row? GetRow(long rowId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_ROW.FillParameters(rowId)); @@ -41,6 +48,11 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_TABLE_COLUMNS.FillParameters(tableId)); } + public Columns? GetViewColumns(long viewId) + { + return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_VIEW_COLUMNS.FillParameters(viewId)); + } + public Column? GetColumn(long columnId) { return Manager.MakeRequest(HttpMethod.Get, OCS_TABLES_COLUMN.FillParameters(columnId)); @@ -65,5 +77,10 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables { return Manager.MakeRequest(HttpMethod.Post, OCS_TABLES_TABLE_ROWS.FillParameters(tableId), content: values); } + + public Row? CreateViewRow(long viewId, RowUpdate values) + { + return Manager.MakeRequest(HttpMethod.Post, OCS_TABLES_VIEW_ROWS.FillParameters(viewId), content: values); + } } } diff --git a/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/TablesClient.cs b/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/TablesClient.cs index 73626ec..8d84dee 100644 --- a/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/TablesClient.cs +++ b/Pilz.Networking.CloudProviders.Nextcloud/Client/Apps/Tables/TablesClient.cs @@ -23,6 +23,11 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables return Client.Ocs.GetApi().GetRows(tableId); } + public Rows? GetViewRows(long viewId) + { + return Client.Ocs.GetApi().GetViewRows(viewId); + } + public Row? GetRow(long rowId) { return Client.Ocs.GetApi().GetRow(rowId); @@ -33,6 +38,11 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables return Client.Ocs.GetApi().GetColumns(tableId); } + public Columns? GetViewColumns(long viewId) + { + return Client.Ocs.GetApi().GetViewColumns(viewId); + } + public Column? GetColumn(long columnId) { return Client.Ocs.GetApi().GetColumn(columnId);