finish tables api
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables.Model
|
||||
{
|
||||
public class RowUpdate
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public Dictionary<long, object> Data { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Pilz.Networking.CloudProviders.Nextcloud.Ocs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -54,5 +55,15 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
{
|
||||
return Manager.MakeRequest<Column>(HttpMethod.Delete, OCS_TABLES_COLUMN.FillParameters(columnId));
|
||||
}
|
||||
|
||||
public Row? UpdateRow(long rowId, RowUpdate values)
|
||||
{
|
||||
return Manager.MakeRequest<Row>(HttpMethod.Put, OCS_TABLES_ROW.FillParameters(rowId), content: values);
|
||||
}
|
||||
|
||||
public Row? CreateRow(long tableId, RowUpdate values)
|
||||
{
|
||||
return Manager.MakeRequest<Row>(HttpMethod.Post, OCS_TABLES_TABLE_ROWS.FillParameters(tableId), content: values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,5 +57,15 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client.Apps.Tables
|
||||
{
|
||||
return Client.Ocs.GetApi<OcsApiTables>().DeleteColumn(columnId);
|
||||
}
|
||||
|
||||
public Row? UpdateRow(long rowId, RowUpdate values)
|
||||
{
|
||||
return Client.Ocs.GetApi<OcsApiTables>().UpdateRow(rowId, values);
|
||||
}
|
||||
|
||||
public Row? CreateRow(long tableId, RowUpdate values)
|
||||
{
|
||||
return Client.Ocs.GetApi<OcsApiTables>().CreateRow(tableId, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Client
|
||||
{
|
||||
protected NextcloudClient Client { get; init; }
|
||||
|
||||
public ClientBase(NextcloudClient client)
|
||||
protected ClientBase(NextcloudClient client)
|
||||
{
|
||||
Client = client;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user