예제 #1
0
파일: API.cs 프로젝트: AGenius/XeroAuth2API
 /// <summary>Instantiate the API with a Configuration record already setup</summary>
 /// <param name="config">The configuration record to use <see cref="XeroConfiguration"/></param>
 public API(XeroConfiguration config = null)
 {
     if (config == null)
     {
         throw new ArgumentNullException("Missing XeroConfig");
     }
     if (config != null)
     {
         XeroConfig = config;
     }
     if (XeroConfig.AutoSelectTenant == null)
     {
         XeroConfig.AutoSelectTenant = true;
     }
     if (XeroConfig.codeVerifier == null)
     {
         XeroConfig.codeVerifier = GenerateCodeVerifier();
     }
     _authClient            = new oAuth2();
     _authClient.ParentAPI  = this;
     _authClient.XeroConfig = XeroConfig;
     // Setup the reference to the core wrapper
     AccountingApi = new Api.AccountingApi(this);
     AssetApi      = new Api.AssetApi(this);
     BankFeedsApi  = new Api.BankFeedsApi(this);
     PayrollAuApi  = new Api.PayrollAuApi(this);
     PayrollNzApi  = new Api.PayrollNzApi(this);
     PayrollUkApi  = new Api.PayrollUkApi(this);
     IdentityApi   = new Api.IdentityApi(this);
     ProjectApi    = new Api.ProjectApi(this);
     isConnected   = false;
 }
예제 #2
0
파일: API.cs 프로젝트: AGenius/XeroAuth2API
 /// <summary>Default constructor, will setup the defaults required.</summary>
 public API()
 {
     _authClient           = new oAuth2();
     _authClient.ParentAPI = this;
     //
     AccountingApi = new Api.AccountingApi(this);
     AssetApi      = new Api.AssetApi(this);
     BankFeedsApi  = new Api.BankFeedsApi(this);
     PayrollAuApi  = new Api.PayrollAuApi(this);
     PayrollNzApi  = new Api.PayrollNzApi(this);
     PayrollUkApi  = new Api.PayrollUkApi(this);
     IdentityApi   = new Api.IdentityApi(this);
     ProjectApi    = new Api.ProjectApi(this);
     isConnected   = false;
 }