コード例 #1
0
        internal AdPostingApiClient(Uri adPostingUri, IOAuth2TokenClient tokenClient, DelegatingHandler customMessageHandler = null)
        {
            this._ensureIndexResourceInitialised = new Lazy <Task>(() => this.InitialiseIndexResource(adPostingUri), LazyThreadSafetyMode.ExecutionAndPublication);
            this._tokenClient = tokenClient;

            HttpMessageHandler pipeline = new HttpClientHandler()
                                          // Add the custom handler as the "last" handler only if it was given
                                          .DecorateWith(customMessageHandler, customMessageHandler != null)
                                          .DecorateWith(new OAuthMessageHandler(tokenClient))
                                          .DecorateWith(new AdPostingApiMessageHandler());

            this._client = new Hal.Client(new HttpClient(pipeline));
        }
コード例 #2
0
 public OAuthMessageHandler(IOAuth2TokenClient tokenClient)
 {
     _tokenClient = tokenClient;
 }
コード例 #3
0
 internal AdPostingApiClient(Uri adPostingUri, IOAuth2TokenClient tokenClient)
 {
     this._ensureIndexResourceInitialised = new Lazy<Task>(() => this.InitialiseIndexResource(adPostingUri), LazyThreadSafetyMode.ExecutionAndPublication);
     this._tokenClient = tokenClient;
     this._client = new Hal.Client(new HttpClient(new AdPostingApiMessageHandler(new OAuthMessageHandler(tokenClient))));
 }
コード例 #4
0
 public OAuthMessageHandler(IOAuth2TokenClient tokenClient) : base(new HttpClientHandler())
 {
     _tokenClient = tokenClient;
 }
 internal AdPostingApiClient(Uri adPostingUri, IOAuth2TokenClient tokenClient)
 {
     this._ensureIndexResourceInitialised = new Lazy <Task>(() => this.InitialiseIndexResource(adPostingUri), LazyThreadSafetyMode.ExecutionAndPublication);
     this._tokenClient = tokenClient;
     this._client      = new Hal.Client(new HttpClient(new AdPostingApiMessageHandler(new OAuthMessageHandler(tokenClient))));
 }
コード例 #6
0
 public AdPostingApiClient(IOAuth2TokenClient tokenClient, Uri adPostingUri, DelegatingHandler customMessageHandler = null)
     : this(adPostingUri, tokenClient, customMessageHandler)
 {
 }
コード例 #7
0
 public OAuthMessageHandler(IOAuth2TokenClient tokenClient) : base(new HttpClientHandler())
 {
     _tokenClient = tokenClient;
 }
コード例 #8
0
 internal LogoPactAdPostingApiClient(Uri adPostingUri, IOAuth2TokenClient tokenClient) : base(adPostingUri, tokenClient)
 {
 }