Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- January 20, 2025 #34

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SchematicHQ.Client.Test/Core/EnumSerializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void ShouldSerializeKnownEnumValue2()
new DummyObject { EnumProperty = KnownEnumValue2 },
JsonOptions
);
TestContext.WriteLine("Serialized JSON: \n" + json);
TestContext.Out.WriteLine("Serialized JSON: \n" + json);
var enumString = json.GetProperty("enum_property").GetString();
Assert.That(enumString, Is.Not.Null);
Assert.That(enumString, Is.EqualTo(KnownEnumValue2String));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
Configure additional MSBuild properties for your project in this file:
- Step 1: Add this file to your .fernignore file to ensure it is not overwritten.
- Step 2: Modify this file to your liking.
-->
<Project>
</Project>
21 changes: 14 additions & 7 deletions src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0"/>
<PackageReference Include="NUnit" Version="3.13.3"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2"/>
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
<PackageReference Include="coverlet.collector" Version="3.2.0"/>
<PackageReference Include="WireMock.Net" Version="1.5.60" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="NUnit" Version="4.2.2"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0"/>
<PackageReference Include="NUnit.Analyzers" Version="4.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="WireMock.Net" Version="1.6.8" />
<PackageReference Include="FluentAssertions.Json" Version="6.1.0" />
</ItemGroup>

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

