Altairis.Fakturoid.Client.FakturoidContext.FakturoidContext C# (CSharp) Method

FakturoidContext() public method

Initializes a new instance of the FakturoidContext class.
accountName /// or /// authenticationToken /// or /// userAgent Value cannot be empty or whitespace only string.;accountName /// or /// Value cannot be empty or whitespace only string.;authenticationToken /// or /// Value cannot be empty or whitespace only string.;userAgent
public FakturoidContext ( string accountName, string emailAddress, string authenticationToken, string userAgent = DEFAULT_USER_AGENT ) : System
accountName string Account name (accountName).
emailAddress string The email address od user being authenticated.
authenticationToken string The authentication token.
userAgent string The User-Agent HTTP header value.
return System
        public FakturoidContext(string accountName, string emailAddress, string authenticationToken, string userAgent = DEFAULT_USER_AGENT)
        {
            if (accountName == null) throw new ArgumentNullException(nameof(accountName));
            if (string.IsNullOrWhiteSpace(accountName)) throw new ArgumentException("Value cannot be empty or whitespace only string.", nameof(accountName));
            if (emailAddress == null) throw new ArgumentNullException(nameof(emailAddress));
            if (string.IsNullOrWhiteSpace(emailAddress)) throw new ArgumentException("Value cannot be empty or whitespace only string.", nameof(emailAddress));
            if (authenticationToken == null) throw new ArgumentNullException(nameof(authenticationToken));
            if (string.IsNullOrWhiteSpace(authenticationToken)) throw new ArgumentException("Value cannot be empty or whitespace only string.", nameof(authenticationToken));
            if (userAgent == null) throw new ArgumentNullException(nameof(userAgent));
            if (string.IsNullOrWhiteSpace(userAgent)) throw new ArgumentException("Value cannot be empty or whitespace only string.", nameof(userAgent));

            // Configuration properties
            this.AccountName = accountName;
            this.EmailAddress = emailAddress;
            this.AuthenticationToken = authenticationToken;
            this.UserAgent = userAgent;

            // Proxies
            this.Events = new FakturoidEventsProxy(this);
            this.Todos = new FakturoidTodosProxy(this);
            this.Subjects = new FakturoidSubjectsProxy(this);
            this.Invoices = new FakturoidInvoicesProxy(this);
            this.BankAccounts = new FakturoidBankAccountsProxy(this);
        }