Ejemplo n.º 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));
        }
 public OAuthMessageHandler(IOAuth2TokenClient tokenClient)
 {
     _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))));
 }
 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))));
 }
Ejemplo n.º 6
0
 public AdPostingApiClient(IOAuth2TokenClient tokenClient, Uri adPostingUri, DelegatingHandler customMessageHandler = null)
     : this(adPostingUri, tokenClient, customMessageHandler)
 {
 }
Ejemplo n.º 7
0
 public OAuthMessageHandler(IOAuth2TokenClient tokenClient) : base(new HttpClientHandler())
 {
     _tokenClient = tokenClient;
 }
Ejemplo n.º 8
0
 internal LogoPactAdPostingApiClient(Uri adPostingUri, IOAuth2TokenClient tokenClient) : base(adPostingUri, tokenClient)
 {
 }