From b5bbbed8d4de85007c8e8897dd4813fa3d4de7bd Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 18:45:38 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-csharp-sdk: 2.13.0 --- .fern/metadata.json | 4 +- reference.md | 164 ------------------ .../MockServer/Inventory/GetTransferTest.cs | 28 --- .../Locations/Transactions/CaptureTest.cs | 55 ------ .../Locations/Transactions/VoidTest.cs | 54 ------ src/Square/Core/Public/Version.cs | 2 +- src/Square/Inventory/IInventoryClient.cs | 6 - src/Square/Inventory/InventoryClient.cs | 40 ----- .../Requests/GetTransferInventoryRequest.cs | 17 -- .../Transactions/ITransactionsClient.cs | 28 --- .../Requests/CaptureTransactionsRequest.cs | 20 --- .../Requests/VoidTransactionsRequest.cs | 20 --- .../Transactions/TransactionsClient.cs | 116 ------------- src/Square/Square.csproj | 2 +- src/Square/SquareClient.cs | 4 +- .../Types/CaptureTransactionResponse.cs | 35 ---- src/Square/Types/VoidTransactionResponse.cs | 35 ---- 17 files changed, 6 insertions(+), 624 deletions(-) delete mode 100644 src/Square.Test/Unit/MockServer/Inventory/GetTransferTest.cs delete mode 100644 src/Square.Test/Unit/MockServer/Locations/Transactions/CaptureTest.cs delete mode 100644 src/Square.Test/Unit/MockServer/Locations/Transactions/VoidTest.cs delete mode 100644 src/Square/Inventory/Requests/GetTransferInventoryRequest.cs delete mode 100644 src/Square/Locations/Transactions/Requests/CaptureTransactionsRequest.cs delete mode 100644 src/Square/Locations/Transactions/Requests/VoidTransactionsRequest.cs delete mode 100644 src/Square/Types/CaptureTransactionResponse.cs delete mode 100644 src/Square/Types/VoidTransactionResponse.cs diff --git a/.fern/metadata.json b/.fern/metadata.json index 6cfaa9a1..3b50d832 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,6 +15,6 @@ "inline-path-parameters": true, "use-discriminated-unions": true }, - "originGitCommit": "b05364cda2b85e35d8daa9ff2c24bbabbbd9652a", - "sdkVersion": "46.1.0" + "originGitCommit": "f74d4b7e34b9b8676dc4b58d83a38111dc1d595f", + "sdkVersion": "47.0.0" } \ No newline at end of file diff --git a/reference.md b/reference.md index 6f5db5e5..74f9740c 100644 --- a/reference.md +++ b/reference.md @@ -5611,48 +5611,6 @@ await client.Inventory.ChangesAsync( - - - - -
client.Inventory.GetTransferAsync(GetTransferInventoryRequest { ... }) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.Inventory.GetTransferAsync( - new GetTransferInventoryRequest { TransferId = "transfer_id" } -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `GetTransferInventoryRequest` - -
-
-
-
- -
@@ -18165,128 +18123,6 @@ await client.Locations.Transactions.GetAsync( - - - - -
client.Locations.Transactions.CaptureAsync(CaptureTransactionsRequest { ... }) -> CaptureTransactionResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.Locations.Transactions.CaptureAsync( - new CaptureTransactionsRequest { LocationId = "location_id", TransactionId = "transaction_id" } -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `CaptureTransactionsRequest` - -
-
-
-
- - -
-
-
- -
client.Locations.Transactions.VoidAsync(VoidTransactionsRequest { ... }) -> VoidTransactionResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.Locations.Transactions.VoidAsync( - new VoidTransactionsRequest { LocationId = "location_id", TransactionId = "transaction_id" } -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `VoidTransactionsRequest` - -
-
-
-
- -
diff --git a/src/Square.Test/Unit/MockServer/Inventory/GetTransferTest.cs b/src/Square.Test/Unit/MockServer/Inventory/GetTransferTest.cs deleted file mode 100644 index 336e3578..00000000 --- a/src/Square.Test/Unit/MockServer/Inventory/GetTransferTest.cs +++ /dev/null @@ -1,28 +0,0 @@ -using NUnit.Framework; -using Square.Inventory; -using Square.Test.Unit.MockServer; - -namespace Square.Test.Unit.MockServer.Inventory; - -[TestFixture] -public class GetTransferTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public void MockServerTest() - { - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/v2/inventory/transfers/transfer_id") - .UsingGet() - ) - .RespondWith(WireMock.ResponseBuilders.Response.Create().WithStatusCode(200)); - - Assert.DoesNotThrowAsync(async () => - await Client.Inventory.GetTransferAsync( - new GetTransferInventoryRequest { TransferId = "transfer_id" } - ) - ); - } -} diff --git a/src/Square.Test/Unit/MockServer/Locations/Transactions/CaptureTest.cs b/src/Square.Test/Unit/MockServer/Locations/Transactions/CaptureTest.cs deleted file mode 100644 index adeede3b..00000000 --- a/src/Square.Test/Unit/MockServer/Locations/Transactions/CaptureTest.cs +++ /dev/null @@ -1,55 +0,0 @@ -using NUnit.Framework; -using Square; -using Square.Core; -using Square.Locations.Transactions; -using Square.Test.Unit.MockServer; - -namespace Square.Test.Unit.MockServer.Locations.Transactions; - -[TestFixture] -public class CaptureTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async Task MockServerTest() - { - const string mockResponse = """ - { - "errors": [ - { - "category": "API_ERROR", - "code": "INTERNAL_SERVER_ERROR", - "detail": "detail", - "field": "field" - } - ] - } - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/v2/locations/location_id/transactions/transaction_id/capture") - .UsingPost() - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.Locations.Transactions.CaptureAsync( - new CaptureTransactionsRequest - { - LocationId = "location_id", - TransactionId = "transaction_id", - } - ); - Assert.That( - response, - Is.EqualTo(JsonUtils.Deserialize(mockResponse)) - .UsingDefaults() - ); - } -} diff --git a/src/Square.Test/Unit/MockServer/Locations/Transactions/VoidTest.cs b/src/Square.Test/Unit/MockServer/Locations/Transactions/VoidTest.cs deleted file mode 100644 index 0a167fc6..00000000 --- a/src/Square.Test/Unit/MockServer/Locations/Transactions/VoidTest.cs +++ /dev/null @@ -1,54 +0,0 @@ -using NUnit.Framework; -using Square; -using Square.Core; -using Square.Locations.Transactions; -using Square.Test.Unit.MockServer; - -namespace Square.Test.Unit.MockServer.Locations.Transactions; - -[TestFixture] -public class VoidTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async Task MockServerTest() - { - const string mockResponse = """ - { - "errors": [ - { - "category": "API_ERROR", - "code": "INTERNAL_SERVER_ERROR", - "detail": "detail", - "field": "field" - } - ] - } - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/v2/locations/location_id/transactions/transaction_id/void") - .UsingPost() - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.Locations.Transactions.VoidAsync( - new VoidTransactionsRequest - { - LocationId = "location_id", - TransactionId = "transaction_id", - } - ); - Assert.That( - response, - Is.EqualTo(JsonUtils.Deserialize(mockResponse)).UsingDefaults() - ); - } -} diff --git a/src/Square/Core/Public/Version.cs b/src/Square/Core/Public/Version.cs index 4eadd45e..33731bb2 100644 --- a/src/Square/Core/Public/Version.cs +++ b/src/Square/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Square; [Serializable] internal class Version { - public const string Current = "46.1.0"; + public const string Current = "47.0.0"; } diff --git a/src/Square/Inventory/IInventoryClient.cs b/src/Square/Inventory/IInventoryClient.cs index 4485a39d..c6a5c1f6 100644 --- a/src/Square/Inventory/IInventoryClient.cs +++ b/src/Square/Inventory/IInventoryClient.cs @@ -223,10 +223,4 @@ Task> ChangesAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ); - - Task GetTransferAsync( - GetTransferInventoryRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); } diff --git a/src/Square/Inventory/InventoryClient.cs b/src/Square/Inventory/InventoryClient.cs index 0153a72f..9f9cd865 100644 --- a/src/Square/Inventory/InventoryClient.cs +++ b/src/Square/Inventory/InventoryClient.cs @@ -1371,44 +1371,4 @@ public async Task> ChangesAsync( .ConfigureAwait(false); return pager; } - - /// - /// await client.Inventory.GetTransferAsync( - /// new GetTransferInventoryRequest { TransferId = "transfer_id" } - /// ); - /// - public async Task GetTransferAsync( - GetTransferInventoryRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = string.Format( - "v2/inventory/transfers/{0}", - ValueConvert.ToPathParameterString(request.TransferId) - ), - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - return; - } - { - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - throw new SquareApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } } diff --git a/src/Square/Inventory/Requests/GetTransferInventoryRequest.cs b/src/Square/Inventory/Requests/GetTransferInventoryRequest.cs deleted file mode 100644 index ff26c05a..00000000 --- a/src/Square/Inventory/Requests/GetTransferInventoryRequest.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Text.Json.Serialization; -using Square.Core; - -namespace Square.Inventory; - -[Serializable] -public record GetTransferInventoryRequest -{ - [JsonIgnore] - public required string TransferId { get; set; } - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Square/Locations/Transactions/ITransactionsClient.cs b/src/Square/Locations/Transactions/ITransactionsClient.cs index 7eff149f..102fe4c2 100644 --- a/src/Square/Locations/Transactions/ITransactionsClient.cs +++ b/src/Square/Locations/Transactions/ITransactionsClient.cs @@ -26,32 +26,4 @@ Task GetAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ); - - /// - /// Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - /// endpoint with a `delay_capture` value of `true`. - /// - /// - /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - /// for more information. - /// - Task CaptureAsync( - CaptureTransactionsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - /// - /// Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - /// endpoint with a `delay_capture` value of `true`. - /// - /// - /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - /// for more information. - /// - Task VoidAsync( - VoidTransactionsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); } diff --git a/src/Square/Locations/Transactions/Requests/CaptureTransactionsRequest.cs b/src/Square/Locations/Transactions/Requests/CaptureTransactionsRequest.cs deleted file mode 100644 index 471202d4..00000000 --- a/src/Square/Locations/Transactions/Requests/CaptureTransactionsRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using Square.Core; - -namespace Square.Locations.Transactions; - -[Serializable] -public record CaptureTransactionsRequest -{ - [JsonIgnore] - public required string LocationId { get; set; } - - [JsonIgnore] - public required string TransactionId { get; set; } - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Square/Locations/Transactions/Requests/VoidTransactionsRequest.cs b/src/Square/Locations/Transactions/Requests/VoidTransactionsRequest.cs deleted file mode 100644 index d22a0a57..00000000 --- a/src/Square/Locations/Transactions/Requests/VoidTransactionsRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using Square.Core; - -namespace Square.Locations.Transactions; - -[Serializable] -public record VoidTransactionsRequest -{ - [JsonIgnore] - public required string LocationId { get; set; } - - [JsonIgnore] - public required string TransactionId { get; set; } - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Square/Locations/Transactions/TransactionsClient.cs b/src/Square/Locations/Transactions/TransactionsClient.cs index 249065b5..89ee0af0 100644 --- a/src/Square/Locations/Transactions/TransactionsClient.cs +++ b/src/Square/Locations/Transactions/TransactionsClient.cs @@ -147,120 +147,4 @@ public async Task GetAsync( ); } } - - /// - /// Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - /// endpoint with a `delay_capture` value of `true`. - /// - /// - /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - /// for more information. - /// - /// - /// await client.Locations.Transactions.CaptureAsync( - /// new CaptureTransactionsRequest { LocationId = "location_id", TransactionId = "transaction_id" } - /// ); - /// - public async Task CaptureAsync( - CaptureTransactionsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = string.Format( - "v2/locations/{0}/transactions/{1}/capture", - ValueConvert.ToPathParameterString(request.LocationId), - ValueConvert.ToPathParameterString(request.TransactionId) - ), - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new SquareException("Failed to deserialize response", e); - } - } - - { - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - throw new SquareApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } - - /// - /// Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - /// endpoint with a `delay_capture` value of `true`. - /// - /// - /// See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - /// for more information. - /// - /// - /// await client.Locations.Transactions.VoidAsync( - /// new VoidTransactionsRequest { LocationId = "location_id", TransactionId = "transaction_id" } - /// ); - /// - public async Task VoidAsync( - VoidTransactionsRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .SendRequestAsync( - new JsonRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = string.Format( - "v2/locations/{0}/transactions/{1}/void", - ValueConvert.ToPathParameterString(request.LocationId), - ValueConvert.ToPathParameterString(request.TransactionId) - ), - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new SquareException("Failed to deserialize response", e); - } - } - - { - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - throw new SquareApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - } } diff --git a/src/Square/Square.csproj b/src/Square/Square.csproj index da8b2bd8..06497b03 100644 --- a/src/Square/Square.csproj +++ b/src/Square/Square.csproj @@ -5,7 +5,7 @@ enable 12 enable - 46.1.0 + 47.0.0 $(Version) $(Version) README.md diff --git a/src/Square/SquareClient.cs b/src/Square/SquareClient.cs index dd56dcd6..d458ac38 100644 --- a/src/Square/SquareClient.cs +++ b/src/Square/SquareClient.cs @@ -49,11 +49,11 @@ public SquareClient(string? token = null, ClientOptions? clientOptions = null) new Dictionary() { { "Authorization", $"Bearer {token}" }, - { "Square-Version", "2026-08-19" }, + { "Square-Version", "2026-09-16" }, { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Square" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Square/46.1.0" }, + { "User-Agent", "Square/47.0.0" }, } ); clientOptions ??= new ClientOptions(); diff --git a/src/Square/Types/CaptureTransactionResponse.cs b/src/Square/Types/CaptureTransactionResponse.cs deleted file mode 100644 index ec54fdc4..00000000 --- a/src/Square/Types/CaptureTransactionResponse.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Square.Core; - -namespace Square; - -/// -/// Defines the fields that are included in the response body of -/// a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. -/// -[Serializable] -public record CaptureTransactionResponse : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Any errors that occurred during the request. - /// - [JsonPropertyName("errors")] - public IEnumerable? Errors { get; set; } - - [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/Square/Types/VoidTransactionResponse.cs b/src/Square/Types/VoidTransactionResponse.cs deleted file mode 100644 index 3901dcfd..00000000 --- a/src/Square/Types/VoidTransactionResponse.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Square.Core; - -namespace Square; - -/// -/// Defines the fields that are included in the response body of -/// a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. -/// -[Serializable] -public record VoidTransactionResponse : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Any errors that occurred during the request. - /// - [JsonPropertyName("errors")] - public IEnumerable? Errors { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} From dcae0d80329cb203e96cdfab889583dfeceea10b Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 18:45:38 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index babd766b..c69e18c0 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -24,5 +24,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-csharp-sdk: 2.13.0 -current_generation: 17f8cafbb8cee88791263ef4d0ff2dece237c946 + - commit_sha: 42101b5b83a78c401b0020e17f003f3df45b685d + tree_hash: 79f3171362572ce8dfe0bf8505540656b6ec07a6 + timestamp: 2026-09-15T18:45:35.047Z + cli_version: unknown + generator_versions: + fernapi/fern-csharp-sdk: 2.13.0 +current_generation: 42101b5b83a78c401b0020e17f003f3df45b685d patches: []