Пример #1
0
 /// <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
 /// <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;
 }