<Import Project="SchematicHQ.Client.Test.Custom.props" Condition="Exists('SchematicHQ.Client.Test.Custom.props')" />
</Project>
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", "{603CB046-0244-4360-AD5F-EB0417530A9C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{C7897C78-B2CF-41F1-8A88-ADD58148B4CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{6DACA18E-F6B2-41D3-9FB8-C082057ED882}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{F15D4EF4-BEA7-404C-9599-ECCE91902E80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{603CB046-0244-4360-AD5F-EB0417530A9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{603CB046-0244-4360-AD5F-EB0417530A9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{603CB046-0244-4360-AD5F-EB0417530A9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{603CB046-0244-4360-AD5F-EB0417530A9C}.Release|Any CPU.Build.0 = Release|Any CPU
{6DACA18E-F6B2-41D3-9FB8-C082057ED882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DACA18E-F6B2-41D3-9FB8-C082057ED882}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DACA18E-F6B2-41D3-9FB8-C082057ED882}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DACA18E-F6B2-41D3-9FB8-C082057ED882}.Release|Any CPU.Build.0 = Release|Any CPU
{C7897C78-B2CF-41F1-8A88-ADD58148B4CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7897C78-B2CF-41F1-8A88-ADD58148B4CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7897C78-B2CF-41F1-8A88-ADD58148B4CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7897C78-B2CF-41F1-8A88-ADD58148B4CC}.Release|Any CPU.Build.0 = Release|Any CPU
{F15D4EF4-BEA7-404C-9599-ECCE91902E80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F15D4EF4-BEA7-404C-9599-ECCE91902E80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F15D4EF4-BEA7-404C-9599-ECCE91902E80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F15D4EF4-BEA7-404C-9599-ECCE91902E80}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions src/SchematicHQ.Client/Accesstokens/AccesstokensClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public async Task<IssueTemporaryAccessTokenResponse> IssueTemporaryAccessTokenAs
Method = HttpMethod.Post,
Path = "temporary-access-tokens",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
4 changes: 4 additions & 0 deletions src/SchematicHQ.Client/Accounts/AccountsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public async Task<CreateApiKeyResponse> CreateApiKeyAsync(
Method = HttpMethod.Post,
Path = "api-keys",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -228,6 +229,7 @@ public async Task<UpdateApiKeyResponse> UpdateApiKeyAsync(
Method = HttpMethod.Put,
Path = $"api-keys/{apiKeyId}",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -720,6 +722,7 @@ public async Task<CreateEnvironmentResponse> CreateEnvironmentAsync(
Method = HttpMethod.Post,
Path = "environments",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -840,6 +843,7 @@ public async Task<UpdateEnvironmentResponse> UpdateEnvironmentAsync(
Method = HttpMethod.Put,
Path = $"environments/{environmentId}",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
8 changes: 8 additions & 0 deletions src/SchematicHQ.Client/Billing/BillingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public async Task<UpsertBillingCouponResponse> UpsertBillingCouponAsync(
Method = HttpMethod.Post,
Path = "billing/coupons",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -115,6 +116,7 @@ public async Task<UpsertBillingCustomerResponse> UpsertBillingCustomerAsync(
Method = HttpMethod.Post,
Path = "billing/customer/upsert",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -428,6 +430,7 @@ public async Task<UpsertInvoiceResponse> UpsertInvoiceAsync(
Method = HttpMethod.Post,
Path = "billing/invoices",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -569,6 +572,7 @@ public async Task<UpsertBillingMeterResponse> UpsertBillingMeterAsync(
Method = HttpMethod.Post,
Path = "billing/meter/upsert",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -716,6 +720,7 @@ public async Task<UpsertPaymentMethodResponse> UpsertPaymentMethodAsync(
Method = HttpMethod.Post,
Path = "billing/payment-methods",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -869,6 +874,7 @@ public async Task<UpsertBillingPriceResponse> UpsertBillingPriceAsync(
Method = HttpMethod.Post,
Path = "billing/price/upsert",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1091,6 +1097,7 @@ public async Task<UpsertBillingProductResponse> UpsertBillingProductAsync(
Method = HttpMethod.Post,
Path = "billing/product/upsert",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1371,6 +1378,7 @@ public async Task<UpsertBillingSubscriptionResponse> UpsertBillingSubscriptionAs
Method = HttpMethod.Post,
Path = "billing/subscription/upsert",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
3 changes: 3 additions & 0 deletions src/SchematicHQ.Client/Checkout/CheckoutClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public async Task<CheckoutInternalResponse> InternalAsync(
Method = HttpMethod.Post,
Path = "checkout-internal",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -124,6 +125,7 @@ public async Task<PreviewCheckoutInternalResponse> PreviewCheckoutInternalAsync(
Method = HttpMethod.Post,
Path = "checkout-internal/preview",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -188,6 +190,7 @@ public async Task<UpdateCustomerSubscriptionTrialEndResponse> UpdateCustomerSubs
Method = HttpMethod.Put,
Path = $"subscription/{subscriptionId}/edit-trial-end",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
11 changes: 11 additions & 0 deletions src/SchematicHQ.Client/Companies/CompaniesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public async Task<UpsertCompanyResponse> UpsertCompanyAsync(
Method = HttpMethod.Post,
Path = "companies",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -388,6 +389,7 @@ public async Task<CreateCompanyResponse> CreateCompanyAsync(
Method = HttpMethod.Post,
Path = "companies/create",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -450,6 +452,7 @@ public async Task<DeleteCompanyByKeysResponse> DeleteCompanyByKeysAsync(
Method = HttpMethod.Post,
Path = "companies/delete",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -735,6 +738,7 @@ public async Task<GetOrCreateCompanyMembershipResponse> GetOrCreateCompanyMember
Method = HttpMethod.Post,
Path = "company-memberships",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -934,6 +938,7 @@ public async Task<UpsertCompanyTraitResponse> UpsertCompanyTraitAsync(
Method = HttpMethod.Post,
Path = "company-traits",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1239,6 +1244,7 @@ public async Task<GetOrCreateEntityTraitDefinitionResponse> GetOrCreateEntityTra
Method = HttpMethod.Post,
Path = "entity-trait-definitions",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1367,6 +1373,7 @@ public async Task<UpdateEntityTraitDefinitionResponse> UpdateEntityTraitDefiniti
Method = HttpMethod.Put,
Path = $"entity-trait-definitions/{entityTraitDefinitionId}",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1593,6 +1600,7 @@ public async Task<UpsertUserTraitResponse> UpsertUserTraitAsync(
Method = HttpMethod.Post,
Path = "user-traits",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -1741,6 +1749,7 @@ public async Task<UpsertUserResponse> UpsertUserAsync(
Method = HttpMethod.Post,
Path = "users",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -2007,6 +2016,7 @@ public async Task<CreateUserResponse> CreateUserAsync(
Method = HttpMethod.Post,
Path = "users/create",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -2069,6 +2079,7 @@ public async Task<DeleteUserByKeysResponse> DeleteUserByKeysAsync(
Method = HttpMethod.Post,
Path = "users/delete",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
2 changes: 2 additions & 0 deletions src/SchematicHQ.Client/Components/ComponentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public async Task<CreateComponentResponse> CreateComponentAsync(
Method = HttpMethod.Post,
Path = "components",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down Expand Up @@ -233,6 +234,7 @@ public async Task<UpdateComponentResponse> UpdateComponentAsync(
Method = HttpMethod.Put,
Path = $"components/{componentId}",
Body = request,
ContentType = "application/json",
Options = options,
},
cancellationToken
Expand Down
34 changes: 34 additions & 0 deletions src/SchematicHQ.Client/Core/IRequestOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Net.Http;

#nullable enable

namespace SchematicHQ.Client.Core;

internal interface IRequestOptions
{
/// <summary>
/// The Base URL for the API.
/// </summary>
public string? BaseUrl { get; init; }

/// <summary>
/// The http client used to make requests.
/// </summary>
public HttpClient? HttpClient { get; init; }

/// <summary>
/// The http headers sent with the request.
/// </summary>
internal Headers Headers { get; init; }

/// <summary>
/// The http client used to make requests.
/// </summary>
public int? MaxRetries { get; init; }

/// <summary>
/// The timeout for the request.
/// </summary>
public TimeSpan? Timeout { get; init; }
}
8 changes: 6 additions & 2 deletions src/SchematicHQ.Client/Core/JsonConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@

namespace SchematicHQ.Client.Core;

internal static class JsonOptions
internal static partial class JsonOptions
{
public static readonly JsonSerializerOptions JsonSerializerOptions;

static JsonOptions()
{
JsonSerializerOptions = new JsonSerializerOptions
var options = new JsonSerializerOptions
{
Converters = { new DateTimeSerializer(), new OneOfSerializer() },
WriteIndented = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
};
ConfigureJsonSerializerOptions(options);
JsonSerializerOptions = options;
}

static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions);
}

internal static class JsonUtils
Expand Down
1 change: 0 additions & 1 deletion src/SchematicHQ.Client/Core/Public/ClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ internal ClientOptions Clone()
Timeout = Timeout,
Headers = new Headers(new Dictionary<string, HeaderValue>(Headers)),
};
;
}
}
Loading
Loading