Skip to content

Commit c813eae

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1
1 parent 20d925a commit c813eae

File tree

92 files changed

+792
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+792
-859
lines changed

.speakeasy/gen.lock

Lines changed: 120 additions & 87 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ generation:
1313
oAuth2ClientCredentialsEnabled: true
1414
oAuth2PasswordEnabled: false
1515
csharp:
16-
version: 5.0.0-beta.9
16+
version: 5.0.0-beta.10
1717
additionalDependencies: []
1818
author: Shippo
1919
clientServerStatusCodesAsErrors: true

.speakeasy/workflow.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.447.0
1+
speakeasyVersion: 1.476.1
22
sources:
33
openapi:
44
sourceNamespace: openapi
5-
sourceRevisionDigest: sha256:33370e133d3ed110a28d8f54ab74952099de562bdc22dc5386cb760f0fe01b2d
6-
sourceBlobDigest: sha256:8c66d55b10c00886e8fd1f2b6ea6b233bccf17f622fed046dcf302d5da3f91f5
5+
sourceRevisionDigest: sha256:8938e750b98174f20e2e0e2e0f31db436d25aaee4558c3e98e0579031c3431cf
6+
sourceBlobDigest: sha256:cd9da3407a166b3f3649622b362cd9710086eee23be01fef701736f0c030f6ed
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1732636811
9+
- speakeasy-sdk-regen-1733098817
1010
- "2018-02-08"
1111
targets:
1212
csharp:
1313
source: openapi
1414
sourceNamespace: openapi
15-
sourceRevisionDigest: sha256:33370e133d3ed110a28d8f54ab74952099de562bdc22dc5386cb760f0fe01b2d
16-
sourceBlobDigest: sha256:8c66d55b10c00886e8fd1f2b6ea6b233bccf17f622fed046dcf302d5da3f91f5
17-
codeSamplesNamespace: openapi-code-samples
18-
codeSamplesRevisionDigest: sha256:647654e9271aa56042482d39883ea26ee4daadfc87152727f13dfbf47db42237
15+
sourceRevisionDigest: sha256:8938e750b98174f20e2e0e2e0f31db436d25aaee4558c3e98e0579031c3431cf
16+
sourceBlobDigest: sha256:cd9da3407a166b3f3649622b362cd9710086eee23be01fef701736f0c030f6ed
17+
codeSamplesNamespace: openapi-csharp-code-samples
18+
codeSamplesRevisionDigest: sha256:31a3017f3108de77f5fb4f5a33b66706570b8fccd59884bf1c090abd095ab03f
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest
@@ -34,5 +34,5 @@ workflow:
3434
apiKey: $nuget_api_key
3535
codeSamples:
3636
registry:
37-
location: registry.speakeasyapi.dev/shippo/shippo/openapi-code-samples
37+
location: registry.speakeasyapi.dev/shippo/shippo/openapi-csharp-code-samples
3838
blocking: false

.speakeasy/workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ targets:
1515
apiKey: $nuget_api_key
1616
codeSamples:
1717
registry:
18-
location: registry.speakeasyapi.dev/shippo/shippo/openapi-code-samples
18+
location: registry.speakeasyapi.dev/shippo/shippo/openapi-csharp-code-samples
1919
blocking: false

NUGET.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@
88

99
```csharp
1010
using Shippo;
11-
using Shippo.Models.Requests;
1211
using Shippo.Models.Components;
1312

14-
var sdk = new ShippoSDK(
15-
apiKeyHeader: "<YOUR_API_KEY_HERE>",
16-
shippoApiVersion: "2018-02-08"
17-
);
13+
var sdk = new ShippoSDK(shippoApiVersion: "2018-02-08");
1814

19-
var res = await sdk.Addresses.ListAsync(
20-
page: 1,
21-
results: 5,
22-
shippoApiVersion: "2018-02-08"
23-
);
15+
WebhookPayloadBatch req = new WebhookPayloadBatch() {};
16+
17+
await sdk.BatchAsync(req);
2418

2519
// handle response
2620
```
@@ -53,10 +47,9 @@ When custom error responses are specified for an operation, the SDK may also thr
5347

5448
```csharp
5549
using Shippo;
56-
using Shippo.Models.Requests;
5750
using Shippo.Models.Components;
58-
using System;
5951
using Shippo.Models.Errors;
52+
using Shippo.Models.Requests;
6053

6154
var sdk = new ShippoSDK(
6255
apiKeyHeader: "<YOUR_API_KEY_HERE>",
@@ -108,7 +101,6 @@ catch (Exception ex)
108101
The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example:
109102
```csharp
110103
using Shippo;
111-
using Shippo.Models.Requests;
112104
using Shippo.Models.Components;
113105

