Skip to content

Commit

Permalink
Polishing before v1.0.0 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kralizek authored Nov 10, 2020
1 parent 90530f5 commit 8ede25c
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 168 deletions.
24 changes: 12 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@
"version": "0.2.0",
"configurations": [
{
"name": "Raw OAuth",
"name": "HubSpot.Client - OAuth",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/samples/RawOAuth/bin/Debug/netcoreapp3.1/RawOAuth.dll",
"program": "${workspaceFolder}/samples/hubspot-client/OAuthAuthentication/bin/Debug/netcoreapp3.1/OAuthAuthentication.dll",
"args": [],
"cwd": "${workspaceFolder}/samples/RawOAuth",
"cwd": "${workspaceFolder}/samples/hubspot-client/OAuthAuthentication",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Raw ApiKey",
"name": "HubSpot.Client - ApiKey",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/samples/RawApiKey/bin/Debug/netcoreapp3.1/RawApiKey.dll",
"program": "${workspaceFolder}/samples/hubspot-client/ApiKeyAuthentication/bin/Debug/netcoreapp3.1/ApiKeyAuthentication.dll",
"args": [],
"cwd": "${workspaceFolder}/samples/RawApiKey",
"cwd": "${workspaceFolder}/samples/hubspot-client/ApiKeyAuthentication",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "OAuth",
"name": "HubSpot - OAuth",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/samples/OAuth/bin/Debug/netcoreapp3.1/OAuth.dll",
"program": "${workspaceFolder}/samples/hubspot/OAuthAuthentication/bin/Debug/netcoreapp3.1/OAuthAuthentication.dll",
"args": [],
"cwd": "${workspaceFolder}/samples/OAuth",
"cwd": "${workspaceFolder}/samples/hubspot/OAuthAuthentication",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "ApiKey",
"name": "HubSpot - ApiKey",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/samples/ApiKey/bin/Debug/netcoreapp3.1/ApiKey.dll",
"program": "${workspaceFolder}/samples/hubspot/ApiKeyAuthentication/bin/Debug/netcoreapp3.1/ApiKeyAuthentication.dll",
"args": [],
"cwd": "${workspaceFolder}/samples/ApiKey",
"cwd": "${workspaceFolder}/samples/hubspot/ApiKeyAuthentication",
"console": "internalConsole",
"stopAtEntry": false
},
Expand Down
282 changes: 139 additions & 143 deletions HubSpotSdk.sln

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ image: Visual Studio 2019
cache:
- '%LocalAppData%\NuGet\v3-cache'

skip_commits:
files:
- docs/*

nuget:
account_feed: false
project_feed: false
Expand Down
8 changes: 4 additions & 4 deletions docs/hubspot/basic-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Additional extension methods to the `IHubSpotConfigurator` type are available an

While being a higher-layer library, this library allows full access to the customization of the HubSpot client as described [earlier](../hubspot-client/configuration.md).

This can be achieved using the `AddClientConfiguration` method.
This can be achieved using the `ConfigureHubSpotClient` method.

In the snippet below, we're registering all the customizations we added earlier.

```csharp
services.AddHubSpot(hs =>
{
hs.AddClientConfiguration(client => client
hs.ConfigureHubSpotClient(client => client
.SetBaseAddress(new Uri("https://localhost.temp"))
.UseOAuthAuthentication(configuration.GetSection("HubSpot"))
.ConfigureSerialization(settings => settings.Formatting = Newtonsoft.Json.Formatting.Indented)
Expand All @@ -39,7 +39,7 @@ services.AddHubSpot(hs =>

## Authentication

Since HubSpot always require any of the two supported authentication methods, convenience methods are offered to set up the authentication method without the need of using `AddClientConfiguration`.
Since HubSpot always require any of the two supported authentication methods, convenience methods are offered to set up the authentication method without the need of using `ConfigureHubSpotClient`.

```csharp
services.AddHubSpot(hs =>
Expand All @@ -53,4 +53,4 @@ services.AddHubSpot(hs =>
});
```

The same assumptions done [earlier](../hubspot-client/configuration.md#Authentication) apply.
The same assumptions done [earlier](../hubspot-client/configuration.md#authentication) apply.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\HubSpot.Client\HubSpot.Client.csproj" />
<ProjectReference Include="..\..\..\src\HubSpot.Client\HubSpot.Client.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<PackageReference Include="Kralizek.Extensions.Configuration.Objects" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\HubSpot.Client\HubSpot.Client.csproj" />
<ProjectReference Include="..\..\..\src\HubSpot.Client\HubSpot.Client.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\HubSpot\HubSpot.csproj" />
<ProjectReference Include="..\..\..\src\HubSpot\HubSpot.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\HubSpot\HubSpot.csproj" />
<ProjectReference Include="..\..\..\src\HubSpot\HubSpot.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public class OAuthOptions
{
public string ClientId { get; set; }

public Uri RedirectUri { get; set; }
public Uri RedirectUri { get; set; } = new Uri("https://www.hubspot.com");

public string RefreshToken { get; set; }

Expand Down
7 changes: 7 additions & 0 deletions src/HubSpot/Configuration/HubSpotConfiguratorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ namespace Microsoft.Extensions.DependencyInjection
{
public static class HubSpotConfiguratorExtensions
{
public static IHubSpotConfigurator ConfigureHubSpotClient(this IHubSpotConfigurator configurator, Action<IHubSpotClientConfigurator> clientConfiguration)
{
configurator.AddClientConfiguration(clientConfiguration);

return configurator;
}

public static IHubSpotConfigurator UseContactConnector(this IHubSpotConfigurator configurator)
{
configurator.AddServiceConfiguration(services =>
Expand Down

0 comments on commit 8ede25c

Please sign in to comment.