forked from nicocrm/IntacctClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntacctUserCredential.cs
30 lines (25 loc) · 1.1 KB
/
IntacctUserCredential.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Net;
namespace Intacct
{
public class IntacctUserCredential : NetworkCredential
{
public string CompanyId { get; }
public string ChildCompanyId { get; }
public ChildCompanyType? ChildCompanyType { get; }
public IntacctUserCredential(string companyId, string userName, string password) : this(companyId, userName, password, null, null)
{
}
public IntacctUserCredential(string companyId, string userName, string password, string childCompanyId, ChildCompanyType childCompanyType) : this(companyId, userName, password, childCompanyId, (ChildCompanyType?) childCompanyType)
{
}
private IntacctUserCredential(string companyId, string userName, string password, string childCompanyId = null, ChildCompanyType? childCompanyType = null) : base(userName, password)
{
if (companyId == null) throw new ArgumentNullException(nameof(companyId));
if (childCompanyId != null && childCompanyType == null) throw new ArgumentNullException(nameof(childCompanyType));
CompanyId = companyId;
ChildCompanyId = childCompanyId;
ChildCompanyType = childCompanyType;
}
}
}