Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.487.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Feb 10, 2025
1 parent 3c2907e commit d833798
Show file tree
Hide file tree
Showing 125 changed files with 1,115 additions and 1,388 deletions.
207 changes: 120 additions & 87 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
csharp:
version: 5.0.0-beta.9
version: 5.0.0-beta.10
additionalDependencies: []
author: Shippo
clientServerStatusCodesAsErrors: true
Expand Down
18 changes: 9 additions & 9 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.447.0
speakeasyVersion: 1.487.1
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:33370e133d3ed110a28d8f54ab74952099de562bdc22dc5386cb760f0fe01b2d
sourceBlobDigest: sha256:8c66d55b10c00886e8fd1f2b6ea6b233bccf17f622fed046dcf302d5da3f91f5
sourceRevisionDigest: sha256:b3d9d498501a8870f9e040fc3a95ad200d0f8f652675e8580a8433373306079f
sourceBlobDigest: sha256:9331910575a380f9073bf9d31fb81996067da3d0ee449b0513dbe10790790b37
tags:
- latest
- speakeasy-sdk-regen-1732636811
- speakeasy-sdk-regen-1733098817
- "2018-02-08"
targets:
csharp:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:33370e133d3ed110a28d8f54ab74952099de562bdc22dc5386cb760f0fe01b2d
sourceBlobDigest: sha256:8c66d55b10c00886e8fd1f2b6ea6b233bccf17f622fed046dcf302d5da3f91f5
codeSamplesNamespace: openapi-code-samples
codeSamplesRevisionDigest: sha256:647654e9271aa56042482d39883ea26ee4daadfc87152727f13dfbf47db42237
sourceRevisionDigest: sha256:b3d9d498501a8870f9e040fc3a95ad200d0f8f652675e8580a8433373306079f
sourceBlobDigest: sha256:9331910575a380f9073bf9d31fb81996067da3d0ee449b0513dbe10790790b37
codeSamplesNamespace: openapi-csharp-code-samples
codeSamplesRevisionDigest: sha256:e192b02685069dce67c18c3979c797fc2e247626f32d4f6bb747f8973e229d26
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand All @@ -34,5 +34,5 @@ workflow:
apiKey: $nuget_api_key
codeSamples:
registry:
location: registry.speakeasyapi.dev/shippo/shippo/openapi-code-samples
location: registry.speakeasyapi.dev/shippo/shippo/openapi-csharp-code-samples
blocking: false
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ targets:
apiKey: $nuget_api_key
codeSamples:
registry:
location: registry.speakeasyapi.dev/shippo/shippo/openapi-code-samples
location: registry.speakeasyapi.dev/shippo/shippo/openapi-csharp-code-samples
blocking: false
19 changes: 5 additions & 14 deletions NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@

```csharp
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08"
);
var sdk = new ShippoSDK(shippoApiVersion: "2018-02-08");

var res = await sdk.Addresses.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08"
);
WebhookPayloadBatch req = new WebhookPayloadBatch() {};

await sdk.BatchAsync(req);

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

```csharp
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;
using System;
using Shippo.Models.Errors;
using Shippo.Models.Requests;

var sdk = new ShippoSDK(
apiKeyHeader: "<YOUR_API_KEY_HERE>",
Expand Down Expand Up @@ -108,7 +101,6 @@ catch (Exception ex)
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:
```csharp
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

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

var sdk = new ShippoSDK(
Expand Down
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ Shippo external API.: Use this API to integrate with the Shippo service

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [<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)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Custom HTTP Client](#custom-http-client)
* [Documentation](#documentation)
* [Available Resources and Operations](#available-resources-and-operations)
* [Development](#development)
* [Contributions](#contributions)
* [About Shippo](#about-shippo)

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

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

```csharp
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08"
);
var sdk = new ShippoSDK(shippoApiVersion: "2018-02-08");

var res = await sdk.Addresses.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08"
);
WebhookPayloadBatch req = new WebhookPayloadBatch() {};

await sdk.BatchAsync(req);

