public GetAddesssApi(ApiKey apiKey, AdminKey adminKey, HttpClient httpClient = null) { _client = httpClient ?? new HttpClient { BaseAddress = _baseAddress }; _client.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); AdminKey = adminKey; ApiKey = apiKey; DomainWhitelist = new DomainWhitelistApi(AdminKey, this); IpAddressWhitelist = new IpAddressWhitelistApi(AdminKey, this); PrivateAddress = new PrivateAddressApi(AdminKey, this); Usage = new UsageApi(AdminKey, this); BillingAddress = new BillingAddressApi(AdminKey, this); Address = new AddressApi(ApiKey, this); FirstLimitReachedWebhook = new FirstLimitReachedWebhookApi(AdminKey, this); Subscription = new SubscriptionApi(adminKey, this); ApiKeyApi = new ApiKeyApi(adminKey, this); }
public GetAddesssApi(ApiKey apiKey, AdminKey adminKey, HttpClient httpClient = null) { _client = httpClient ?? GetHttpClient(_baseAddress); if (_client.BaseAddress == null) { _client.BaseAddress = _baseAddress; } AdminKey = adminKey; ApiKey = apiKey; domainWhitelist = new Lazy <DomainWhitelistApi>(() => new DomainWhitelistApi(adminKey, this)); ipAddressWhitelist = new Lazy <IpAddressWhitelistApi>(() => new IpAddressWhitelistApi(adminKey, this)); privateAddress = new Lazy <PrivateAddressApi>(() => new PrivateAddressApi(adminKey, this)); usage = new Lazy <UsageApi>(() => new UsageApi(adminKey, this)); billingAddress = new Lazy <BillingAddressApi>(() => new BillingAddressApi(adminKey, this)); address = new Lazy <AddressApi>(() => new AddressApi(apiKey, this)); firstLimitReachedWebhook = new Lazy <FirstLimitReachedWebhookApi>(() => new FirstLimitReachedWebhookApi(adminKey, this)); secondLimitReachedWebhook = new Lazy <SecondLimitReachedWebhookApi>(() => new SecondLimitReachedWebhookApi(adminKey, this)); paymentFailedWebhook = new Lazy <PaymentFailedWebhookApi>(() => new PaymentFailedWebhookApi(adminKey, this)); expiredWebhook = new Lazy <ExpiredWebhookApi>(() => new ExpiredWebhookApi(adminKey, this)); subscription = new Lazy <SubscriptionApi>(() => new SubscriptionApi(adminKey, this)); apiKeyApi = new Lazy <ApiKeyApi>(() => new ApiKeyApi(adminKey, this)); emailAddress = new Lazy <EmailAddressApi>(() => new EmailAddressApi(adminKey, this)); invoices = new Lazy <InvoiceApi>(() => new InvoiceApi(adminKey, this)); invoiceCC = new Lazy <InvoiceCCApi>(() => new InvoiceCCApi(adminKey, this)); distance = new Lazy <DistanceApi>(() => new DistanceApi(apiKey, this)); expiredCC = new Lazy <ExpiredCCApi>(() => new ExpiredCCApi(adminKey, this)); permission = new Lazy <PermissionApi>(() => new PermissionApi(adminKey, this)); autocomplete = new Lazy <AutocompleteApi>(() => new AutocompleteApi(apiKey, this)); }
public GetAddesssApi(AdminKey adminKey, HttpClient httpClient = null) : this(new ApiKey(string.Empty), adminKey, httpClient) { }