114106
var sdk = new ShippoSDK(
@@ -141,7 +133,6 @@ This SDK supports the following security scheme globally:
141133
To authenticate with the API the `APIKeyHeader` parameter must be set when initializing the SDK client instance. For example:
142134
```csharp
143135
using Shippo;
144-
using Shippo.Models.Requests;
145136
using Shippo.Models.Components;
146137

147138
var sdk = new ShippoSDK(

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ Shippo external API.: Use this API to integrate with the Shippo service
2121

2222
<!-- Start Table of Contents [toc] -->
2323
## Table of Contents
24+
<!-- $toc-max-depth=2 -->
25+
* [<img src="https://docs.goshippo.com/images/Logo.png" width="30" alt="Shippo logo"> Shippo C# SDK](#img-srchttpsdocsgoshippocomimageslogopng-width30-altshippo-logo-shippo-c-sdk)
26+
* [SDK Installation](#sdk-installation)
27+
* [SDK Example Usage](#sdk-example-usage)
28+
* [Custom HTTP Client](#custom-http-client)
29+
* [Documentation](#documentation)
30+
* [Available Resources and Operations](#available-resources-and-operations)
31+
* [Development](#development)
32+
* [Contributions](#contributions)
33+
* [About Shippo](#about-shippo)
2434

25-
* [SDK Installation](#sdk-installation)
26-
* [SDK Example Usage](#sdk-example-usage)
27-
* [Available Resources and Operations](#available-resources-and-operations)
28-
* [Error Handling](#error-handling)
29-
* [Server Selection](#server-selection)
30-
* [Authentication](#authentication)
3135
<!-- End Table of Contents [toc] -->
3236

3337
<!-- Start SDK Installation [installation] -->
@@ -55,19 +59,13 @@ dotnet add reference Shippo/Shippo.csproj
5559

5660
```csharp
5761
using Shippo;
58-
using Shippo.Models.Requests;
5962
using Shippo.Models.Components;
6063

61-
var sdk = new ShippoSDK(
62-
apiKeyHeader: "<YOUR_API_KEY_HERE>",
63-
shippoApiVersion: "2018-02-08"
64-
);
64+
var sdk = new ShippoSDK(shippoApiVersion: "2018-02-08");
6565

66-
var res = await sdk.Addresses.ListAsync(
67-
page: 1,
68-
results: 5,
69-
shippoApiVersion: "2018-02-08"
70-
);
66+
WebhookPayloadBatch req = new WebhookPayloadBatch() {};
67+
68+
await sdk.BatchAsync(req);
7169

7270
// handle response
7371
```

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,14 @@ Based on:
108108
### Generated
109109
- [csharp v5.0.0-beta.9] .
110110
### Releases
111-
- [NuGet v5.0.0-beta.9] https://www.nuget.org/packages/Shippo/5.0.0-beta.9 - .
111+
- [NuGet v5.0.0-beta.9] https://www.nuget.org/packages/Shippo/5.0.0-beta.9 - .
112+
113+
## 2025-01-27 00:18:16
114+
### Changes
115+
Based on:
116+
- OpenAPI Doc
117+
- Speakeasy CLI 1.476.1 (2.495.1) https://github.com/speakeasy-api/speakeasy
118+
### Generated
119+
- [csharp v5.0.0-beta.10] .
120+
### Releases
121+
- [NuGet v5.0.0-beta.10] https://www.nuget.org/packages/Shippo/5.0.0-beta.10 - .

Shippo/Addresses.cs

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ namespace Shippo
1414
using Shippo.Models.Components;
1515
using Shippo.Models.Errors;
1616
using Shippo.Models.Requests;
17-
using Shippo.Utils.Retries;
1817
using Shippo.Utils;
18+
using Shippo.Utils.Retries;
19+
using System;
1920
using System.Collections.Generic;
20-
using System.Net.Http.Headers;
2121
using System.Net.Http;
22+
using System.Net.Http.Headers;
2223
using System.Threading.Tasks;
23-
using System;
2424

2525
/// <summary>
2626
/// Addresses are the locations a parcel is being shipped **from** and **to**. They represent company and residential places. Among other things, you can use address objects to create shipments, calculate shipping rates, and purchase shipping labels.<br/>
@@ -39,7 +39,7 @@ public interface IAddresses
3939
/// Returns a list of all address objects that have been created in this account.
4040
/// </remarks>
4141
/// </summary>
42-
Task<AddressPaginatedList> ListAsync(long? page = null, long? results = null, string? shippoApiVersion = null);
42+
Task<AddressPaginatedList> ListAsync(long? page = 1, long? results = 5, string? shippoApiVersion = null);
4343

4444
/// <summary>
4545
/// Create a new address
@@ -80,10 +80,10 @@ public class Addresses: IAddresses
8080
{
8181
public SDKConfig SDKConfiguration { get; private set; }
8282
private const string _language = "csharp";
83-
private const string _sdkVersion = "5.0.0-beta.9";
84-
private const string _sdkGenVersion = "2.463.0";
83+
private const string _sdkVersion = "5.0.0-beta.10";
84+
private const string _sdkGenVersion = "2.495.1";
8585
private const string _openapiDocVersion = "2018-02-08";
86-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.9 2.463.0 2018-02-08 Shippo";
86+
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.10 2.495.1 2018-02-08 Shippo";
8787
private string _serverUrl = "";
8888
private ISpeakeasyHttpClient _client;
8989
private Func<Shippo.Models.Components.Security>? _securitySource;
@@ -96,7 +96,7 @@ public Addresses(ISpeakeasyHttpClient client, Func<Shippo.Models.Components.Secu
9696
SDKConfiguration = config;
9797
}
9898

99-
public async Task<AddressPaginatedList> ListAsync(long? page = null, long? results = null, string? shippoApiVersion = null)
99+
public async Task<AddressPaginatedList> ListAsync(long? page = 1, long? results = 5, string? shippoApiVersion = null)
100100
{
101101
var request = new ListAddressesRequest()
102102
{
@@ -164,7 +164,11 @@ public async Task<AddressPaginatedList> ListAsync(long? page = null, long? resul
164164

165165
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
166166
}
167-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
167+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
168+
{
169+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
170+
}
171+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
168172
{
169173
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
170174
}
@@ -246,7 +250,11 @@ public async Task<Address> CreateAsync(AddressCreateRequest addressCreateRequest
246250

247251
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
248252
}
249-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
253+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
254+
{
255+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
256+
}
257+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
250258
{
251259
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
252260
}
@@ -321,7 +329,11 @@ public async Task<Address> GetAsync(string addressId, string? shippoApiVersion =
321329

322330
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
323331
}
324-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
332+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
333+
{
334+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
335+
}
336+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
325337
{
326338
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
327339
}
@@ -396,7 +408,11 @@ public async Task<Address> ValidateAsync(string addressId, string? shippoApiVers
396408

397409
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
398410
}
399-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
411+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
412+
{
413+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
414+
}
415+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
400416
{
401417
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
402418
}

Shippo/Batches.cs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ namespace Shippo
1414
using Shippo.Models.Components;
1515
using Shippo.Models.Errors;
1616
using Shippo.Models.Requests;
17-
using Shippo.Utils.Retries;
1817
using Shippo.Utils;
18+
using Shippo.Utils.Retries;
19+
using System;
1920
using System.Collections.Generic;
20-
using System.Net.Http.Headers;
2121
using System.Net.Http;
22+
using System.Net.Http.Headers;
2223
using System.Threading.Tasks;
23-
using System;
2424

2525
/// <summary>
2626
/// A batch is a technique for creating multiple labels at once. Use the batch object to create and purchase many shipments in two API calls. After creating the batch, retrieve the batch to verify that all shipments are valid. You can add and remove shipments after you have created the batch. When all shipments are valid you can purchase the batch and retrieve all the shipping labels.<br/>
@@ -111,10 +111,10 @@ public class Batches: IBatches
111111
{
112112
public SDKConfig SDKConfiguration { get; private set; }
113113
private const string _language = "csharp";
114-
private const string _sdkVersion = "5.0.0-beta.9";
115-
private const string _sdkGenVersion = "2.463.0";
114+
private const string _sdkVersion = "5.0.0-beta.10";
115+
private const string _sdkGenVersion = "2.495.1";
116116
private const string _openapiDocVersion = "2018-02-08";
117-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.9 2.463.0 2018-02-08 Shippo";
117+
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.10 2.495.1 2018-02-08 Shippo";
118118
private string _serverUrl = "";
119119
private ISpeakeasyHttpClient _client;
120120
private Func<Shippo.Models.Components.Security>? _securitySource;
@@ -201,7 +201,11 @@ public async Task<Batch> CreateAsync(BatchCreateRequest batchCreateRequest, stri
201201

202202
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
203203
}
204-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
204+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
205+
{
206+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
207+
}
208+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
205209
{
206210
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
207211
}
@@ -275,7 +279,11 @@ public async Task<Batch> GetAsync(GetBatchRequest request)
275279

276280
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
277281
}
278-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
282+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
283+
{
284+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
285+
}
286+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
279287
{
280288
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
281289
}
@@ -357,7 +365,11 @@ public async Task<Batch> AddShipmentsAsync(string batchId, List<BatchShipmentCre
357365

358366
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
359367
}
360-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
368+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
369+
{
370+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
371+
}
372+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
361373
{
362374
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
363375
}
@@ -432,7 +444,11 @@ public async Task<Batch> PurchaseAsync(string batchId, string? shippoApiVersion
432444

433445
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
434446
}
435-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
447+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
448+
{
449+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
450+
}
451+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
436452
{
437453
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
438454
}
@@ -514,7 +530,11 @@ public async Task<Batch> RemoveShipmentsAsync(string batchId, List<string> reque
514530

515531
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
516532
}
517-
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
533+
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
534+
{
535+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
536+
}
537+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
518538
{
519539
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
520540
}

0 commit comments

Comments
 (0)