Exemplo n.º 1
0
 public static async Task <SendMessageResult> GetAsync(
     this IBackchannel client,
     string url,
     Action <IHttpRequestBuilder> configure = null)
 {
     return(await client.SendAsync(url, HttpMethod.Get, configure));
 }
Exemplo n.º 2
0
 public static async Task <SendMessageResult> PatchAsync(
     this IBackchannel backchannel,
     string url,
     Action <IHttpRequestBuilder> configure = null)
 {
     return(await backchannel.SendAsync(url, new HttpMethod("PATCH"), configure));
 }
Exemplo n.º 3
0
 public static async Task <SendMessageResult> DeleteAsync(
     this IBackchannel backchannel,
     string url,
     Action <IHttpRequestBuilder> configure = null)
 {
     return(await backchannel.SendAsync(url, HttpMethod.Delete, configure));
 }
Exemplo n.º 4
0
        public GoogleOAuthClient(
            IOptions <GoogleOAuthOptions> options,
            IBackchannelFactory backchannelFactory)
        {
            var factory = Throw.IfNull(backchannelFactory, nameof(backchannelFactory));

            this.options     = Throw.IfNull(options, nameof(options)).Value;
            this.backchannel = factory.Create();
        }
Exemplo n.º 5
0
 public ApiClient(
     IOptions <ApiOptions> options,
     IBackchannelFactory backchannelFactory,
     AuthHelper authHelper)
 {
     this.authHelper  = Throw.IfNull(authHelper, nameof(authHelper));
     this.backchannel = Throw
                        .IfNull(backchannelFactory, nameof(backchannelFactory))
                        .Create(Throw.IfNull(options, nameof(options)).Value.BaseUrl);
 }
Exemplo n.º 6
0
        public GoogleCalendarClient(
            IOptions <GoogleCalendarOptions> options,
            IBackchannelFactory backchannelFactory,
            IMapper mapper)
        {
            var factory = Throw.IfNull(backchannelFactory, nameof(backchannelFactory));
            var baseUrl = Throw.IfNull(options, nameof(options)).Value.BaseUrl;

            this.mapper      = Throw.IfNull(mapper, nameof(mapper));
            this.backchannel = factory.Create(baseUrl);
        }