From c419e42086cf42862fd31e9dbed243ffd9f7edad Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:03:32 +0000 Subject: [PATCH 1/3] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-csharp-sdk: 2.68.5 --- .fern/metadata.json | 6 +- WASM_VERSION | 1 - reference.md | 120 +++++ .../Billing/BillingClient.cs | 500 ++++++++++++++++++ .../Billing/IBillingClient.cs | 18 + .../Types/DeleteBillingCouponResponse.cs | 34 ++ .../Types/DeleteBillingCustomerResponse.cs | 34 ++ .../Types/DeleteBillingInvoiceResponse.cs | 34 ++ .../Requests/CheckoutDataRequestBody.cs | 3 + src/SchematicHQ.Client/Core/Public/Version.cs | 2 +- .../Requests/PublishPlanVersionRequestBody.cs | 3 + src/SchematicHQ.Client/SchematicApi.cs | 2 +- .../SchematicHQ.Client.csproj | 2 +- .../Types/BillingCreditGrantResponseData.cs | 2 +- src/SchematicHQ.Client/Types/CountResponse.cs | 2 +- .../Types/CreditCompanyGrantView.cs | 2 +- .../Types/CreditEventLedgerResponseData.cs | 2 +- .../Types/EventBodyTrack.cs | 2 +- .../Types/PlanChangeResponseData.cs | 6 + .../Types/RulesEngineSchemaVersion.cs | 4 +- 20 files changed, 765 insertions(+), 14 deletions(-) delete mode 100644 WASM_VERSION create mode 100644 src/SchematicHQ.Client/Billing/Types/DeleteBillingCouponResponse.cs create mode 100644 src/SchematicHQ.Client/Billing/Types/DeleteBillingCustomerResponse.cs create mode 100644 src/SchematicHQ.Client/Billing/Types/DeleteBillingInvoiceResponse.cs diff --git a/.fern/metadata.json b/.fern/metadata.json index 4d13e96e..80712f90 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -8,10 +8,10 @@ "exported-client-class-name": "Schematic", "generate-mock-server-tests": false }, - "originGitCommit": "c7ae462826a6e814bff92fd1ae9fc8c18b8359ba", + "originGitCommit": "deb8532a1f84f6daa08b5c611a66a5ec92f53f0e", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.4.9", + "requestedVersion": "1.4.10", "ciProvider": "github", - "sdkVersion": "1.4.9" + "sdkVersion": "1.4.10" } \ No newline at end of file diff --git a/WASM_VERSION b/WASM_VERSION deleted file mode 100644 index 1d0ba9ea..00000000 --- a/WASM_VERSION +++ /dev/null @@ -1 +0,0 @@ -0.4.0 diff --git a/reference.md b/reference.md index 52e9a75e..cd991242 100644 --- a/reference.md +++ b/reference.md @@ -935,6 +935,86 @@ await client.Billing.UpsertBillingCouponAsync( + + + + +
client.Billing.DeleteBillingCouponAsync(billingId) -> WithRawResponseTask<DeleteBillingCouponResponse> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Billing.DeleteBillingCouponAsync("billing_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**billingId:** `string` — billing_id + +
+
+
+
+ + +
+
+
+ +
client.Billing.DeleteBillingCustomerAsync(billingId) -> WithRawResponseTask<DeleteBillingCustomerResponse> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Billing.DeleteBillingCustomerAsync("billing_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**billingId:** `string` — billing_id + +
+
+
+
+ +
@@ -1183,6 +1263,46 @@ await client.Billing.UpsertInvoiceAsync( + + + + +
client.Billing.DeleteBillingInvoiceAsync(billingId) -> WithRawResponseTask<DeleteBillingInvoiceResponse> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Billing.DeleteBillingInvoiceAsync("billing_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**billingId:** `string` — billing_id + +
+
+
+
+ +
diff --git a/src/SchematicHQ.Client/Billing/BillingClient.cs b/src/SchematicHQ.Client/Billing/BillingClient.cs index db6dc2f5..e875c735 100644 --- a/src/SchematicHQ.Client/Billing/BillingClient.cs +++ b/src/SchematicHQ.Client/Billing/BillingClient.cs @@ -318,6 +318,312 @@ private async Task> UpsertBillingCo } } + private async Task> DeleteBillingCouponAsyncCore( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new SchematicHQ.Client.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "billing/coupons/{0}", + ValueConvert.ToPathParameterString(billingId) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new SchematicApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new SchematicApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task< + WithRawResponse + > DeleteBillingCustomerAsyncCore( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new SchematicHQ.Client.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "billing/customer/{0}", + ValueConvert.ToPathParameterString(billingId) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new SchematicApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new SchematicApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + private async Task< WithRawResponse > UpsertBillingCustomerAsyncCore( @@ -1094,6 +1400,158 @@ private async Task> UpsertInvoiceAsyncCor } } + private async Task> DeleteBillingInvoiceAsyncCore( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new SchematicHQ.Client.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "billing/invoices/{0}", + ValueConvert.ToPathParameterString(billingId) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new SchematicApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new SchematicApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new SchematicHQ.Client.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + private async Task> ListMetersAsyncCore( ListMetersRequest request, RequestOptions? options = null, @@ -3332,6 +3790,34 @@ public WithRawResponseTask UpsertBillingCouponAsync ); } + /// + /// await client.Billing.DeleteBillingCouponAsync("billing_id"); + /// + public WithRawResponseTask DeleteBillingCouponAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + DeleteBillingCouponAsyncCore(billingId, options, cancellationToken) + ); + } + + /// + /// await client.Billing.DeleteBillingCustomerAsync("billing_id"); + /// + public WithRawResponseTask DeleteBillingCustomerAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + DeleteBillingCustomerAsyncCore(billingId, options, cancellationToken) + ); + } + /// /// await client.Billing.UpsertBillingCustomerAsync( /// new CreateBillingCustomerRequestBody @@ -3450,6 +3936,20 @@ public WithRawResponseTask UpsertInvoiceAsync( ); } + /// + /// await client.Billing.DeleteBillingInvoiceAsync("billing_id"); + /// + public WithRawResponseTask DeleteBillingInvoiceAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + DeleteBillingInvoiceAsyncCore(billingId, options, cancellationToken) + ); + } + /// /// await client.Billing.ListMetersAsync( /// new ListMetersRequest diff --git a/src/SchematicHQ.Client/Billing/IBillingClient.cs b/src/SchematicHQ.Client/Billing/IBillingClient.cs index debcd01a..66d081b9 100644 --- a/src/SchematicHQ.Client/Billing/IBillingClient.cs +++ b/src/SchematicHQ.Client/Billing/IBillingClient.cs @@ -14,6 +14,18 @@ WithRawResponseTask UpsertBillingCouponAsync( CancellationToken cancellationToken = default ); + WithRawResponseTask DeleteBillingCouponAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask DeleteBillingCustomerAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + WithRawResponseTask UpsertBillingCustomerAsync( CreateBillingCustomerRequestBody request, RequestOptions? options = null, @@ -44,6 +56,12 @@ WithRawResponseTask UpsertInvoiceAsync( CancellationToken cancellationToken = default ); + WithRawResponseTask DeleteBillingInvoiceAsync( + string billingId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + WithRawResponseTask ListMetersAsync( ListMetersRequest request, RequestOptions? options = null, diff --git a/src/SchematicHQ.Client/Billing/Types/DeleteBillingCouponResponse.cs b/src/SchematicHQ.Client/Billing/Types/DeleteBillingCouponResponse.cs new file mode 100644 index 00000000..b211aff4 --- /dev/null +++ b/src/SchematicHQ.Client/Billing/Types/DeleteBillingCouponResponse.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using SchematicHQ.Client.Core; + +namespace SchematicHQ.Client; + +[Serializable] +public record DeleteBillingCouponResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("data")] + public required DeleteResponse Data { get; set; } + + /// + /// Input parameters + /// + [JsonPropertyName("params")] + public Dictionary Params { get; set; } = new Dictionary(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/SchematicHQ.Client/Billing/Types/DeleteBillingCustomerResponse.cs b/src/SchematicHQ.Client/Billing/Types/DeleteBillingCustomerResponse.cs new file mode 100644 index 00000000..c9a9e0ca --- /dev/null +++ b/src/SchematicHQ.Client/Billing/Types/DeleteBillingCustomerResponse.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using SchematicHQ.Client.Core; + +namespace SchematicHQ.Client; + +[Serializable] +public record DeleteBillingCustomerResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("data")] + public required DeleteResponse Data { get; set; } + + /// + /// Input parameters + /// + [JsonPropertyName("params")] + public Dictionary Params { get; set; } = new Dictionary(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/SchematicHQ.Client/Billing/Types/DeleteBillingInvoiceResponse.cs b/src/SchematicHQ.Client/Billing/Types/DeleteBillingInvoiceResponse.cs new file mode 100644 index 00000000..469491c3 --- /dev/null +++ b/src/SchematicHQ.Client/Billing/Types/DeleteBillingInvoiceResponse.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using SchematicHQ.Client.Core; + +namespace SchematicHQ.Client; + +[Serializable] +public record DeleteBillingInvoiceResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("data")] + public required DeleteResponse Data { get; set; } + + /// + /// Input parameters + /// + [JsonPropertyName("params")] + public Dictionary Params { get; set; } = new Dictionary(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/SchematicHQ.Client/Checkout/Requests/CheckoutDataRequestBody.cs b/src/SchematicHQ.Client/Checkout/Requests/CheckoutDataRequestBody.cs index 942885cb..017b8868 100644 --- a/src/SchematicHQ.Client/Checkout/Requests/CheckoutDataRequestBody.cs +++ b/src/SchematicHQ.Client/Checkout/Requests/CheckoutDataRequestBody.cs @@ -9,6 +9,9 @@ public record CheckoutDataRequestBody [JsonPropertyName("company_id")] public required string CompanyId { get; set; } + [JsonPropertyName("currency")] + public string? Currency { get; set; } + [JsonPropertyName("selected_plan_id")] public string? SelectedPlanId { get; set; } diff --git a/src/SchematicHQ.Client/Core/Public/Version.cs b/src/SchematicHQ.Client/Core/Public/Version.cs index 3a8c5266..ba57a4b3 100644 --- a/src/SchematicHQ.Client/Core/Public/Version.cs +++ b/src/SchematicHQ.Client/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace SchematicHQ.Client; [Serializable] internal class Version { - public const string Current = "1.4.9"; + public const string Current = "1.4.10"; } diff --git a/src/SchematicHQ.Client/Plans/Requests/PublishPlanVersionRequestBody.cs b/src/SchematicHQ.Client/Plans/Requests/PublishPlanVersionRequestBody.cs index d4df2c2f..208739e5 100644 --- a/src/SchematicHQ.Client/Plans/Requests/PublishPlanVersionRequestBody.cs +++ b/src/SchematicHQ.Client/Plans/Requests/PublishPlanVersionRequestBody.cs @@ -9,6 +9,9 @@ public record PublishPlanVersionRequestBody [JsonPropertyName("activation_strategy")] public CustomPlanActivationStrategy? ActivationStrategy { get; set; } + [JsonPropertyName("coupon_external_id")] + public string? CouponExternalId { get; set; } + [JsonPropertyName("customer_email")] public string? CustomerEmail { get; set; } diff --git a/src/SchematicHQ.Client/SchematicApi.cs b/src/SchematicHQ.Client/SchematicApi.cs index 634ed561..db8ce1e5 100644 --- a/src/SchematicHQ.Client/SchematicApi.cs +++ b/src/SchematicHQ.Client/SchematicApi.cs @@ -15,7 +15,7 @@ public SchematicApi(string? apiKey = null, ClientOptions? clientOptions = null) { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "SchematicHQ.Client" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "SchematicHQ.Client/1.4.9" }, + { "User-Agent", "SchematicHQ.Client/1.4.10" }, } ); foreach (var header in platformHeaders) diff --git a/src/SchematicHQ.Client/SchematicHQ.Client.csproj b/src/SchematicHQ.Client/SchematicHQ.Client.csproj index 63beb266..1e6aa76b 100644 --- a/src/SchematicHQ.Client/SchematicHQ.Client.csproj +++ b/src/SchematicHQ.Client/SchematicHQ.Client.csproj @@ -4,7 +4,7 @@ enable 12 enable - 1.4.9 + 1.4.10 $(Version) $(Version) README.md diff --git a/src/SchematicHQ.Client/Types/BillingCreditGrantResponseData.cs b/src/SchematicHQ.Client/Types/BillingCreditGrantResponseData.cs index ec88ef43..472fa720 100644 --- a/src/SchematicHQ.Client/Types/BillingCreditGrantResponseData.cs +++ b/src/SchematicHQ.Client/Types/BillingCreditGrantResponseData.cs @@ -51,7 +51,7 @@ public record BillingCreditGrantResponseData : IJsonOnDeserialized public BillingPriceResponseData? Price { get; set; } [JsonPropertyName("quantity")] - public required long Quantity { get; set; } + public required double Quantity { get; set; } [JsonPropertyName("quantity_remaining")] public required double QuantityRemaining { get; set; } diff --git a/src/SchematicHQ.Client/Types/CountResponse.cs b/src/SchematicHQ.Client/Types/CountResponse.cs index 05331e95..a6eabb05 100644 --- a/src/SchematicHQ.Client/Types/CountResponse.cs +++ b/src/SchematicHQ.Client/Types/CountResponse.cs @@ -15,7 +15,7 @@ public record CountResponse : IJsonOnDeserialized /// The number of resources /// [JsonPropertyName("count")] - public int? Count { get; set; } + public long? Count { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/SchematicHQ.Client/Types/CreditCompanyGrantView.cs b/src/SchematicHQ.Client/Types/CreditCompanyGrantView.cs index 7f111ad4..28e52a8e 100644 --- a/src/SchematicHQ.Client/Types/CreditCompanyGrantView.cs +++ b/src/SchematicHQ.Client/Types/CreditCompanyGrantView.cs @@ -72,7 +72,7 @@ public record CreditCompanyGrantView : IJsonOnDeserialized public BillingProductPriceResponseData? Price { get; set; } [JsonPropertyName("quantity")] - public required long Quantity { get; set; } + public required double Quantity { get; set; } [JsonPropertyName("quantity_remaining")] public required double QuantityRemaining { get; set; } diff --git a/src/SchematicHQ.Client/Types/CreditEventLedgerResponseData.cs b/src/SchematicHQ.Client/Types/CreditEventLedgerResponseData.cs index 11fa5b48..1b71a7e0 100644 --- a/src/SchematicHQ.Client/Types/CreditEventLedgerResponseData.cs +++ b/src/SchematicHQ.Client/Types/CreditEventLedgerResponseData.cs @@ -72,7 +72,7 @@ public record CreditEventLedgerResponseData : IJsonOnDeserialized public string? GrantId { get; set; } [JsonPropertyName("grant_quantity")] - public long? GrantQuantity { get; set; } + public double? GrantQuantity { get; set; } [JsonPropertyName("grant_quantity_remaining")] public double? GrantQuantityRemaining { get; set; } diff --git a/src/SchematicHQ.Client/Types/EventBodyTrack.cs b/src/SchematicHQ.Client/Types/EventBodyTrack.cs index 9efdb24e..c5498017 100644 --- a/src/SchematicHQ.Client/Types/EventBodyTrack.cs +++ b/src/SchematicHQ.Client/Types/EventBodyTrack.cs @@ -33,7 +33,7 @@ public record EventBodyTrack : IJsonOnDeserialized /// Optionally specify the quantity of the event /// [JsonPropertyName("quantity")] - public int? Quantity { get; set; } + public long? Quantity { get; set; } /// /// A map of trait names to trait values diff --git a/src/SchematicHQ.Client/Types/PlanChangeResponseData.cs b/src/SchematicHQ.Client/Types/PlanChangeResponseData.cs index 8b2144b7..2f29e2ec 100644 --- a/src/SchematicHQ.Client/Types/PlanChangeResponseData.cs +++ b/src/SchematicHQ.Client/Types/PlanChangeResponseData.cs @@ -59,6 +59,12 @@ public record PlanChangeResponseData : IJsonOnDeserialized [JsonPropertyName("id")] public required string Id { get; set; } + /// + /// The integration that performed this change, when the actor is an integration-owned API key (e.g. a billing-provider sync). + /// + [JsonPropertyName("integration")] + public IntegrationResponseData? Integration { get; set; } + /// /// True when this change moved the company to a different version of the same plan (e.g. a plan version migration) rather than to a different plan. /// diff --git a/src/SchematicHQ.Client/Types/RulesEngineSchemaVersion.cs b/src/SchematicHQ.Client/Types/RulesEngineSchemaVersion.cs index 3d1a8427..92c71b47 100644 --- a/src/SchematicHQ.Client/Types/RulesEngineSchemaVersion.cs +++ b/src/SchematicHQ.Client/Types/RulesEngineSchemaVersion.cs @@ -8,7 +8,7 @@ namespace SchematicHQ.Client; [Serializable] public readonly record struct RulesEngineSchemaVersion : IStringEnum { - public static readonly RulesEngineSchemaVersion V97288F60 = new(Values.V97288F60); + public static readonly RulesEngineSchemaVersion V5B3E7220 = new(Values.V5B3E7220); public static readonly RulesEngineSchemaVersion PlaceholderForFernCompatibility = new( Values.PlaceholderForFernCompatibility @@ -110,7 +110,7 @@ JsonSerializerOptions options [Serializable] public static class Values { - public const string V97288F60 = "v97288f60"; + public const string V5B3E7220 = "v5b3e7220"; public const string PlaceholderForFernCompatibility = "placeholder-for-fern-compatibility"; } From 37bbf3eec4ed54065067f1cfdf28c28a040c09d5 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:03:34 +0000 Subject: [PATCH 2/3] [fern-replay] Applied customizations Patches applied (1): - patch-0816e16a: chore: update rules engine WASM to v0.4.0 (#158) --- .fern/replay.lock | 10 ++++++++-- WASM_VERSION | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 WASM_VERSION diff --git a/.fern/replay.lock b/.fern/replay.lock index a29cca8f..30d53abd 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -18,14 +18,20 @@ generations: cli_version: unknown generator_versions: fernapi/fern-csharp-sdk: 2.68.5 -current_generation: a832eff3e1f6ec1e5f8f2f3d21bacb3ff7a60126 + - commit_sha: c419e42086cf42862fd31e9dbed243ffd9f7edad + tree_hash: 52d41f1c561659cf8a9c5a49c0b3f42488790e2e + timestamp: 2026-06-30T15:03:32.421Z + cli_version: unknown + generator_versions: + fernapi/fern-csharp-sdk: 2.68.5 +current_generation: c419e42086cf42862fd31e9dbed243ffd9f7edad patches: - id: patch-0816e16a content_hash: sha256:17a9a52d7557e941a9879ef072a5b51bb135098a4021df914f5c6a344964a947 original_commit: 0816e16ac6deea213675e5288d1b96ade208183b original_message: "chore: update rules engine WASM to v0.4.0 (#158)" original_author: Schematic Bot - base_generation: a832eff3e1f6ec1e5f8f2f3d21bacb3ff7a60126 + base_generation: c419e42086cf42862fd31e9dbed243ffd9f7edad files: - WASM_VERSION patch_content: | diff --git a/WASM_VERSION b/WASM_VERSION new file mode 100644 index 00000000..1d0ba9ea --- /dev/null +++ b/WASM_VERSION @@ -0,0 +1 @@ +0.4.0 From e3b5cb9088459a471ab271ee7f83b4032448aff9 Mon Sep 17 00:00:00 2001 From: Christopher Brady Date: Tue, 30 Jun 2026 09:06:04 -0600 Subject: [PATCH 3/3] metric value is now long --- src/SchematicHQ.Client/Datastream/Client.cs | 2 +- src/SchematicHQ.Client/RulesEngine/Utils/GeneratedModelHash.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SchematicHQ.Client/Datastream/Client.cs b/src/SchematicHQ.Client/Datastream/Client.cs index 15628bc4..733701ca 100644 --- a/src/SchematicHQ.Client/Datastream/Client.cs +++ b/src/SchematicHQ.Client/Datastream/Client.cs @@ -1175,7 +1175,7 @@ public async Task UpdateCompanyMetricsAsync(EventBodyTrack eventBody) { if (metric != null && metric.EventSubtype == eventBody.Event) { - int quantity = eventBody.Quantity ?? 0; + long quantity = eventBody.Quantity ?? 0; metric.Value += quantity; metricUpdated = true; } diff --git a/src/SchematicHQ.Client/RulesEngine/Utils/GeneratedModelHash.cs b/src/SchematicHQ.Client/RulesEngine/Utils/GeneratedModelHash.cs index eaec1118..35657a3c 100644 --- a/src/SchematicHQ.Client/RulesEngine/Utils/GeneratedModelHash.cs +++ b/src/SchematicHQ.Client/RulesEngine/Utils/GeneratedModelHash.cs @@ -9,6 +9,6 @@ public static class GeneratedModelHash /// Auto-generated hash of all model files. /// This value changes whenever any model file is modified. /// - public const string Value = "db9eae8a"; + public const string Value = "dec34ea6"; } }