Files
Pilz/Pilz.Networking.CloudProviders.Nextcloud/Client/Cloud/CloudClient.cs
2024-06-05 19:15:32 +02:00

29 lines
696 B
C#

using Pilz.Networking.CloudProviders.Nextcloud.Client.Cloud.Model;
namespace Pilz.Networking.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;
}
}