| IInfrascaleSdkGetAccountInfo Method |
Returns information about signed in account.
Namespace:
SOS.SDK.Contracts
Assembly:
SOS.SDK (in SOS.SDK.dll) Version: 7.6.1.5742
Syntax Exceptions Examples using System;
using SOS.SDK.Contracts.DataContracts;
using SOS.SDK.Contracts.DataContracts.Requests;
namespace SOS.SDK.Test.Examples
{
public class AuthentificationExamples
{
private string _testAccount = @"sdk.test@sosonlinebackup.com";
private string _testAccountPassword = @"qweqwe";
private IInfrascaleClient _client;
public IdentityContract SignIn()
{
_client = new InfrascaleClient();
_client.Connect();
var signInResponse = _client.SignIn(new SignInRequest
{
Credentials = new CredentialsContract {Login = _testAccount, Password = _testAccountPassword}
});
return signInResponse.Identity;
}
public void CallExample()
{
var identity = SignIn();
GetAccountInfo(identity, false);
SignOut(identity);
_client.Disconnect();
}
public AccountInfoContract GetAccountInfo(IdentityContract identity, bool refresh)
{
var response = _client.GetAccountInfo(new GetAccountInfoRequest {Identity = identity, Refresh = refresh});
var accountInfo = response.AccountInfo;
Console.WriteLine("Login: {0}", accountInfo.Login);
Console.WriteLine("SecurityType: {0}", accountInfo.SecurityType);
Console.WriteLine("Email: {0}", accountInfo.Email);
Console.WriteLine("SendEmailReport: {0}", accountInfo.SendEmailReport);
Console.WriteLine("AccountSize: {0}", accountInfo.AccountSize);
Console.WriteLine("UsedSpace: {0}", accountInfo.UsedSpace);
Console.WriteLine("IsBackupBlockedDueToAccountOverQuota: {0}",
accountInfo.IsBackupBlockedDueToAccountOverQuota);
Console.WriteLine("CurrentBackupServerName: {0}", accountInfo.CurrentBackupServerName);
Console.WriteLine("CurrentUploadServerName: {0}", accountInfo.CurrentUploadServerName);
Console.WriteLine("EntityId: {0}", accountInfo.EntityId);
Console.WriteLine("HasConfiguredExchangeBackupset: {0}", accountInfo.HasConfiguredExchangeBackupset);
Console.WriteLine("HasConfiguredMsSqlBackupset: {0}", accountInfo.HasConfiguredMsSqlBackupset);
return response.AccountInfo;
}
public void SignOut(IdentityContract identity)
{
_client.SignOut(new SignOutRequest
{
Identity = identity
});
}
}
}
See Also