internal ProcoreApiClient(HttpClient httpClient, ProcoreApiClientOptions options, ProcoreRequestUriQuerySegmentFactory querySegmentFactory, OAuthTokenExchange tokenExchange) { this.httpClient = httpClient; this.options = options; this.querySegmentFactory = querySegmentFactory; this.tokenExchange = tokenExchange; }
public ProcoreApiClient Create(ProcoreApiClientOptions options) { HttpClient httpClient = new HttpClient( handler: new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.None, }); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", options.AccessToken); httpClient.BaseAddress = this.GetBaseAddress(options.IsSandbox); return(new ProcoreApiClient( httpClient: httpClient, options: options, querySegmentFactory: new ProcoreRequestUriQuerySegmentFactory(), tokenExchange: new OAuthTokenExchange())); }
public ApiClientOptionsChangedEventArgs(ProcoreApiClientOptions options) { this.Options = options; }