// handle response
```
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,14 @@ Based on:
### Generated
- [csharp v5.0.0-beta.9] .
### Releases
- [NuGet v5.0.0-beta.9] https://www.nuget.org/packages/Shippo/5.0.0-beta.9 - .
- [NuGet v5.0.0-beta.9] https://www.nuget.org/packages/Shippo/5.0.0-beta.9 - .

## 2025-02-10 00:18:38
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.487.1 (2.506.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v5.0.0-beta.10] .
### Releases
- [NuGet v5.0.0-beta.10] https://www.nuget.org/packages/Shippo/5.0.0-beta.10 - .
40 changes: 28 additions & 12 deletions Shippo/Addresses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace Shippo
using Shippo.Models.Components;
using Shippo.Models.Errors;
using Shippo.Models.Requests;
using Shippo.Utils.Retries;
using Shippo.Utils;
using Shippo.Utils.Retries;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System;

/// <summary>
/// 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/>
Expand All @@ -39,7 +39,7 @@ public interface IAddresses
/// Returns a list of all address objects that have been created in this account.
/// </remarks>
/// </summary>
Task<AddressPaginatedList> ListAsync(long? page = null, long? results = null, string? shippoApiVersion = null);
Task<AddressPaginatedList> ListAsync(long? page = 1, long? results = 5, string? shippoApiVersion = null);

/// <summary>
/// Create a new address
Expand Down Expand Up @@ -80,10 +80,10 @@ public class Addresses: IAddresses
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "5.0.0-beta.9";
private const string _sdkGenVersion = "2.463.0";
private const string _sdkVersion = "5.0.0-beta.10";
private const string _sdkGenVersion = "2.506.0";
private const string _openapiDocVersion = "2018-02-08";
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.9 2.463.0 2018-02-08 Shippo";
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.10 2.506.0 2018-02-08 Shippo";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<Shippo.Models.Components.Security>? _securitySource;
Expand All @@ -96,7 +96,7 @@ public Addresses(ISpeakeasyHttpClient client, Func<Shippo.Models.Components.Secu
SDKConfiguration = config;
}

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

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -246,7 +250,11 @@ public async Task<Address> CreateAsync(AddressCreateRequest addressCreateRequest

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -321,7 +329,11 @@ public async Task<Address> GetAsync(string addressId, string? shippoApiVersion =

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -396,7 +408,11 @@ public async Task<Address> ValidateAsync(string addressId, string? shippoApiVers

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down
42 changes: 31 additions & 11 deletions Shippo/Batches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace Shippo
using Shippo.Models.Components;
using Shippo.Models.Errors;
using Shippo.Models.Requests;
using Shippo.Utils.Retries;
using Shippo.Utils;
using Shippo.Utils.Retries;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System;

/// <summary>
/// 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/>
Expand Down Expand Up @@ -111,10 +111,10 @@ public class Batches: IBatches
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "5.0.0-beta.9";
private const string _sdkGenVersion = "2.463.0";
private const string _sdkVersion = "5.0.0-beta.10";
private const string _sdkGenVersion = "2.506.0";
private const string _openapiDocVersion = "2018-02-08";
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.9 2.463.0 2018-02-08 Shippo";
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.10 2.506.0 2018-02-08 Shippo";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<Shippo.Models.Components.Security>? _securitySource;
Expand Down Expand Up @@ -201,7 +201,11 @@ public async Task<Batch> CreateAsync(BatchCreateRequest batchCreateRequest, stri

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -275,7 +279,11 @@ public async Task<Batch> GetAsync(GetBatchRequest request)

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -357,7 +365,11 @@ public async Task<Batch> AddShipmentsAsync(string batchId, List<BatchShipmentCre

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -432,7 +444,11 @@ public async Task<Batch> PurchaseAsync(string batchId, string? shippoApiVersion

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down Expand Up @@ -514,7 +530,11 @@ public async Task<Batch> RemoveShipmentsAsync(string batchId, List<string> reque

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
Expand Down
Loading

0 comments on commit d833798

Please sign in to comment.