diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f7395af..7a4d196 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 24fc7546-e445-46cb-91d2-49cbb44a86ac management: - docChecksum: 609002aee5b1500e5e73ec2eb80f268d + docChecksum: c1fbfc30ebe7e63d6f7b0d5603bf6099 docVersion: "2018-02-08" - speakeasyVersion: 1.300.1 - generationVersion: 2.339.1 - releaseVersion: 4.0.0 - configChecksum: b5e622d7d391f43a31161fe2b6f5be55 + speakeasyVersion: 1.308.1 + generationVersion: 2.342.6 + releaseVersion: 5.0.0-beta.1 + configChecksum: 4b61d37a92d42a0f787b98dc41e37eae repoURL: https://github.com/goshippo/shippo-csharp-sdk.git published: true features: csharp: additionalDependencies: 0.1.0 constsAndDefaults: 0.0.1 - core: 3.9.4 + core: 3.9.6 flattening: 2.81.2 globalSecurity: 2.83.4 globalSecurityCallbacks: 0.1.0 @@ -23,6 +23,7 @@ features: includes: 2.81.1 intellisenseMarkdownSupport: 0.1.0 nameOverrides: 2.81.2 + nullables: 0.1.0 responseFormat: 0.0.4 sdkHooks: 0.1.0 unions: 0.0.5 @@ -46,6 +47,7 @@ generatedFiles: - Shippo/Transactions.cs - Shippo/UserParcelTemplates.cs - Shippo/ShippoAccounts.cs + - Shippo/Webhooks.cs - Shippo/ShippoSDK.cs - global.json - Shippo/Utils/AnyDeserializer.cs @@ -68,10 +70,10 @@ generatedFiles: - Shippo/Shippo.csproj - Shippo/Models/Errors/SDKException.cs - Shippo/Models/Components/AddressPaginatedList.cs + - Shippo/Models/Components/Latitude.cs + - Shippo/Models/Components/Longitude.cs - Shippo/Models/Components/Address.cs - Shippo/Models/Components/AddressValidationResults.cs - - Shippo/Models/Components/Code.cs - - Shippo/Models/Components/Source.cs - Shippo/Models/Components/AddressValidationResultsMessage.cs - Shippo/Models/Components/AddressCreateRequest.cs - Shippo/Models/Components/ObjectResults.cs @@ -107,10 +109,12 @@ generatedFiles: - Shippo/Models/Components/CustomsDeclarationEelPfcEnum.cs - Shippo/Models/Components/CustomsDeclarationContentsTypeEnum.cs - Shippo/Models/Components/AddressImporter.cs + - Shippo/Models/Components/CustomsExporterIdentification.cs + - Shippo/Models/Components/CustomsTaxIdentificationType.cs + - Shippo/Models/Components/CustomsTaxIdentification.cs - Shippo/Models/Components/CustomsDeclarationB13AFilingOptionEnum.cs - Shippo/Models/Components/AncillaryEndorsement.cs - Shippo/Models/Components/DangerousGoodsCode.cs - - Shippo/Models/Components/LasershipAttrs.cs - Shippo/Models/Components/PreferredDeliveryTimeframe.cs - Shippo/Models/Components/ReturnServiceType.cs - Shippo/Models/Components/SignatureConfirmation.cs @@ -118,6 +122,7 @@ generatedFiles: - Shippo/Models/Components/UPSReferenceFields.cs - Shippo/Models/Components/RmaNumber.cs - Shippo/Models/Components/PoNumber.cs + - Shippo/Models/Components/ShipmentExtraLasershipAttributesEnum.cs - Shippo/Models/Components/InvoiceNumber.cs - Shippo/Models/Components/Provider.cs - Shippo/Models/Components/Insurance.cs @@ -180,13 +185,9 @@ generatedFiles: - Shippo/Models/Components/CarrierAccountUSPSCreateRequest.cs - Shippo/Models/Components/CarrierAccountRegistrationStatus.cs - Shippo/Models/Components/CustomsDeclarationPaginatedList.cs - - Shippo/Models/Components/CustomsDeclarationAddressImporter.cs - Shippo/Models/Components/CustomsDeclaration.cs - Shippo/Models/Components/ObjectStateEnum.cs - Shippo/Models/Components/CustomsInvoicedCharges.cs - - Shippo/Models/Components/CustomsExporterIdentification.cs - - Shippo/Models/Components/CustomsTaxIdentificationType.cs - - Shippo/Models/Components/CustomsTaxIdentification.cs - Shippo/Models/Components/CustomsItemPaginatedList.cs - Shippo/Models/Components/CustomsItem.cs - Shippo/Models/Components/LiveRatePaginatedList.cs @@ -251,6 +252,7 @@ generatedFiles: - Shippo/Models/Components/TrackingStatusLocationBase.cs - Shippo/Models/Components/TracksRequest.cs - Shippo/Models/Components/TransactionPaginatedList.cs + - Shippo/Models/Components/CreatedBy.cs - Shippo/Models/Components/TransactionRate.cs - Shippo/Models/Components/Transaction.cs - Shippo/Models/Components/TransactionStatusEnum.cs @@ -266,13 +268,20 @@ generatedFiles: - Shippo/Models/Components/ShippoAccountPaginatedList.cs - Shippo/Models/Components/ShippoAccount.cs - Shippo/Models/Components/ShippoAccountUpdateRequest.cs + - Shippo/Models/Components/Webhook.cs + - Shippo/Models/Components/WebhookUpdateRequest.cs + - Shippo/Models/Components/WebhookEventTypeEnum.cs + - Shippo/Models/Components/WebhookPaginatedList.cs - Shippo/Models/Components/Security.cs + - Shippo/Models/Components/AddressValidationResultsMessageCodeEnum.cs + - Shippo/Models/Components/AddressValidationResultsMessageSourceEnum.cs - Shippo/Models/Components/ServiceLevel.cs - Shippo/Models/Components/ServiceLevelSwyftEnum.cs - Shippo/Models/Components/ServiceLevelVehoEnum.cs - Shippo/Models/Components/ServiceLevelUDSEnum.cs - Shippo/Models/Components/ServiceLevelEvriUKEnum.cs - Shippo/Models/Components/ServiceLevelLasershipEnum.cs + - Shippo/Models/Components/ServiceLevelJitsuEnum.cs - Shippo/Models/Components/ServiceLevelOnTracEnum.cs - Shippo/Models/Components/ServiceLevelSendleEnum.cs - Shippo/Models/Components/ServiceLevelRoyalMailEnum.cs @@ -300,7 +309,6 @@ generatedFiles: - Shippo/Models/Components/ServiceLevelCanadaPostEnum.cs - Shippo/Models/Components/ServiceLevelBetterTrucksEnum.cs - Shippo/Models/Components/ServiceLevelAPGEnum.cs - - Shippo/Models/Components/ServiceLevelAxleHireEnum.cs - Shippo/Models/Components/ServiceLevelAustraliaPostEnum.cs - Shippo/Models/Components/ServiceLevelAsendiaEnum.cs - Shippo/Models/Components/ServiceLevelAPCPostalEnum.cs @@ -379,14 +387,17 @@ generatedFiles: - Shippo/Models/Requests/CreateShippoAccountRequest.cs - Shippo/Models/Requests/GetShippoAccountRequest.cs - Shippo/Models/Requests/UpdateShippoAccountRequest.cs + - Shippo/Models/Requests/GetWebhookRequest.cs + - Shippo/Models/Requests/UpdateWebhookRequest.cs + - Shippo/Models/Requests/DeleteWebhookRequest.cs - Shippo/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.cs - Shippo/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.cs - Shippo/Models/Errors/InitiateOauth2SigninResponseBody.cs - docs/Models/Components/AddressPaginatedList.md + - docs/Models/Components/Latitude.md + - docs/Models/Components/Longitude.md - docs/Models/Components/Address.md - docs/Models/Components/AddressValidationResults.md - - docs/Models/Components/Code.md - - docs/Models/Components/Source.md - docs/Models/Components/AddressValidationResultsMessage.md - docs/Models/Components/AddressCreateRequest.md - docs/Models/Components/ObjectResults.md @@ -422,10 +433,12 @@ generatedFiles: - docs/Models/Components/CustomsDeclarationEelPfcEnum.md - docs/Models/Components/CustomsDeclarationContentsTypeEnum.md - docs/Models/Components/AddressImporter.md + - docs/Models/Components/CustomsExporterIdentification.md + - docs/Models/Components/CustomsTaxIdentificationType.md + - docs/Models/Components/CustomsTaxIdentification.md - docs/Models/Components/CustomsDeclarationB13AFilingOptionEnum.md - docs/Models/Components/AncillaryEndorsement.md - docs/Models/Components/DangerousGoodsCode.md - - docs/Models/Components/LasershipAttrs.md - docs/Models/Components/PreferredDeliveryTimeframe.md - docs/Models/Components/ReturnServiceType.md - docs/Models/Components/SignatureConfirmation.md @@ -433,6 +446,7 @@ generatedFiles: - docs/Models/Components/UPSReferenceFields.md - docs/Models/Components/RmaNumber.md - docs/Models/Components/PoNumber.md + - docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md - docs/Models/Components/InvoiceNumber.md - docs/Models/Components/Provider.md - docs/Models/Components/Insurance.md @@ -495,13 +509,9 @@ generatedFiles: - docs/Models/Components/CarrierAccountUSPSCreateRequest.md - docs/Models/Components/CarrierAccountRegistrationStatus.md - docs/Models/Components/CustomsDeclarationPaginatedList.md - - docs/Models/Components/CustomsDeclarationAddressImporter.md - docs/Models/Components/CustomsDeclaration.md - docs/Models/Components/ObjectStateEnum.md - docs/Models/Components/CustomsInvoicedCharges.md - - docs/Models/Components/CustomsExporterIdentification.md - - docs/Models/Components/CustomsTaxIdentificationType.md - - docs/Models/Components/CustomsTaxIdentification.md - docs/Models/Components/CustomsItemPaginatedList.md - docs/Models/Components/CustomsItem.md - docs/Models/Components/LiveRatePaginatedList.md @@ -566,6 +576,7 @@ generatedFiles: - docs/Models/Components/TrackingStatusLocationBase.md - docs/Models/Components/TracksRequest.md - docs/Models/Components/TransactionPaginatedList.md + - docs/Models/Components/CreatedBy.md - docs/Models/Components/TransactionRate.md - docs/Models/Components/Transaction.md - docs/Models/Components/TransactionStatusEnum.md @@ -581,13 +592,20 @@ generatedFiles: - docs/Models/Components/ShippoAccountPaginatedList.md - docs/Models/Components/ShippoAccount.md - docs/Models/Components/ShippoAccountUpdateRequest.md + - docs/Models/Components/Webhook.md + - docs/Models/Components/WebhookUpdateRequest.md + - docs/Models/Components/WebhookEventTypeEnum.md + - docs/Models/Components/WebhookPaginatedList.md - docs/Models/Components/Security.md + - docs/Models/Components/AddressValidationResultsMessageCodeEnum.md + - docs/Models/Components/AddressValidationResultsMessageSourceEnum.md - docs/Models/Components/ServiceLevel.md - docs/Models/Components/ServiceLevelSwyftEnum.md - docs/Models/Components/ServiceLevelVehoEnum.md - docs/Models/Components/ServiceLevelUDSEnum.md - docs/Models/Components/ServiceLevelEvriUKEnum.md - docs/Models/Components/ServiceLevelLasershipEnum.md + - docs/Models/Components/ServiceLevelJitsuEnum.md - docs/Models/Components/ServiceLevelOnTracEnum.md - docs/Models/Components/ServiceLevelSendleEnum.md - docs/Models/Components/ServiceLevelRoyalMailEnum.md @@ -615,7 +633,6 @@ generatedFiles: - docs/Models/Components/ServiceLevelCanadaPostEnum.md - docs/Models/Components/ServiceLevelBetterTrucksEnum.md - docs/Models/Components/ServiceLevelAPGEnum.md - - docs/Models/Components/ServiceLevelAxleHireEnum.md - docs/Models/Components/ServiceLevelAustraliaPostEnum.md - docs/Models/Components/ServiceLevelAsendiaEnum.md - docs/Models/Components/ServiceLevelAPCPostalEnum.md @@ -694,6 +711,9 @@ generatedFiles: - docs/Models/Requests/CreateShippoAccountRequest.md - docs/Models/Requests/GetShippoAccountRequest.md - docs/Models/Requests/UpdateShippoAccountRequest.md + - docs/Models/Requests/GetWebhookRequest.md + - docs/Models/Requests/UpdateWebhookRequest.md + - docs/Models/Requests/DeleteWebhookRequest.md - docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md - docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.md - docs/Models/Errors/InitiateOauth2SigninResponseBody.md @@ -717,6 +737,7 @@ generatedFiles: - docs/sdks/transactions/README.md - docs/sdks/userparceltemplates/README.md - docs/sdks/shippoaccounts/README.md + - docs/sdks/webhooks/README.md - USAGE.md - .gitattributes - Shippo/Hooks/SDKHooks.cs diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7aa0dca..5564caa 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.300.1 +speakeasyVersion: 1.308.1 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:b9edc3a83d619350da5caf82f35d996554d04a459fcf497193853c88b5d18cc2 - sourceBlobDigest: sha256:cd8eceda62fcaf9ab122b31caa40ef92b5914431c6678b5625524e9ae16eb03c + sourceRevisionDigest: sha256:7a115fccb127306abfc1c5c7ee09720766322634d3be5bef650c2b654cb2c521 + sourceBlobDigest: sha256:37ca431d3da32a1f02999b9a92ec39a429237ef904da4f8d90fffe541361bfb8 tags: - latest - main @@ -11,8 +11,8 @@ targets: csharp: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:b9edc3a83d619350da5caf82f35d996554d04a459fcf497193853c88b5d18cc2 - sourceBlobDigest: sha256:cd8eceda62fcaf9ab122b31caa40ef92b5914431c6678b5625524e9ae16eb03c + sourceRevisionDigest: sha256:7a115fccb127306abfc1c5c7ee09720766322634d3be5bef650c2b654cb2c521 + sourceBlobDigest: sha256:37ca431d3da32a1f02999b9a92ec39a429237ef904da4f8d90fffe541361bfb8 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index c7d2895..6c251d3 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,14 @@ var res = await sdk.Addresses.ListAsync( * [Create](docs/sdks/shippoaccounts/README.md#create) - Create a Shippo Account * [Get](docs/sdks/shippoaccounts/README.md#get) - Retrieve a Shippo Account * [Update](docs/sdks/shippoaccounts/README.md#update) - Update a Shippo Account + +### [Webhooks](docs/sdks/webhooks/README.md) + +* [CreateWebhook](docs/sdks/webhooks/README.md#createwebhook) - Create a new webhook +* [ListWebhooks](docs/sdks/webhooks/README.md#listwebhooks) - List all webhooks +* [GetWebhook](docs/sdks/webhooks/README.md#getwebhook) - Retrieve a specific webhook +* [UpdateWebhook](docs/sdks/webhooks/README.md#updatewebhook) - Update an existing webhook +* [DeleteWebhook](docs/sdks/webhooks/README.md#deletewebhook) - Delete a specific webhook diff --git a/RELEASES.md b/RELEASES.md index 663e862..bb810e9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -18,4 +18,14 @@ Based on: ### Generated - [csharp v4.0.0] . ### Releases -- [NuGet v4.0.0] https://www.nuget.org/packages/Shippo/4.0.0 - . \ No newline at end of file +- [NuGet v4.0.0] https://www.nuget.org/packages/Shippo/4.0.0 - . + +## 2024-06-17 13:56:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.308.1 (2.342.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v5.0.0-beta.1] . +### Releases +- [NuGet v5.0.0-beta.1] https://www.nuget.org/packages/Shippo/5.0.0-beta.1 - . \ No newline at end of file diff --git a/Shippo/Addresses.cs b/Shippo/Addresses.cs index b931c12..a7da153 100644 --- a/Shippo/Addresses.cs +++ b/Shippo/Addresses.cs @@ -80,10 +80,10 @@ public class Addresses: IAddresses { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Batches.cs b/Shippo/Batches.cs index eec91f7..63781aa 100644 --- a/Shippo/Batches.cs +++ b/Shippo/Batches.cs @@ -111,10 +111,10 @@ public class Batches: IBatches { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/CarrierAccounts.cs b/Shippo/CarrierAccounts.cs index 62bad70..4de755f 100644 --- a/Shippo/CarrierAccounts.cs +++ b/Shippo/CarrierAccounts.cs @@ -113,10 +113,10 @@ public class CarrierAccounts: ICarrierAccounts { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/CarrierParcelTemplates.cs b/Shippo/CarrierParcelTemplates.cs index a8eaf06..4eac220 100644 --- a/Shippo/CarrierParcelTemplates.cs +++ b/Shippo/CarrierParcelTemplates.cs @@ -64,10 +64,10 @@ public class CarrierParcelTemplates: ICarrierParcelTemplates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/CustomsDeclarations.cs b/Shippo/CustomsDeclarations.cs index 311456d..f1c2e92 100644 --- a/Shippo/CustomsDeclarations.cs +++ b/Shippo/CustomsDeclarations.cs @@ -73,10 +73,10 @@ public class CustomsDeclarations: ICustomsDeclarations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/CustomsItems.cs b/Shippo/CustomsItems.cs index d70f98e..07ea3af 100644 --- a/Shippo/CustomsItems.cs +++ b/Shippo/CustomsItems.cs @@ -71,10 +71,10 @@ public class CustomsItems: ICustomsItems { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Manifests.cs b/Shippo/Manifests.cs index 8b03fef..2c2b29e 100644 --- a/Shippo/Manifests.cs +++ b/Shippo/Manifests.cs @@ -83,10 +83,10 @@ public class Manifests: IManifests { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Models/Components/Address.cs b/Shippo/Models/Components/Address.cs index 1387d91..80ae2ca 100644 --- a/Shippo/Models/Components/Address.cs +++ b/Shippo/Models/Components/Address.cs @@ -162,13 +162,13 @@ public class Address /// Latitude of address /// [JsonProperty("latitude")] - public double? Latitude { get; set; } + public Latitude? Latitude { get; set; } /// /// Longitude of address /// [JsonProperty("longitude")] - public double? Longitude { get; set; } + public Longitude? Longitude { get; set; } /// /// Date and time of Address creation. diff --git a/Shippo/Models/Components/AddressValidationResultsMessage.cs b/Shippo/Models/Components/AddressValidationResultsMessage.cs index 3d83de7..32f2815 100644 --- a/Shippo/Models/Components/AddressValidationResultsMessage.cs +++ b/Shippo/Models/Components/AddressValidationResultsMessage.cs @@ -10,17 +10,22 @@ namespace Shippo.Models.Components { using Newtonsoft.Json; - using Shippo.Models.Components; using Shippo.Utils; public class AddressValidationResultsMessage { + /// + /// See <a href="#tag/Address-Validation-Codes">Address Validation Codes</a> + /// [JsonProperty("code")] - public Code? Code { get; set; } + public string? Code { get; set; } + /// + /// See <a href="#tag/Address-Validation-Source">Address Validation Source</a> + /// [JsonProperty("source")] - public Source? Source { get; set; } + public string? Source { get; set; } [JsonProperty("text")] public string? Text { get; set; } diff --git a/Shippo/Models/Components/Code.cs b/Shippo/Models/Components/AddressValidationResultsMessageCodeEnum.cs similarity index 90% rename from Shippo/Models/Components/Code.cs rename to Shippo/Models/Components/AddressValidationResultsMessageCodeEnum.cs index d1dd625..b28b7f9 100644 --- a/Shippo/Models/Components/Code.cs +++ b/Shippo/Models/Components/AddressValidationResultsMessageCodeEnum.cs @@ -13,7 +13,7 @@ namespace Shippo.Models.Components using Shippo.Utils; using System; - public enum Code + public enum AddressValidationResultsMessageCodeEnum { [JsonProperty("verification_error")] VerificationError, @@ -137,16 +137,16 @@ public enum Code AmbiguousAddress, } - public static class CodeExtension + public static class AddressValidationResultsMessageCodeEnumExtension { - public static string Value(this Code value) + public static string Value(this AddressValidationResultsMessageCodeEnum value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static Code ToEnum(this string value) + public static AddressValidationResultsMessageCodeEnum ToEnum(this string value) { - foreach(var field in typeof(Code).GetFields()) + foreach(var field in typeof(AddressValidationResultsMessageCodeEnum).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -159,14 +159,14 @@ public static Code ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is Code) + if (enumVal is AddressValidationResultsMessageCodeEnum) { - return (Code)enumVal; + return (AddressValidationResultsMessageCodeEnum)enumVal; } } } - throw new Exception($"Unknown value {value} for enum Code"); + throw new Exception($"Unknown value {value} for enum AddressValidationResultsMessageCodeEnum"); } } diff --git a/Shippo/Models/Components/Source.cs b/Shippo/Models/Components/AddressValidationResultsMessageSourceEnum.cs similarity index 70% rename from Shippo/Models/Components/Source.cs rename to Shippo/Models/Components/AddressValidationResultsMessageSourceEnum.cs index 4e4e27d..487c216 100644 --- a/Shippo/Models/Components/Source.cs +++ b/Shippo/Models/Components/AddressValidationResultsMessageSourceEnum.cs @@ -13,7 +13,7 @@ namespace Shippo.Models.Components using Shippo.Utils; using System; - public enum Source + public enum AddressValidationResultsMessageSourceEnum { [JsonProperty("Shippo Address Validator")] ShippoAddressValidator, @@ -21,16 +21,16 @@ public enum Source Ups, } - public static class SourceExtension + public static class AddressValidationResultsMessageSourceEnumExtension { - public static string Value(this Source value) + public static string Value(this AddressValidationResultsMessageSourceEnum value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static Source ToEnum(this string value) + public static AddressValidationResultsMessageSourceEnum ToEnum(this string value) { - foreach(var field in typeof(Source).GetFields()) + foreach(var field in typeof(AddressValidationResultsMessageSourceEnum).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -43,14 +43,14 @@ public static Source ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is Source) + if (enumVal is AddressValidationResultsMessageSourceEnum) { - return (Source)enumVal; + return (AddressValidationResultsMessageSourceEnum)enumVal; } } } - throw new Exception($"Unknown value {value} for enum Source"); + throw new Exception($"Unknown value {value} for enum AddressValidationResultsMessageSourceEnum"); } } diff --git a/Shippo/Models/Components/CarriersEnum.cs b/Shippo/Models/Components/CarriersEnum.cs index 631fdd7..210f2f8 100644 --- a/Shippo/Models/Components/CarriersEnum.cs +++ b/Shippo/Models/Components/CarriersEnum.cs @@ -24,7 +24,7 @@ namespace Shippo.Models.Components /// | aramex | Aramex|
/// | asendia_us | Asendia US|
/// | australia_post | Australia Post (also used for Startrack)|
- /// | axlehire | Axlehire|
+ /// | axlehire | Jitsu|
/// | better_trucks | BetterTrucks|
/// | borderguru | BorderGuru|
/// | boxberry | Boxberry|
diff --git a/Shippo/Models/Components/CreatedBy.cs b/Shippo/Models/Components/CreatedBy.cs new file mode 100644 index 0000000..bf0e1b8 --- /dev/null +++ b/Shippo/Models/Components/CreatedBy.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json; + using Shippo.Utils; + + /// + /// An object with details about the user who created the Transaction (purchased the label).
+ /// + /// + /// A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in
+ /// user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken,
+ /// which is associated with the account but not any specific user. + ///
+ ///
+ public class CreatedBy + { + + [JsonProperty("first_name")] + public string? FirstName { get; set; } + + [JsonProperty("last_name")] + public string? LastName { get; set; } + + [JsonProperty("username")] + public string? Username { get; set; } + } +} \ No newline at end of file diff --git a/Shippo/Models/Components/CustomsDeclaration.cs b/Shippo/Models/Components/CustomsDeclaration.cs index 809833b..7d3d733 100644 --- a/Shippo/Models/Components/CustomsDeclaration.cs +++ b/Shippo/Models/Components/CustomsDeclaration.cs @@ -92,6 +92,12 @@ public class CustomsDeclaration [JsonProperty("disclaimer")] public string? Disclaimer { get; set; } + /// + /// Additional exporter identification that may be required to ship in certain countries + /// + [JsonProperty("exporter_identification")] + public CustomsExporterIdentification? ExporterIdentification { get; set; } + /// /// Exporter reference of an export shipment. /// @@ -108,7 +114,7 @@ public class CustomsDeclaration /// Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. ///
[JsonProperty("is_vat_collected")] - public object? IsVatCollected { get; set; } + public bool? IsVatCollected { get; set; } /// /// Invoice reference of the shipment. @@ -142,7 +148,7 @@ public class CustomsDeclaration /// Object ID of the Importer address. /// [JsonProperty("address_importer")] - public CustomsDeclarationAddressImporter? AddressImporter { get; set; } + public string? AddressImporter { get; set; } /// /// Type of goods of the shipment.
@@ -165,12 +171,6 @@ public class CustomsDeclaration [JsonProperty("eel_pfc")] public string? EelPfc { get; set; } - /// - /// Additional exporter identification that may be required to ship in certain countries - /// - [JsonProperty("exporter_identification")] - public CustomsExporterIdentification? ExporterIdentification { get; set; } - /// /// The incoterm reference of the shipment. FCA is available for DHL Express and FedEx only.
/// diff --git a/Shippo/Models/Components/CustomsDeclarationCreateRequest.cs b/Shippo/Models/Components/CustomsDeclarationCreateRequest.cs index e452e08..b187f25 100644 --- a/Shippo/Models/Components/CustomsDeclarationCreateRequest.cs +++ b/Shippo/Models/Components/CustomsDeclarationCreateRequest.cs @@ -83,6 +83,12 @@ public class CustomsDeclarationCreateRequest [JsonProperty("disclaimer")] public string? Disclaimer { get; set; } + /// + /// Additional exporter identification that may be required to ship in certain countries + /// + [JsonProperty("exporter_identification")] + public CustomsExporterIdentification? ExporterIdentification { get; set; } + /// /// Exporter reference of an export shipment. /// @@ -99,7 +105,7 @@ public class CustomsDeclarationCreateRequest /// Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. ///
[JsonProperty("is_vat_collected")] - public object? IsVatCollected { get; set; } + public bool? IsVatCollected { get; set; } /// /// Invoice reference of the shipment. diff --git a/Shippo/Models/Components/CustomsItem.cs b/Shippo/Models/Components/CustomsItem.cs index 6082e0c..5753cc6 100644 --- a/Shippo/Models/Components/CustomsItem.cs +++ b/Shippo/Models/Components/CustomsItem.cs @@ -73,6 +73,12 @@ public class CustomsItem [JsonProperty("sku_code")] public string? SkuCode { get; set; } + /// + /// HS code of the item, which is required by some carriers. + /// + [JsonProperty("hs_code")] + public string? HsCode { get; set; } + /// /// The tariff number of the item. /// diff --git a/Shippo/Models/Components/CustomsItemCreateRequest.cs b/Shippo/Models/Components/CustomsItemCreateRequest.cs index 0caa0d0..1cce17a 100644 --- a/Shippo/Models/Components/CustomsItemCreateRequest.cs +++ b/Shippo/Models/Components/CustomsItemCreateRequest.cs @@ -72,6 +72,12 @@ public class CustomsItemCreateRequest [JsonProperty("sku_code")] public string? SkuCode { get; set; } + /// + /// HS code of the item, which is required by some carriers. + /// + [JsonProperty("hs_code")] + public string? HsCode { get; set; } + /// /// The tariff number of the item. /// diff --git a/Shippo/Models/Components/Latitude.cs b/Shippo/Models/Components/Latitude.cs new file mode 100644 index 0000000..43cc0a6 --- /dev/null +++ b/Shippo/Models/Components/Latitude.cs @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json.Linq; + using Newtonsoft.Json; + using Shippo.Utils; + using System.Numerics; + using System; + + + public class LatitudeType + { + private LatitudeType(string value) { Value = value; } + + public string Value { get; private set; } + public static LatitudeType Number { get { return new LatitudeType("number"); } } + + public static LatitudeType Str { get { return new LatitudeType("str"); } } + + public static LatitudeType Null { get { return new LatitudeType("null"); } } + + public override string ToString() { return Value; } + public static implicit operator String(LatitudeType v) { return v.Value; } + public static LatitudeType FromString(string v) { + switch(v) { + case "number": return Number; + case "str": return Str; + case "null": return Null; + default: throw new ArgumentException("Invalid value for LatitudeType"); + } + } + public override bool Equals(object? obj) + { + if (obj == null || GetType() != obj.GetType()) + { + return false; + } + return Value.Equals(((LatitudeType)obj).Value); + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + } + + + [JsonConverter(typeof(Latitude.LatitudeConverter))] + public class Latitude { + public Latitude(LatitudeType type) { + Type = type; + } + public double? Number { get; set; } + public string? Str { get; set; } + + public LatitudeType Type { get; set; } + + + public static Latitude CreateNumber(double number) { + LatitudeType typ = LatitudeType.Number; + + Latitude res = new Latitude(typ); + res.Number = number; + return res; + } + + public static Latitude CreateStr(string str) { + LatitudeType typ = LatitudeType.Str; + + Latitude res = new Latitude(typ); + res.Str = str; + return res; + } + + public static Latitude CreateNull() { + LatitudeType typ = LatitudeType.Null; + return new Latitude(typ); + } + + public class LatitudeConverter : JsonConverter + { + + public override bool CanConvert(System.Type objectType) => objectType == typeof(Latitude); + + public override bool CanRead => true; + + public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer) + { + var json = JRaw.Create(reader).ToString(); + + if (json == "null") { + return null; + } + try { + var converted = Convert.ToDouble(json); + return new Latitude(LatitudeType.Number) { + Number = converted + }; + } catch (System.FormatException) { + // try next option + } + if (json[0] == '"' && json[^1] == '"'){ + return new Latitude(LatitudeType.Str) { + Str = json[1..^1] + }; + } + + throw new InvalidOperationException("Could not deserialize into any supported types."); + } + + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + if (value == null) { + writer.WriteRawValue("null"); + return; + } + Latitude res = (Latitude)value; + if (LatitudeType.FromString(res.Type).Equals(LatitudeType.Null)) + { + writer.WriteRawValue("null"); + return; + } + if (res.Number != null) + { + writer.WriteRawValue(Utilities.SerializeJSON(res.Number)); + return; + } + if (res.Str != null) + { + writer.WriteRawValue(Utilities.SerializeJSON(res.Str)); + return; + } + + } + } + + } + +} \ No newline at end of file diff --git a/Shippo/Models/Components/Longitude.cs b/Shippo/Models/Components/Longitude.cs new file mode 100644 index 0000000..50724ed --- /dev/null +++ b/Shippo/Models/Components/Longitude.cs @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json.Linq; + using Newtonsoft.Json; + using Shippo.Utils; + using System.Numerics; + using System; + + + public class LongitudeType + { + private LongitudeType(string value) { Value = value; } + + public string Value { get; private set; } + public static LongitudeType Number { get { return new LongitudeType("number"); } } + + public static LongitudeType Str { get { return new LongitudeType("str"); } } + + public static LongitudeType Null { get { return new LongitudeType("null"); } } + + public override string ToString() { return Value; } + public static implicit operator String(LongitudeType v) { return v.Value; } + public static LongitudeType FromString(string v) { + switch(v) { + case "number": return Number; + case "str": return Str; + case "null": return Null; + default: throw new ArgumentException("Invalid value for LongitudeType"); + } + } + public override bool Equals(object? obj) + { + if (obj == null || GetType() != obj.GetType()) + { + return false; + } + return Value.Equals(((LongitudeType)obj).Value); + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + } + + + [JsonConverter(typeof(Longitude.LongitudeConverter))] + public class Longitude { + public Longitude(LongitudeType type) { + Type = type; + } + public double? Number { get; set; } + public string? Str { get; set; } + + public LongitudeType Type { get; set; } + + + public static Longitude CreateNumber(double number) { + LongitudeType typ = LongitudeType.Number; + + Longitude res = new Longitude(typ); + res.Number = number; + return res; + } + + public static Longitude CreateStr(string str) { + LongitudeType typ = LongitudeType.Str; + + Longitude res = new Longitude(typ); + res.Str = str; + return res; + } + + public static Longitude CreateNull() { + LongitudeType typ = LongitudeType.Null; + return new Longitude(typ); + } + + public class LongitudeConverter : JsonConverter + { + + public override bool CanConvert(System.Type objectType) => objectType == typeof(Longitude); + + public override bool CanRead => true; + + public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer) + { + var json = JRaw.Create(reader).ToString(); + + if (json == "null") { + return null; + } + try { + var converted = Convert.ToDouble(json); + return new Longitude(LongitudeType.Number) { + Number = converted + }; + } catch (System.FormatException) { + // try next option + } + if (json[0] == '"' && json[^1] == '"'){ + return new Longitude(LongitudeType.Str) { + Str = json[1..^1] + }; + } + + throw new InvalidOperationException("Could not deserialize into any supported types."); + } + + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + if (value == null) { + writer.WriteRawValue("null"); + return; + } + Longitude res = (Longitude)value; + if (LongitudeType.FromString(res.Type).Equals(LongitudeType.Null)) + { + writer.WriteRawValue("null"); + return; + } + if (res.Number != null) + { + writer.WriteRawValue(Utilities.SerializeJSON(res.Number)); + return; + } + if (res.Str != null) + { + writer.WriteRawValue(Utilities.SerializeJSON(res.Str)); + return; + } + + } + } + + } + +} \ No newline at end of file diff --git a/Shippo/Models/Components/Rate.cs b/Shippo/Models/Components/Rate.cs index 4c1ad24..7aaa42c 100644 --- a/Shippo/Models/Components/Rate.cs +++ b/Shippo/Models/Components/Rate.cs @@ -102,7 +102,7 @@ public class Rate /// /// [JsonProperty("included_insurance_price")] - public double? IncludedInsurancePrice { get; set; } + public string? IncludedInsurancePrice { get; set; } [JsonProperty("messages")] public List? Messages { get; set; } diff --git a/Shippo/Models/Components/ServiceLevelEnumSet.cs b/Shippo/Models/Components/ServiceLevelEnumSet.cs index eecb76c..ec371d1 100644 --- a/Shippo/Models/Components/ServiceLevelEnumSet.cs +++ b/Shippo/Models/Components/ServiceLevelEnumSet.cs @@ -36,8 +36,6 @@ public class ServiceLevelEnumSetType public static ServiceLevelEnumSetType ServiceLevelAustraliaPostEnum { get { return new ServiceLevelEnumSetType("ServiceLevelAustraliaPostEnum"); } } - public static ServiceLevelEnumSetType ServiceLevelAxleHireEnum { get { return new ServiceLevelEnumSetType("ServiceLevelAxleHireEnum"); } } - public static ServiceLevelEnumSetType ServiceLevelAPGEnum { get { return new ServiceLevelEnumSetType("ServiceLevelAPGEnum"); } } public static ServiceLevelEnumSetType ServiceLevelBetterTrucksEnum { get { return new ServiceLevelEnumSetType("ServiceLevelBetterTrucksEnum"); } } @@ -92,6 +90,8 @@ public class ServiceLevelEnumSetType public static ServiceLevelEnumSetType ServiceLevelOnTracEnum { get { return new ServiceLevelEnumSetType("ServiceLevelOnTracEnum"); } } + public static ServiceLevelEnumSetType ServiceLevelJitsuEnum { get { return new ServiceLevelEnumSetType("ServiceLevelJitsuEnum"); } } + public static ServiceLevelEnumSetType ServiceLevelLasershipEnum { get { return new ServiceLevelEnumSetType("ServiceLevelLasershipEnum"); } } public static ServiceLevelEnumSetType ServiceLevelEvriUKEnum { get { return new ServiceLevelEnumSetType("ServiceLevelEvriUKEnum"); } } @@ -115,7 +115,6 @@ public static ServiceLevelEnumSetType FromString(string v) { case "ServiceLevelAPCPostalEnum": return ServiceLevelAPCPostalEnum; case "ServiceLevelAsendiaEnum": return ServiceLevelAsendiaEnum; case "ServiceLevelAustraliaPostEnum": return ServiceLevelAustraliaPostEnum; - case "ServiceLevelAxleHireEnum": return ServiceLevelAxleHireEnum; case "ServiceLevelAPGEnum": return ServiceLevelAPGEnum; case "ServiceLevelBetterTrucksEnum": return ServiceLevelBetterTrucksEnum; case "ServiceLevelCanadaPostEnum": return ServiceLevelCanadaPostEnum; @@ -143,6 +142,7 @@ public static ServiceLevelEnumSetType FromString(string v) { case "ServiceLevelRoyalMailEnum": return ServiceLevelRoyalMailEnum; case "ServiceLevelSendleEnum": return ServiceLevelSendleEnum; case "ServiceLevelOnTracEnum": return ServiceLevelOnTracEnum; + case "ServiceLevelJitsuEnum": return ServiceLevelJitsuEnum; case "ServiceLevelLasershipEnum": return ServiceLevelLasershipEnum; case "ServiceLevelEvriUKEnum": return ServiceLevelEvriUKEnum; case "ServiceLevelUDSEnum": return ServiceLevelUDSEnum; @@ -180,7 +180,6 @@ public ServiceLevelEnumSet(ServiceLevelEnumSetType type) { public ServiceLevelAPCPostalEnum? ServiceLevelAPCPostalEnum { get; set; } public ServiceLevelAsendiaEnum? ServiceLevelAsendiaEnum { get; set; } public ServiceLevelAustraliaPostEnum? ServiceLevelAustraliaPostEnum { get; set; } - public ServiceLevelAxleHireEnum? ServiceLevelAxleHireEnum { get; set; } public ServiceLevelAPGEnum? ServiceLevelAPGEnum { get; set; } public ServiceLevelBetterTrucksEnum? ServiceLevelBetterTrucksEnum { get; set; } public ServiceLevelCanadaPostEnum? ServiceLevelCanadaPostEnum { get; set; } @@ -208,6 +207,7 @@ public ServiceLevelEnumSet(ServiceLevelEnumSetType type) { public ServiceLevelRoyalMailEnum? ServiceLevelRoyalMailEnum { get; set; } public ServiceLevelSendleEnum? ServiceLevelSendleEnum { get; set; } public ServiceLevelOnTracEnum? ServiceLevelOnTracEnum { get; set; } + public ServiceLevelJitsuEnum? ServiceLevelJitsuEnum { get; set; } public ServiceLevelLasershipEnum? ServiceLevelLasershipEnum { get; set; } public ServiceLevelEvriUKEnum? ServiceLevelEvriUKEnum { get; set; } public ServiceLevelUDSEnum? ServiceLevelUDSEnum { get; set; } @@ -273,14 +273,6 @@ public static ServiceLevelEnumSet CreateServiceLevelAustraliaPostEnum(ServiceLev return res; } - public static ServiceLevelEnumSet CreateServiceLevelAxleHireEnum(ServiceLevelAxleHireEnum serviceLevelAxleHireEnum) { - ServiceLevelEnumSetType typ = ServiceLevelEnumSetType.ServiceLevelAxleHireEnum; - - ServiceLevelEnumSet res = new ServiceLevelEnumSet(typ); - res.ServiceLevelAxleHireEnum = serviceLevelAxleHireEnum; - return res; - } - public static ServiceLevelEnumSet CreateServiceLevelAPGEnum(ServiceLevelAPGEnum serviceLevelAPGEnum) { ServiceLevelEnumSetType typ = ServiceLevelEnumSetType.ServiceLevelAPGEnum; @@ -497,6 +489,14 @@ public static ServiceLevelEnumSet CreateServiceLevelOnTracEnum(ServiceLevelOnTra return res; } + public static ServiceLevelEnumSet CreateServiceLevelJitsuEnum(ServiceLevelJitsuEnum serviceLevelJitsuEnum) { + ServiceLevelEnumSetType typ = ServiceLevelEnumSetType.ServiceLevelJitsuEnum; + + ServiceLevelEnumSet res = new ServiceLevelEnumSet(typ); + res.ServiceLevelJitsuEnum = serviceLevelJitsuEnum; + return res; + } + public static ServiceLevelEnumSet CreateServiceLevelLasershipEnum(ServiceLevelLasershipEnum serviceLevelLasershipEnum) { ServiceLevelEnumSetType typ = ServiceLevelEnumSetType.ServiceLevelLasershipEnum; @@ -648,19 +648,6 @@ public class ServiceLevelEnumSetConverter : JsonConverter } } try - { - ServiceLevelAxleHireEnum? serviceLevelAxleHireEnum = ResponseBodyDeserializer.Deserialize(json, missingMemberHandling: MissingMemberHandling.Error); - return new ServiceLevelEnumSet(ServiceLevelEnumSetType.ServiceLevelAxleHireEnum) { - ServiceLevelAxleHireEnum = serviceLevelAxleHireEnum - }; - } - catch (Exception ex) - { - if (!(ex is Newtonsoft.Json.JsonReaderException || ex is Newtonsoft.Json.JsonSerializationException)) { - throw ex; - } - } - try { ServiceLevelAPGEnum? serviceLevelAPGEnum = ResponseBodyDeserializer.Deserialize(json, missingMemberHandling: MissingMemberHandling.Error); return new ServiceLevelEnumSet(ServiceLevelEnumSetType.ServiceLevelAPGEnum) { @@ -1012,6 +999,19 @@ public class ServiceLevelEnumSetConverter : JsonConverter } } try + { + ServiceLevelJitsuEnum? serviceLevelJitsuEnum = ResponseBodyDeserializer.Deserialize(json, missingMemberHandling: MissingMemberHandling.Error); + return new ServiceLevelEnumSet(ServiceLevelEnumSetType.ServiceLevelJitsuEnum) { + ServiceLevelJitsuEnum = serviceLevelJitsuEnum + }; + } + catch (Exception ex) + { + if (!(ex is Newtonsoft.Json.JsonReaderException || ex is Newtonsoft.Json.JsonSerializationException)) { + throw ex; + } + } + try { ServiceLevelLasershipEnum? serviceLevelLasershipEnum = ResponseBodyDeserializer.Deserialize(json, missingMemberHandling: MissingMemberHandling.Error); return new ServiceLevelEnumSet(ServiceLevelEnumSetType.ServiceLevelLasershipEnum) { @@ -1127,11 +1127,6 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelAustraliaPostEnum)); return; } - if (res.ServiceLevelAxleHireEnum != null) - { - writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelAxleHireEnum)); - return; - } if (res.ServiceLevelAPGEnum != null) { writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelAPGEnum)); @@ -1267,6 +1262,11 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelOnTracEnum)); return; } + if (res.ServiceLevelJitsuEnum != null) + { + writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelJitsuEnum)); + return; + } if (res.ServiceLevelLasershipEnum != null) { writer.WriteRawValue(Utilities.SerializeJSON(res.ServiceLevelLasershipEnum)); diff --git a/Shippo/Models/Components/ServiceLevelAxleHireEnum.cs b/Shippo/Models/Components/ServiceLevelJitsuEnum.cs similarity index 78% rename from Shippo/Models/Components/ServiceLevelAxleHireEnum.cs rename to Shippo/Models/Components/ServiceLevelJitsuEnum.cs index 9034771..723c095 100644 --- a/Shippo/Models/Components/ServiceLevelAxleHireEnum.cs +++ b/Shippo/Models/Components/ServiceLevelJitsuEnum.cs @@ -23,7 +23,7 @@ namespace Shippo.Models.Components /// /// ///
- public enum ServiceLevelAxleHireEnum + public enum ServiceLevelJitsuEnum { [JsonProperty("axlehire_same_day")] AxlehireSameDay, @@ -31,16 +31,16 @@ public enum ServiceLevelAxleHireEnum AxlehireNextDay, } - public static class ServiceLevelAxleHireEnumExtension + public static class ServiceLevelJitsuEnumExtension { - public static string Value(this ServiceLevelAxleHireEnum value) + public static string Value(this ServiceLevelJitsuEnum value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static ServiceLevelAxleHireEnum ToEnum(this string value) + public static ServiceLevelJitsuEnum ToEnum(this string value) { - foreach(var field in typeof(ServiceLevelAxleHireEnum).GetFields()) + foreach(var field in typeof(ServiceLevelJitsuEnum).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -53,14 +53,14 @@ public static ServiceLevelAxleHireEnum ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is ServiceLevelAxleHireEnum) + if (enumVal is ServiceLevelJitsuEnum) { - return (ServiceLevelAxleHireEnum)enumVal; + return (ServiceLevelJitsuEnum)enumVal; } } } - throw new Exception($"Unknown value {value} for enum ServiceLevelAxleHireEnum"); + throw new Exception($"Unknown value {value} for enum ServiceLevelJitsuEnum"); } } diff --git a/Shippo/Models/Components/ShipmentExtra.cs b/Shippo/Models/Components/ShipmentExtra.cs index c5716d8..cef7551 100644 --- a/Shippo/Models/Components/ShipmentExtra.cs +++ b/Shippo/Models/Components/ShipmentExtra.cs @@ -12,6 +12,7 @@ namespace Shippo.Models.Components using Newtonsoft.Json; using Shippo.Models.Components; using Shippo.Utils; + using System.Collections.Generic; /// /// An object holding optional extra services to be requested. @@ -187,7 +188,7 @@ public class ShipmentExtra /// Specify Lasership Attributes (Lasership only). Multiple options accepted. /// [JsonProperty("lasership_attrs")] - public LasershipAttrs? LasershipAttrs { get; set; } + public List? LasershipAttrs { get; set; } /// /// Declared value (Lasership only). Defaults to `50.00`. diff --git a/Shippo/Models/Components/LasershipAttrs.cs b/Shippo/Models/Components/ShipmentExtraLasershipAttributesEnum.cs similarity index 76% rename from Shippo/Models/Components/LasershipAttrs.cs rename to Shippo/Models/Components/ShipmentExtraLasershipAttributesEnum.cs index f662ecb..7a74e4c 100644 --- a/Shippo/Models/Components/LasershipAttrs.cs +++ b/Shippo/Models/Components/ShipmentExtraLasershipAttributesEnum.cs @@ -13,10 +13,7 @@ namespace Shippo.Models.Components using Shippo.Utils; using System; - /// - /// Specify Lasership Attributes (Lasership only). Multiple options accepted. - /// - public enum LasershipAttrs + public enum ShipmentExtraLasershipAttributesEnum { [JsonProperty("TwoPersonDelivery")] TwoPersonDelivery, @@ -38,16 +35,16 @@ public enum LasershipAttrs NoRTS, } - public static class LasershipAttrsExtension + public static class ShipmentExtraLasershipAttributesEnumExtension { - public static string Value(this LasershipAttrs value) + public static string Value(this ShipmentExtraLasershipAttributesEnum value) { return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); } - public static LasershipAttrs ToEnum(this string value) + public static ShipmentExtraLasershipAttributesEnum ToEnum(this string value) { - foreach(var field in typeof(LasershipAttrs).GetFields()) + foreach(var field in typeof(ShipmentExtraLasershipAttributesEnum).GetFields()) { var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); if (attributes.Length == 0) @@ -60,14 +57,14 @@ public static LasershipAttrs ToEnum(this string value) { var enumVal = field.GetValue(null); - if (enumVal is LasershipAttrs) + if (enumVal is ShipmentExtraLasershipAttributesEnum) { - return (LasershipAttrs)enumVal; + return (ShipmentExtraLasershipAttributesEnum)enumVal; } } } - throw new Exception($"Unknown value {value} for enum LasershipAttrs"); + throw new Exception($"Unknown value {value} for enum ShipmentExtraLasershipAttributesEnum"); } } diff --git a/Shippo/Models/Components/Transaction.cs b/Shippo/Models/Components/Transaction.cs index f1faa8a..e2ccae6 100644 --- a/Shippo/Models/Components/Transaction.cs +++ b/Shippo/Models/Components/Transaction.cs @@ -28,6 +28,9 @@ public class Transaction [JsonProperty("commercial_invoice_url")] public string? CommercialInvoiceUrl { get; set; } + [JsonProperty("created_by")] + public CreatedBy? CreatedBy { get; set; } = null; + /// /// The estimated time of arrival according to the carrier. /// diff --git a/Shippo/Models/Components/Webhook.cs b/Shippo/Models/Components/Webhook.cs new file mode 100644 index 0000000..9bc6765 --- /dev/null +++ b/Shippo/Models/Components/Webhook.cs @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json; + using Shippo.Utils; + using System; + + public class Webhook + { + + /// + /// Type of event that triggers the webhook. + /// + [JsonProperty("event")] + public string Event { get; set; } = default!; + + /// + /// URL webhook events are sent to. + /// + [JsonProperty("url")] + public string Url { get; set; } = default!; + + /// + /// Determines whether the webhook is active or not. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// Determines whether the webhook is a test webhook or not. + /// + [JsonProperty("is_test")] + public bool? IsTest { get; set; } + + /// + /// Timestamp of the creation of the webhook. + /// + [JsonProperty("object_created")] + public DateTime? ObjectCreated { get; set; } + + /// + /// Unique identifier of the webhook. This can be used to retrieve or delete the webhook. + /// + [JsonProperty("object_id")] + public string? ObjectId { get; set; } + + /// + /// Timestamp of the last update of the webhook. + /// + [JsonProperty("object_updated")] + public DateTime? ObjectUpdated { get; set; } + + /// + /// Username of the user who created the webhook. + /// + [JsonProperty("object_owner")] + public string? ObjectOwner { get; set; } + } +} \ No newline at end of file diff --git a/Shippo/Models/Components/WebhookEventTypeEnum.cs b/Shippo/Models/Components/WebhookEventTypeEnum.cs new file mode 100644 index 0000000..29d139a --- /dev/null +++ b/Shippo/Models/Components/WebhookEventTypeEnum.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json; + using Shippo.Utils; + using System; + + public enum WebhookEventTypeEnum + { + [JsonProperty("transaction_created")] + TransactionCreated, + [JsonProperty("transaction_updated")] + TransactionUpdated, + [JsonProperty("track_updated")] + TrackUpdated, + [JsonProperty("batch_created")] + BatchCreated, + [JsonProperty("batch_purchased")] + BatchPurchased, + } + + public static class WebhookEventTypeEnumExtension + { + public static string Value(this WebhookEventTypeEnum value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static WebhookEventTypeEnum ToEnum(this string value) + { + foreach(var field in typeof(WebhookEventTypeEnum).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is WebhookEventTypeEnum) + { + return (WebhookEventTypeEnum)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum WebhookEventTypeEnum"); + } + } + +} \ No newline at end of file diff --git a/Shippo/Models/Components/WebhookPaginatedList.cs b/Shippo/Models/Components/WebhookPaginatedList.cs new file mode 100644 index 0000000..05404d1 --- /dev/null +++ b/Shippo/Models/Components/WebhookPaginatedList.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json; + using Shippo.Models.Components; + using Shippo.Utils; + using System.Collections.Generic; + + public class WebhookPaginatedList + { + + [JsonProperty("next")] + public string? Next { get; set; } + + [JsonProperty("previous")] + public string? Previous { get; set; } + + [JsonProperty("count")] + public long? Count { get; set; } + + [JsonProperty("results")] + public List? Results { get; set; } + } +} \ No newline at end of file diff --git a/Shippo/Models/Components/WebhookUpdateRequest.cs b/Shippo/Models/Components/WebhookUpdateRequest.cs new file mode 100644 index 0000000..983ee7e --- /dev/null +++ b/Shippo/Models/Components/WebhookUpdateRequest.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Components +{ + using Newtonsoft.Json; + using Shippo.Models.Components; + using Shippo.Utils; + + public class WebhookUpdateRequest + { + + [JsonProperty("event")] + public WebhookEventTypeEnum Event { get; set; } = default!; + + /// + /// URL webhook events are sent to. + /// + [JsonProperty("url")] + public string Url { get; set; } = default!; + + /// + /// Determines whether the webhook is active or not. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// Determines whether the webhook is a test webhook or not. + /// + [JsonProperty("is_test")] + public bool? IsTest { get; set; } + } +} \ No newline at end of file diff --git a/Shippo/Models/Requests/DeleteWebhookRequest.cs b/Shippo/Models/Requests/DeleteWebhookRequest.cs new file mode 100644 index 0000000..ea2d989 --- /dev/null +++ b/Shippo/Models/Requests/DeleteWebhookRequest.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Requests +{ + using Shippo.Utils; + + public class DeleteWebhookRequest + { + + /// + /// Object ID of the webhook to delete + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=webhookId")] + public string WebhookId { get; set; } = default!; + } +} \ No newline at end of file diff --git a/Shippo/Models/Components/CustomsDeclarationAddressImporter.cs b/Shippo/Models/Requests/GetWebhookRequest.cs similarity index 59% rename from Shippo/Models/Components/CustomsDeclarationAddressImporter.cs rename to Shippo/Models/Requests/GetWebhookRequest.cs index 0286e92..23043e6 100644 --- a/Shippo/Models/Components/CustomsDeclarationAddressImporter.cs +++ b/Shippo/Models/Requests/GetWebhookRequest.cs @@ -7,14 +7,17 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Shippo.Models.Components +namespace Shippo.Models.Requests { using Shippo.Utils; - /// - /// Object ID of the Importer address. - /// - public class CustomsDeclarationAddressImporter + public class GetWebhookRequest { + + /// + /// Object ID of the webhook to retrieve + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=webhookId")] + public string WebhookId { get; set; } = default!; } } \ No newline at end of file diff --git a/Shippo/Models/Requests/UpdateWebhookRequest.cs b/Shippo/Models/Requests/UpdateWebhookRequest.cs new file mode 100644 index 0000000..7bf522b --- /dev/null +++ b/Shippo/Models/Requests/UpdateWebhookRequest.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo.Models.Requests +{ + using Shippo.Models.Components; + using Shippo.Utils; + + public class UpdateWebhookRequest + { + + /// + /// Object ID of the webhook to retrieve + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=webhookId")] + public string WebhookId { get; set; } = default!; + + [SpeakeasyMetadata("request:mediaType=application/json")] + public WebhookUpdateRequest WebhookUpdateRequest { get; set; } = default!; + } +} \ No newline at end of file diff --git a/Shippo/Orders.cs b/Shippo/Orders.cs index b690929..6d7bf2d 100644 --- a/Shippo/Orders.cs +++ b/Shippo/Orders.cs @@ -93,10 +93,10 @@ public class Orders: IOrders { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Parcels.cs b/Shippo/Parcels.cs index f09fa4e..516a260 100644 --- a/Shippo/Parcels.cs +++ b/Shippo/Parcels.cs @@ -79,10 +79,10 @@ public class Parcels: IParcels { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Pickups.cs b/Shippo/Pickups.cs index 0e3de90..5c64623 100644 --- a/Shippo/Pickups.cs +++ b/Shippo/Pickups.cs @@ -55,10 +55,10 @@ public class Pickups: IPickups { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Rates.cs b/Shippo/Rates.cs index 134685c..bdc6910 100644 --- a/Shippo/Rates.cs +++ b/Shippo/Rates.cs @@ -77,10 +77,10 @@ public class Rates: IRates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/RatesAtCheckout.cs b/Shippo/RatesAtCheckout.cs index 9d53d22..81be9a2 100644 --- a/Shippo/RatesAtCheckout.cs +++ b/Shippo/RatesAtCheckout.cs @@ -97,10 +97,10 @@ public class RatesAtCheckout: IRatesAtCheckout { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Refunds.cs b/Shippo/Refunds.cs index 7229969..8c1cb7c 100644 --- a/Shippo/Refunds.cs +++ b/Shippo/Refunds.cs @@ -71,10 +71,10 @@ public class Refunds: IRefunds { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/ServiceGroups.cs b/Shippo/ServiceGroups.cs index 0a7ca54..f559b44 100644 --- a/Shippo/ServiceGroups.cs +++ b/Shippo/ServiceGroups.cs @@ -82,10 +82,10 @@ public class ServiceGroups: IServiceGroups { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Shipments.cs b/Shippo/Shipments.cs index 46acfe8..3333728 100644 --- a/Shippo/Shipments.cs +++ b/Shippo/Shipments.cs @@ -96,10 +96,10 @@ public class Shipments: IShipments { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Shippo.csproj b/Shippo/Shippo.csproj index d1b9a53..b7065a8 100644 --- a/Shippo/Shippo.csproj +++ b/Shippo/Shippo.csproj @@ -2,7 +2,7 @@ true Shippo - 4.0.0 + 5.0.0-beta.1 Shippo net6.0 enable diff --git a/Shippo/ShippoAccounts.cs b/Shippo/ShippoAccounts.cs index e3a7360..7952687 100644 --- a/Shippo/ShippoAccounts.cs +++ b/Shippo/ShippoAccounts.cs @@ -84,10 +84,10 @@ public class ShippoAccounts: IShippoAccounts { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/ShippoSDK.cs b/Shippo/ShippoSDK.cs index 24ba45b..8d4f675 100644 --- a/Shippo/ShippoSDK.cs +++ b/Shippo/ShippoSDK.cs @@ -257,6 +257,15 @@ public interface IShippoSDK /// /// public IShippoAccounts ShippoAccounts { get; } + + /// + /// Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database.
+ /// + /// + /// <SchemaDefinition schemaRef="#/components/schemas/Webhook"/> + /// + ///
+ public IWebhooks Webhooks { get; } } public class SDKConfig @@ -303,10 +312,10 @@ public class ShippoSDK: IShippoSDK public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private int _serverIndex = 0; private ISpeakeasyHttpClient _client; @@ -330,6 +339,7 @@ public class ShippoSDK: IShippoSDK public ITransactions Transactions { get; private set; } public IUserParcelTemplates UserParcelTemplates { get; private set; } public IShippoAccounts ShippoAccounts { get; private set; } + public IWebhooks Webhooks { get; private set; } public ShippoSDK(string? apiKeyHeader = null, Func? apiKeyHeaderSource = null, string? shippoApiVersion = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) { @@ -432,6 +442,9 @@ public ShippoSDK(string? apiKeyHeader = null, Func? apiKeyHeaderSource = ShippoAccounts = new ShippoAccounts(_client, _securitySource, _serverUrl, SDKConfiguration); + + + Webhooks = new Webhooks(_client, _securitySource, _serverUrl, SDKConfiguration); } } } \ No newline at end of file diff --git a/Shippo/TrackingStatus.cs b/Shippo/TrackingStatus.cs index 3b3d455..bfed507 100644 --- a/Shippo/TrackingStatus.cs +++ b/Shippo/TrackingStatus.cs @@ -80,10 +80,10 @@ public class TrackingStatus: ITrackingStatus { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Transactions.cs b/Shippo/Transactions.cs index 5c8dc67..da85be0 100644 --- a/Shippo/Transactions.cs +++ b/Shippo/Transactions.cs @@ -71,10 +71,10 @@ public class Transactions: ITransactions { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/UserParcelTemplates.cs b/Shippo/UserParcelTemplates.cs index f93b009..abeaf76 100644 --- a/Shippo/UserParcelTemplates.cs +++ b/Shippo/UserParcelTemplates.cs @@ -106,10 +106,10 @@ public class UserParcelTemplates: IUserParcelTemplates { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "4.0.0"; - private const string _sdkGenVersion = "2.339.1"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; private const string _openapiDocVersion = "2018-02-08"; - private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.339.1 2018-02-08 Shippo"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; diff --git a/Shippo/Utils/SpeakeasyHttpClient.cs b/Shippo/Utils/SpeakeasyHttpClient.cs index f2fb1ac..17a97fc 100644 --- a/Shippo/Utils/SpeakeasyHttpClient.cs +++ b/Shippo/Utils/SpeakeasyHttpClient.cs @@ -35,7 +35,7 @@ public interface ISpeakeasyHttpClient Task CloneAsync(HttpRequestMessage request); } - internal class SpeakeasyHttpClient : ISpeakeasyHttpClient + public class SpeakeasyHttpClient : ISpeakeasyHttpClient { protected readonly HttpClient httpClient; diff --git a/Shippo/Webhooks.cs b/Shippo/Webhooks.cs new file mode 100644 index 0000000..2c875ee --- /dev/null +++ b/Shippo/Webhooks.cs @@ -0,0 +1,470 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Shippo +{ + using Newtonsoft.Json; + using Shippo.Hooks; + using Shippo.Models.Components; + using Shippo.Models.Errors; + using Shippo.Models.Requests; + using Shippo.Utils.Retries; + using Shippo.Utils; + using System.Collections.Generic; + using System.Net.Http.Headers; + using System.Net.Http; + using System.Threading.Tasks; + using System; + + /// + /// Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database.
+ /// + /// + /// <SchemaDefinition schemaRef="#/components/schemas/Webhook"/> + /// + ///
+ public interface IWebhooks + { + + /// + /// Create a new webhook + /// + /// + /// Creates a new webhook to send notifications to a URL when a specific event occurs. + /// + /// + Task CreateWebhookAsync(WebhookUpdateRequest request); + + /// + /// List all webhooks + /// + /// + /// Returns a list of all webhooks you have created. + /// + /// + Task ListWebhooksAsync(); + + /// + /// Retrieve a specific webhook + /// + /// + /// Returns the details of a specific webhook using the webhook object ID. + /// + /// + Task GetWebhookAsync(string webhookId); + + /// + /// Update an existing webhook + /// + /// + /// Updates an existing webhook using the webhook object ID. + /// + /// + Task UpdateWebhookAsync(string webhookId, WebhookUpdateRequest webhookUpdateRequest); + + /// + /// Delete a specific webhook + /// + /// + /// Deletes a specific webhook using the webhook object ID. + /// + /// + Task DeleteWebhookAsync(string webhookId); + } + + /// + /// Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database.
+ /// + /// + /// <SchemaDefinition schemaRef="#/components/schemas/Webhook"/> + /// + ///
+ public class Webhooks: IWebhooks + { + public SDKConfig SDKConfiguration { get; private set; } + private const string _language = "csharp"; + private const string _sdkVersion = "5.0.0-beta.1"; + private const string _sdkGenVersion = "2.342.6"; + private const string _openapiDocVersion = "2018-02-08"; + private const string _userAgent = "speakeasy-sdk/csharp 5.0.0-beta.1 2.342.6 2018-02-08 Shippo"; + private string _serverUrl = ""; + private ISpeakeasyHttpClient _client; + private Func? _securitySource; + + public Webhooks(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + { + _client = client; + _securitySource = securitySource; + _serverUrl = serverUrl; + SDKConfiguration = config; + } + + public async Task CreateWebhookAsync(WebhookUpdateRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/webhooks"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("createWebhook", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 201) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + return obj!; + } + throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else + { + throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } + + public async Task ListWebhooksAsync() + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/webhooks"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("listWebhooks", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + return obj!; + } + throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else + { + throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } + + public async Task GetWebhookAsync(string webhookId) + { + var request = new GetWebhookRequest() + { + WebhookId = webhookId, + }; + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/webhooks/{webhookId}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("getWebhook", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + return obj!; + } + throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else + { + throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } + + public async Task UpdateWebhookAsync(string webhookId, WebhookUpdateRequest webhookUpdateRequest) + { + var request = new UpdateWebhookRequest() + { + WebhookId = webhookId, + WebhookUpdateRequest = webhookUpdateRequest, + }; + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/webhooks/{webhookId}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "WebhookUpdateRequest", "json", false, false); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("updateWebhook", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + return obj!; + } + throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else + { + throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } + + public async Task DeleteWebhookAsync(string webhookId) + { + var request = new DeleteWebhookRequest() + { + WebhookId = webhookId, + }; + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/webhooks/{webhookId}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); + httpRequest.Headers.Add("user-agent", _userAgent); + + if (_securitySource != null) + { + httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + } + + var hookCtx = new HookContext("deleteWebhook", null, _securitySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await _client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 204) + { + return; + } + else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else + { + throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } + } +} \ No newline at end of file diff --git a/docs/Models/Components/Address.md b/docs/Models/Components/Address.md index 4541ee9..1c828bf 100644 --- a/docs/Models/Components/Address.md +++ b/docs/Models/Components/Address.md @@ -22,8 +22,8 @@ Address represents the address as retrieved from the database | `IsResidential` | *bool* | :heavy_minus_sign: | N/A | true | | `Metadata` | *string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | | `IsComplete` | *bool* | :heavy_minus_sign: | Complete addresses contain all required values.

Incomplete addresses have failed one or multiple
validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required
value for purchasing labels. | true | -| `Latitude` | *double* | :heavy_minus_sign: | Latitude of address | | -| `Longitude` | *double* | :heavy_minus_sign: | Longitude of address | | +| `Latitude` | [Latitude](../../Models/Components/Latitude.md) | :heavy_minus_sign: | Latitude of address | | +| `Longitude` | [Longitude](../../Models/Components/Longitude.md) | :heavy_minus_sign: | Longitude of address | | | `ObjectCreated` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | Date and time of Address creation. | 2014-07-09T02:19:13.174Z | | `ObjectId` | *string* | :heavy_minus_sign: | Unique identifier of the given Address object.
This ID is required to create a Shipment object. | d799c2679e644279b59fe661ac8fa488 | | `ObjectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the Address object. | shippotle@shippo.com | diff --git a/docs/Models/Components/AddressValidationResultsMessage.md b/docs/Models/Components/AddressValidationResultsMessage.md index 18074f8..c33fd5b 100644 --- a/docs/Models/Components/AddressValidationResultsMessage.md +++ b/docs/Models/Components/AddressValidationResultsMessage.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Code` | [Code](../../Models/Components/Code.md) | :heavy_minus_sign: | N/A | Unknown Street | -| `Source` | [Source](../../Models/Components/Source.md) | :heavy_minus_sign: | N/A | Shippo Address Validator | -| `Text` | *string* | :heavy_minus_sign: | N/A | City, State and ZIP Code are valid, but street address is not a match. | -| `Type` | *string* | :heavy_minus_sign: | N/A | address_warning | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Code` | *string* | :heavy_minus_sign: | See Address Validation Codes | Unknown Street | +| `Source` | *string* | :heavy_minus_sign: | See Address Validation Source | Shippo Address Validator | +| `Text` | *string* | :heavy_minus_sign: | N/A | City, State and ZIP Code are valid, but street address is not a match. | +| `Type` | *string* | :heavy_minus_sign: | N/A | address_warning | \ No newline at end of file diff --git a/docs/Models/Components/Code.md b/docs/Models/Components/AddressValidationResultsMessageCodeEnum.md similarity index 99% rename from docs/Models/Components/Code.md rename to docs/Models/Components/AddressValidationResultsMessageCodeEnum.md index 324bba8..d39ab66 100644 --- a/docs/Models/Components/Code.md +++ b/docs/Models/Components/AddressValidationResultsMessageCodeEnum.md @@ -1,4 +1,4 @@ -# Code +# AddressValidationResultsMessageCodeEnum ## Values diff --git a/docs/Models/Components/Source.md b/docs/Models/Components/AddressValidationResultsMessageSourceEnum.md similarity index 84% rename from docs/Models/Components/Source.md rename to docs/Models/Components/AddressValidationResultsMessageSourceEnum.md index 8f07520..b04f258 100644 --- a/docs/Models/Components/Source.md +++ b/docs/Models/Components/AddressValidationResultsMessageSourceEnum.md @@ -1,4 +1,4 @@ -# Source +# AddressValidationResultsMessageSourceEnum ## Values diff --git a/docs/Models/Components/CarriersEnum.md b/docs/Models/Components/CarriersEnum.md index 4a1cb50..97e4f70 100644 --- a/docs/Models/Components/CarriersEnum.md +++ b/docs/Models/Components/CarriersEnum.md @@ -8,7 +8,7 @@ | aramex | Aramex| | asendia_us | Asendia US| | australia_post | Australia Post (also used for Startrack)| -| axlehire | Axlehire| +| axlehire | Jitsu| | better_trucks | BetterTrucks| | borderguru | BorderGuru| | boxberry | Boxberry| diff --git a/docs/Models/Components/CreatedBy.md b/docs/Models/Components/CreatedBy.md new file mode 100644 index 0000000..2d4ee4d --- /dev/null +++ b/docs/Models/Components/CreatedBy.md @@ -0,0 +1,15 @@ +# CreatedBy + +An object with details about the user who created the Transaction (purchased the label). +A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in +user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken, +which is associated with the account but not any specific user. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| `FirstName` | *string* | :heavy_minus_sign: | N/A | Shwan | +| `LastName` | *string* | :heavy_minus_sign: | N/A | Ippotle | +| `Username` | *string* | :heavy_minus_sign: | N/A | shippotle@shippo.com | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclaration.md b/docs/Models/Components/CustomsDeclaration.md index 4db1afa..0919a44 100644 --- a/docs/Models/Components/CustomsDeclaration.md +++ b/docs/Models/Components/CustomsDeclaration.md @@ -14,17 +14,17 @@ | `CommercialInvoice` | *bool* | :heavy_minus_sign: | N/A | | | `ContentsExplanation` | *string* | :heavy_minus_sign: | **required if contents_type is `OTHER`**

Explanation of the type of goods of the shipment. | T-Shirt purchase | | `Disclaimer` | *string* | :heavy_minus_sign: | Disclaimer for the shipment and customs information that have been provided. | | +| `ExporterIdentification` | [CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | | `ExporterReference` | *string* | :heavy_minus_sign: | Exporter reference of an export shipment. | | | `ImporterReference` | *string* | :heavy_minus_sign: | Importer reference of an import shipment. | | -| `IsVatCollected` | *object* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | +| `IsVatCollected` | *bool* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | | `Invoice` | *string* | :heavy_minus_sign: | Invoice reference of the shipment. | #123123 | | `License` | *string* | :heavy_minus_sign: | License reference of the shipment. | | | `Metadata` | *string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID #123123 | | `Notes` | *string* | :heavy_minus_sign: | Additional notes to be included in the customs declaration. | | -| `AddressImporter` | [CustomsDeclarationAddressImporter](../../Models/Components/CustomsDeclarationAddressImporter.md) | :heavy_minus_sign: | Object ID of the Importer address. | 257ba08436604d2aaf069caafe7acb2a | +| `AddressImporter` | *string* | :heavy_minus_sign: | Object ID of the Importer address. | 257ba08436604d2aaf069caafe7acb2a | | `ContentsType` | *string* | :heavy_check_mark: | Type of goods of the shipment.
Allowed values available here | MERCHANDISE | | `EelPfc` | *string* | :heavy_minus_sign: | EEL / PFC type of the shipment. For most shipments from the US to CA, `NOEEI_30_36` is applicable; for most
other shipments from the US, `NOEEI_30_37_a` is applicable.
Allowed values available here | NOEEI_30_37_a | -| `ExporterIdentification` | [CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | | `Incoterm` | *string* | :heavy_minus_sign: | The incoterm reference of the shipment. FCA is available for DHL Express and FedEx only.
eDAP is available for DPD UK only. DAP is available for DHL Express and DPD UK.
If expecting DAP for other carriers, please use DDU.
Allowed values available here | DDP | | `InvoicedCharges` | [CustomsInvoicedCharges](../../Models/Components/CustomsInvoicedCharges.md) | :heavy_minus_sign: | Additional invoiced charges to be shown on the Customs Declaration Commercial Invoice. | | | `Items` | List<*string*> | :heavy_check_mark: | Distinct Parcel content items as Customs Items object_ids. | [
"5087f181d1dc4b14b73fdbf636498886"
] | diff --git a/docs/Models/Components/CustomsDeclarationAddressImporter.md b/docs/Models/Components/CustomsDeclarationAddressImporter.md deleted file mode 100644 index 5e1e7a2..0000000 --- a/docs/Models/Components/CustomsDeclarationAddressImporter.md +++ /dev/null @@ -1,9 +0,0 @@ -# CustomsDeclarationAddressImporter - -Object ID of the Importer address. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationCreateRequest.md b/docs/Models/Components/CustomsDeclarationCreateRequest.md index 86bfd3c..0939c9f 100644 --- a/docs/Models/Components/CustomsDeclarationCreateRequest.md +++ b/docs/Models/Components/CustomsDeclarationCreateRequest.md @@ -14,9 +14,10 @@ | `CommercialInvoice` | *bool* | :heavy_minus_sign: | N/A | | | `ContentsExplanation` | *string* | :heavy_minus_sign: | **required if contents_type is `OTHER`**

Explanation of the type of goods of the shipment. | T-Shirt purchase | | `Disclaimer` | *string* | :heavy_minus_sign: | Disclaimer for the shipment and customs information that have been provided. | | +| `ExporterIdentification` | [CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | | `ExporterReference` | *string* | :heavy_minus_sign: | Exporter reference of an export shipment. | | | `ImporterReference` | *string* | :heavy_minus_sign: | Importer reference of an import shipment. | | -| `IsVatCollected` | *object* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | +| `IsVatCollected` | *bool* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | | `Invoice` | *string* | :heavy_minus_sign: | Invoice reference of the shipment. | #123123 | | `License` | *string* | :heavy_minus_sign: | License reference of the shipment. | | | `Metadata` | *string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID #123123 | diff --git a/docs/Models/Components/CustomsItem.md b/docs/Models/Components/CustomsItem.md index 9315cde..960cc5d 100644 --- a/docs/Models/Components/CustomsItem.md +++ b/docs/Models/Components/CustomsItem.md @@ -13,6 +13,7 @@ | `OriginCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | | `Quantity` | *long* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | | `SkuCode` | *string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | +| `HsCode` | *string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. | 0901.21 | | `TariffNumber` | *string* | :heavy_minus_sign: | The tariff number of the item. | | | `ValueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | | `ValueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | diff --git a/docs/Models/Components/CustomsItemCreateRequest.md b/docs/Models/Components/CustomsItemCreateRequest.md index 62f1582..564165f 100644 --- a/docs/Models/Components/CustomsItemCreateRequest.md +++ b/docs/Models/Components/CustomsItemCreateRequest.md @@ -13,6 +13,7 @@ | `OriginCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | | `Quantity` | *long* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | | `SkuCode` | *string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | +| `HsCode` | *string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. | 0901.21 | | `TariffNumber` | *string* | :heavy_minus_sign: | The tariff number of the item. | | | `ValueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | | `ValueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | \ No newline at end of file diff --git a/docs/Models/Components/Latitude.md b/docs/Models/Components/Latitude.md new file mode 100644 index 0000000..968babf --- /dev/null +++ b/docs/Models/Components/Latitude.md @@ -0,0 +1,2 @@ +# Latitude + diff --git a/docs/Models/Components/Longitude.md b/docs/Models/Components/Longitude.md new file mode 100644 index 0000000..2f1b850 --- /dev/null +++ b/docs/Models/Components/Longitude.md @@ -0,0 +1,2 @@ +# Longitude + diff --git a/docs/Models/Components/Rate.md b/docs/Models/Components/Rate.md index e1dba5f..4cdd3ba 100644 --- a/docs/Models/Components/Rate.md +++ b/docs/Models/Components/Rate.md @@ -14,7 +14,7 @@ | `CarrierAccount` | *string* | :heavy_check_mark: | Object ID of the carrier account that has been used to retrieve the rate. | 078870331023437cb917f5187429b093 | | `DurationTerms` | *string* | :heavy_minus_sign: | Further clarification of the transit times.
Often, this includes notes that the transit time as given in "days" is only an average, not a guaranteed time. | Delivery in 1 to 3 business days | | `EstimatedDays` | *long* | :heavy_minus_sign: | Estimated transit time (duration) in days of the Parcel at the given servicelevel.
Please note that this is not binding, but only an average value as given by the provider.
Shippo is not able to guarantee any transit times. | 2 | -| `IncludedInsurancePrice` | *double* | :heavy_minus_sign: | Cost to the user to insure the Rate for the requested amount of coverage, if insurance coverage was requested.
Expressed in the currency used in the sender's country. Will be null if no insurance coverage was requested, or if insurance is requested from a non-standard insurance provider.
Please note this price is already included in the `amount` and `amount_local` fields on the Rate. Do not add this field to them. | 1.05 | +| `IncludedInsurancePrice` | *string* | :heavy_minus_sign: | Cost to the user to insure the Rate for the requested amount of coverage, if insurance coverage was requested.
Expressed in the currency used in the sender's country. Will be null if no insurance coverage was requested, or if insurance is requested from a non-standard insurance provider.
Please note this price is already included in the `amount` and `amount_local` fields on the Rate. Do not add this field to them. | 1.05 | | `Messages` | List<[ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_minus_sign: | N/A | | | `ObjectCreated` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | Date and time of Rate creation. | | | `ObjectId` | *string* | :heavy_check_mark: | Unique identifier of the given Rate object. | adcfdddf8ec64b84ad22772bce3ea37a | diff --git a/docs/Models/Components/ServiceLevelAxleHireEnum.md b/docs/Models/Components/ServiceLevelJitsuEnum.md similarity index 91% rename from docs/Models/Components/ServiceLevelAxleHireEnum.md rename to docs/Models/Components/ServiceLevelJitsuEnum.md index aab3607..a1407c7 100644 --- a/docs/Models/Components/ServiceLevelAxleHireEnum.md +++ b/docs/Models/Components/ServiceLevelJitsuEnum.md @@ -1,4 +1,4 @@ -# ServiceLevelAxleHireEnum +# ServiceLevelJitsuEnum |Token | Service name| |:---|:---| diff --git a/docs/Models/Components/ShipmentExtra.md b/docs/Models/Components/ShipmentExtra.md index 7f59d18..e5f807e 100644 --- a/docs/Models/Components/ShipmentExtra.md +++ b/docs/Models/Components/ShipmentExtra.md @@ -35,7 +35,7 @@ An object holding optional extra services to be requested. | `Insurance` | [Insurance](../../Models/Components/Insurance.md) | :heavy_minus_sign: | To add 3rd party insurance powered by XCover, specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance to you shipment, do not set these parameters. | | `InvoiceNumber` | [InvoiceNumber](../../Models/Components/InvoiceNumber.md) | :heavy_minus_sign: | Specify the invoice number field on the label (FedEx and UPS only). | | `IsReturn` | *bool* | :heavy_minus_sign: | This field specifies if it is a scan-based return shipment. See the Create a return shipment section for more details. | -| `LasershipAttrs` | [LasershipAttrs](../../Models/Components/LasershipAttrs.md) | :heavy_minus_sign: | Specify Lasership Attributes (Lasership only). Multiple options accepted. | +| `LasershipAttrs` | List<[ShipmentExtraLasershipAttributesEnum](../../Models/Components/ShipmentExtraLasershipAttributesEnum.md)> | :heavy_minus_sign: | Specify Lasership Attributes (Lasership only). Multiple options accepted. | | `LasershipDeclaredValue` | *string* | :heavy_minus_sign: | Declared value (Lasership only). Defaults to `50.00`. | | `ManifestNumber` | [UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | | `ModelNumber` | [UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/LasershipAttrs.md b/docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md similarity index 85% rename from docs/Models/Components/LasershipAttrs.md rename to docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md index d482b8c..0dfcabf 100644 --- a/docs/Models/Components/LasershipAttrs.md +++ b/docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md @@ -1,6 +1,4 @@ -# LasershipAttrs - -Specify Lasership Attributes (Lasership only). Multiple options accepted. +# ShipmentExtraLasershipAttributesEnum ## Values diff --git a/docs/Models/Components/Transaction.md b/docs/Models/Components/Transaction.md index ca6f4b4..06a9374 100644 --- a/docs/Models/Components/Transaction.md +++ b/docs/Models/Components/Transaction.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `CommercialInvoiceUrl` | *string* | :heavy_minus_sign: | A URL pointing to the commercial invoice as a 8.5x11 inch PDF file.
A value will only be returned if the Transactions has been processed successfully and if the shipment is international. | | +| `CreatedBy` | [CreatedBy](../../Models/Components/CreatedBy.md) | :heavy_minus_sign: | N/A | | | `Eta` | *string* | :heavy_minus_sign: | The estimated time of arrival according to the carrier. | | | `LabelFileType` | [LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | | `LabelUrl` | *string* | :heavy_minus_sign: | A URL pointing directly to the label in the format you've set in your settings.
A value will only be returned if the Transactions has been processed successfully. | https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA | diff --git a/docs/Models/Components/Webhook.md b/docs/Models/Components/Webhook.md new file mode 100644 index 0000000..14e59d6 --- /dev/null +++ b/docs/Models/Components/Webhook.md @@ -0,0 +1,15 @@ +# Webhook + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Event` | *string* | :heavy_check_mark: | Type of event that triggers the webhook. | +| `Url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | +| `Active` | *bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | +| `IsTest` | *bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | +| `ObjectCreated` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | Timestamp of the creation of the webhook. | +| `ObjectId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook. This can be used to retrieve or delete the webhook. | +| `ObjectUpdated` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | Timestamp of the last update of the webhook. | +| `ObjectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the webhook. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookEventTypeEnum.md b/docs/Models/Components/WebhookEventTypeEnum.md new file mode 100644 index 0000000..264165b --- /dev/null +++ b/docs/Models/Components/WebhookEventTypeEnum.md @@ -0,0 +1,12 @@ +# WebhookEventTypeEnum + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `TransactionCreated` | transaction_created | +| `TransactionUpdated` | transaction_updated | +| `TrackUpdated` | track_updated | +| `BatchCreated` | batch_created | +| `BatchPurchased` | batch_purchased | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPaginatedList.md b/docs/Models/Components/WebhookPaginatedList.md new file mode 100644 index 0000000..3ace730 --- /dev/null +++ b/docs/Models/Components/WebhookPaginatedList.md @@ -0,0 +1,11 @@ +# WebhookPaginatedList + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Next` | *string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `Previous` | *string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `Count` | *long* | :heavy_minus_sign: | N/A | | +| `Results` | List<[Webhook](../../Models/Components/Webhook.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/WebhookUpdateRequest.md b/docs/Models/Components/WebhookUpdateRequest.md new file mode 100644 index 0000000..3f7ee56 --- /dev/null +++ b/docs/Models/Components/WebhookUpdateRequest.md @@ -0,0 +1,11 @@ +# WebhookUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Event` | [WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_check_mark: | N/A | +| `Url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | +| `Active` | *bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | +| `IsTest` | *bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | \ No newline at end of file diff --git a/docs/Models/Requests/DeleteWebhookRequest.md b/docs/Models/Requests/DeleteWebhookRequest.md new file mode 100644 index 0000000..89f7c14 --- /dev/null +++ b/docs/Models/Requests/DeleteWebhookRequest.md @@ -0,0 +1,8 @@ +# DeleteWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to delete | \ No newline at end of file diff --git a/docs/Models/Requests/GetWebhookRequest.md b/docs/Models/Requests/GetWebhookRequest.md new file mode 100644 index 0000000..a881247 --- /dev/null +++ b/docs/Models/Requests/GetWebhookRequest.md @@ -0,0 +1,8 @@ +# GetWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | \ No newline at end of file diff --git a/docs/Models/Requests/UpdateWebhookRequest.md b/docs/Models/Requests/UpdateWebhookRequest.md new file mode 100644 index 0000000..f4d1b7d --- /dev/null +++ b/docs/Models/Requests/UpdateWebhookRequest.md @@ -0,0 +1,9 @@ +# UpdateWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | +| `WebhookUpdateRequest` | [WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/customsdeclarations/README.md b/docs/sdks/customsdeclarations/README.md index 05f8c30..f792a31 100644 --- a/docs/sdks/customsdeclarations/README.md +++ b/docs/sdks/customsdeclarations/README.md @@ -76,6 +76,13 @@ var res = await sdk.CustomsDeclarations.CreateAsync( Certify = true, CertifySigner = "Shawn Ippotle", ContentsExplanation = "T-Shirt purchase", + ExporterIdentification = new CustomsExporterIdentification() { + EoriNumber = "PL123456790ABCDE", + TaxId = new CustomsTaxIdentification() { + Number = "123456789", + Type = CustomsTaxIdentificationType.Ein, + }, + }, Invoice = "#123123", Metadata = "Order ID #123123", AddressImporter = new AddressImporter() { @@ -104,6 +111,7 @@ var res = await sdk.CustomsDeclarations.CreateAsync( OriginCountry = "", Quantity = 20, SkuCode = "HM-123", + HsCode = "0901.21", ValueAmount = "200", ValueCurrency = "USD", }, diff --git a/docs/sdks/customsitems/README.md b/docs/sdks/customsitems/README.md index e37dd33..ac4b6ae 100644 --- a/docs/sdks/customsitems/README.md +++ b/docs/sdks/customsitems/README.md @@ -77,6 +77,7 @@ var res = await sdk.CustomsItems.CreateAsync( OriginCountry = "", Quantity = 20, SkuCode = "HM-123", + HsCode = "0901.21", ValueAmount = "200", ValueCurrency = "USD", }, diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md new file mode 100644 index 0000000..df1ac98 --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,194 @@ +# Webhooks +(*Webhooks*) + +## Overview + +Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database. + + +### Available Operations + +* [CreateWebhook](#createwebhook) - Create a new webhook +* [ListWebhooks](#listwebhooks) - List all webhooks +* [GetWebhook](#getwebhook) - Retrieve a specific webhook +* [UpdateWebhook](#updatewebhook) - Update an existing webhook +* [DeleteWebhook](#deletewebhook) - Delete a specific webhook + +## CreateWebhook + +Creates a new webhook to send notifications to a URL when a specific event occurs. + +### Example Usage + +```csharp +using Shippo; +using Shippo.Models.Components; + +var sdk = new ShippoSDK( + apiKeyHeader: "", + shippoApiVersion: "2018-02-08"); + +WebhookUpdateRequest req = new WebhookUpdateRequest() { + Event = Shippo.Models.Components.WebhookEventTypeEnum.TrackUpdated, + Url = "https://wobbly-marmalade.org", +}; + +var res = await sdk.Webhooks.CreateWebhookAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `request` | [WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Webhook](../../Models/Components/Webhook.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Shippo.Models.Errors.SDKException | 4xx-5xx | */* | + +## ListWebhooks + +Returns a list of all webhooks you have created. + +### Example Usage + +```csharp +using Shippo; +using Shippo.Models.Components; + +var sdk = new ShippoSDK( + apiKeyHeader: "", + shippoApiVersion: "2018-02-08"); + +var res = await sdk.Webhooks.ListWebhooksAsync(); + +// handle response +``` + + +### Response + +**[WebhookPaginatedList](../../Models/Components/WebhookPaginatedList.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Shippo.Models.Errors.SDKException | 4xx-5xx | */* | + +## GetWebhook + +Returns the details of a specific webhook using the webhook object ID. + +### Example Usage + +```csharp +using Shippo; +using Shippo.Models.Components; +using Shippo.Models.Requests; + +var sdk = new ShippoSDK( + apiKeyHeader: "", + shippoApiVersion: "2018-02-08"); + +var res = await sdk.Webhooks.GetWebhookAsync(webhookId: ""); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | + + +### Response + +**[Webhook](../../Models/Components/Webhook.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Shippo.Models.Errors.SDKException | 4xx-5xx | */* | + +## UpdateWebhook + +Updates an existing webhook using the webhook object ID. + +### Example Usage + +```csharp +using Shippo; +using Shippo.Models.Components; +using Shippo.Models.Requests; + +var sdk = new ShippoSDK( + apiKeyHeader: "", + shippoApiVersion: "2018-02-08"); + +var res = await sdk.Webhooks.UpdateWebhookAsync( + webhookId: "", + webhookUpdateRequest: new WebhookUpdateRequest() { + Event = Shippo.Models.Components.WebhookEventTypeEnum.TrackUpdated, + Url = "https://small-cock.info", +}); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | +| `WebhookUpdateRequest` | [WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | + + +### Response + +**[Webhook](../../Models/Components/Webhook.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Shippo.Models.Errors.SDKException | 4xx-5xx | */* | + +## DeleteWebhook + +Deletes a specific webhook using the webhook object ID. + +### Example Usage + +```csharp +using Shippo; +using Shippo.Models.Components; +using Shippo.Models.Requests; + +var sdk = new ShippoSDK( + apiKeyHeader: "", + shippoApiVersion: "2018-02-08"); + +await sdk.Webhooks.DeleteWebhookAsync(webhookId: ""); + + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `WebhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to delete | + +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Shippo.Models.Errors.SDKException | 4xx-5xx | */* |