public static IHubSpotClientConfigurator UseApiKeyAuthentication(this IHubSpotClientConfigurator configurator, IConfiguration configuration) { configurator.AddServiceConfiguration(services => services.Configure <ApiKeyOptions>(configuration)); configurator.AddHttpClientBuilderConfiguration(builder => builder.AddHttpMessageHandler <ApiKeyHubSpotAuthenticator>()); configurator.AddServiceConfiguration(services => services.AddTransient <ApiKeyHubSpotAuthenticator>()); return(configurator); }
public static IHubSpotClientConfigurator ConfigureHttpClient(this IHubSpotClientConfigurator configurator, Action <HttpClient> httpClientConfiguration) { configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureHttpClient(httpClientConfiguration)); return(configurator); }
public static IHubSpotClientConfigurator ConfigureSerialization(this IHubSpotClientConfigurator configurator, Action <JsonSerializerSettings> serializationConfiguration) { configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureSerialization(serializationConfiguration)); return(configurator); }
public static IHubSpotClientConfigurator SetBaseAddress(this IHubSpotClientConfigurator configurator, Uri baseAddress) { configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureHttpClient(http => http.BaseAddress = baseAddress)); return(configurator); }
public static IHubSpotClientConfigurator ConfigureHttpClientBuilder(this IHubSpotClientConfigurator configurator, Action <IHttpClientBuilder> builderConfiguration) { configurator.AddHttpClientBuilderConfiguration(builderConfiguration); return(configurator); }