コード例 #1
0
 internal ProcoreApiClient(HttpClient httpClient, ProcoreApiClientOptions options, ProcoreRequestUriQuerySegmentFactory querySegmentFactory, OAuthTokenExchange tokenExchange)
 {
     this.httpClient          = httpClient;
     this.options             = options;
     this.querySegmentFactory = querySegmentFactory;
     this.tokenExchange       = tokenExchange;
 }
コード例 #2
0
        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()));
        }
コード例 #3
0
 public ApiClientOptionsChangedEventArgs(ProcoreApiClientOptions options)
 {
     this.Options = options;
 }