Skip to content

Commit

Permalink
(fix): generate Environments.cs to populate base url
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] authored May 22, 2024
1 parent 0b1cf82 commit a763531
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/SchematicHQ.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{EE8E0485-C844-4D5A-A5CB-F2805679CCFD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{73411664-7CAE-4BBC-850D-C9034D971A09}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{3F0DC5BA-F8CF-4D81-85F8-284C421A69DC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{B827DD04-2419-47AF-B5BB-AF9BB3225EB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE8E0485-C844-4D5A-A5CB-F2805679CCFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE8E0485-C844-4D5A-A5CB-F2805679CCFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE8E0485-C844-4D5A-A5CB-F2805679CCFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE8E0485-C844-4D5A-A5CB-F2805679CCFD}.Release|Any CPU.Build.0 = Release|Any CPU
{3F0DC5BA-F8CF-4D81-85F8-284C421A69DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F0DC5BA-F8CF-4D81-85F8-284C421A69DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F0DC5BA-F8CF-4D81-85F8-284C421A69DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F0DC5BA-F8CF-4D81-85F8-284C421A69DC}.Release|Any CPU.Build.0 = Release|Any CPU
{73411664-7CAE-4BBC-850D-C9034D971A09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73411664-7CAE-4BBC-850D-C9034D971A09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73411664-7CAE-4BBC-850D-C9034D971A09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73411664-7CAE-4BBC-850D-C9034D971A09}.Release|Any CPU.Build.0 = Release|Any CPU
{B827DD04-2419-47AF-B5BB-AF9BB3225EB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B827DD04-2419-47AF-B5BB-AF9BB3225EB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B827DD04-2419-47AF-B5BB-AF9BB3225EB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B827DD04-2419-47AF-B5BB-AF9BB3225EB5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 3 additions & 1 deletion src/SchematicHQ.Client/Core/ClientOptions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using SchematicHQ.Client.Core;

namespace SchematicHQ.Client;

public partial class ClientOptions
{
/// <summary>
/// The Base URL for the API.
/// </summary>
public string? BaseUrl { get; init; }
public string BaseUrl { get; init; } = Environments.DEFAULT;

/// <summary>
/// The http client used to make requests.
Expand Down
6 changes: 6 additions & 0 deletions src/SchematicHQ.Client/Core/Environments.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace SchematicHQ.Client.Core;

public class Environments
{
public static string DEFAULT = "https://api.schematichq.com";
}
2 changes: 1 addition & 1 deletion src/SchematicHQ.Client/Core/RawClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private Dictionary<string, string> GetHeaders(ApiRequest request)

private string BuildUrl(string path, Dictionary<string, object> query)
{
var url = $"{_clientOptions.BaseUrl}/{path}";
var url = $"{_clientOptions.BaseUrl}{path}";
if (query.Count > 0)
{
url += "?";
Expand Down
2 changes: 1 addition & 1 deletion src/SchematicHQ.Client/Schematic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public Schematic(string apiKey = null, ClientOptions clientOptions = null)
{ "X-Schematic-Api-Key", apiKey },
{ "X-Fern-Language", "C#" },
{ "X-Fern-SDK-Name", "schematic_fern_api_sdk" },
{ "X-Fern-SDK-Version", "0.0.10" },
{ "X-Fern-SDK-Version", "0.0.11" },
},
clientOptions ?? new ClientOptions()
);
Expand Down
11 changes: 9 additions & 2 deletions src/SchematicHQ.Client/SchematicHQ.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<NuGetAudit>false</NuGetAudit>
<Version>0.0.10</Version>
<Version>0.0.11</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/schematichq/schematic-csharp</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="OneOf" Version="3.0.263" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
</ItemGroup>

</Project>
</Project>

0 comments on commit a763531

Please sign in to comment.