more work on api & rename to Pilz.Net

This commit is contained in:
Pilzinsel64
2024-08-16 06:59:39 +02:00
parent f57aef5f4f
commit 2efb4f141c
91 changed files with 299 additions and 241 deletions

View File

@@ -0,0 +1,29 @@
using Pilz.Net.CloudProviders.Nextcloud.Client;
using Pilz.Net.CloudProviders.Nextcloud.Client.Cloud.Model;
namespace Pilz.Net.CloudProviders.Nextcloud.Client.Cloud;
public class CloudClient : ClientBase
{
public CloudClient(NextcloudClient client) : base(client)
{
}
public UserInfo? GetUserInfo()
{
if (!string.IsNullOrEmpty(Client.CurrentLogin?.LoginName))
return GetUserInfo(Client.CurrentLogin.LoginName);
else
return null;
}
public UserInfo? GetUserInfo(string username)
{
var result = Client.Ocs.Cloud.GetUserMeta(username);
if (result?.Data != null)
return new UserInfo(result.Data);
return null;
}
}