示例#1
0
        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);
        }
示例#2
0
        public static IHubSpotClientConfigurator ConfigureHttpClient(this IHubSpotClientConfigurator configurator, Action <HttpClient> httpClientConfiguration)
        {
            configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureHttpClient(httpClientConfiguration));

            return(configurator);
        }
示例#3
0
        public static IHubSpotClientConfigurator ConfigureSerialization(this IHubSpotClientConfigurator configurator, Action <JsonSerializerSettings> serializationConfiguration)
        {
            configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureSerialization(serializationConfiguration));

            return(configurator);
        }
示例#4
0
        public static IHubSpotClientConfigurator SetBaseAddress(this IHubSpotClientConfigurator configurator, Uri baseAddress)
        {
            configurator.AddHttpClientBuilderConfiguration(builder => builder.ConfigureHttpClient(http => http.BaseAddress = baseAddress));

            return(configurator);
        }
示例#5
0
        public static IHubSpotClientConfigurator ConfigureHttpClientBuilder(this IHubSpotClientConfigurator configurator, Action <IHttpClientBuilder> builderConfiguration)
        {
            configurator.AddHttpClientBuilderConfiguration(builderConfiguration);

            return(configurator);
        }