private BasecampClient( Uri apiUri, IAccessTokenSource accessTokenSource, IRateLimiter rateLimiter, IResponseMessageCache responseMessageCache, string userAgent, HttpClientPool httpClientPool ) { if (apiUri == null) { throw new ArgumentNullException(nameof(apiUri)); } if (accessTokenSource == null) { throw new ArgumentNullException(nameof(accessTokenSource)); } this.apiUri = UriUtils.EnsureTrailingSlash(apiUri); this.accessTokenSource = accessTokenSource; this.rateLimiter = rateLimiter ?? ConstantRateLimiter.Default; this.responseMessageCache = responseMessageCache; this.userAgent = userAgent ?? UserAgent.GenerateDefault(); this.httpClientPool = httpClientPool ?? HttpClientPool.Default; }
public FhirApiClient( ILoggerFactory log, IAccessTokenSource managedIdentity, IHttp http, IJson json, ISettings settings) { this.log = log.CreateLogger <FhirApiClient>(); this.managedIdentity = managedIdentity; this.http = http; this.json = json; this.fhirUrl = settings.GetSetting("FHIR_SERVER_URL"); }
public BasecampClientOptions(Uri apiUri, IAccessTokenSource accessTokenSource) { if (apiUri == null) { throw new ArgumentNullException(nameof(apiUri)); } if (accessTokenSource == null) { throw new ArgumentNullException(nameof(accessTokenSource)); } ApiUri = apiUri; AccessTokenSource = accessTokenSource; }
/// <summary> /// Constructs a client for the specified account id and access token source. /// </summary> /// <param name="accountId">your basecamp account id</param> /// <param name="accessTokenSource">provides access tokens to use with the API</param> /// <exception cref="ArgumentNullException">if <paramref name="accessTokenSource"/> is null</exception> public BasecampClient(int accountId, IAccessTokenSource accessTokenSource) : this(new BasecampClientOptions(accountId, accessTokenSource)) { }
public BasecampClientOptions(int accountId, IAccessTokenSource accessTokenSource) : this(new Uri($"https://3.basecampapi.com/{accountId}/"), accessTokenSource) { }