Skip to content

Commit ef486d5

Browse files
committed
Add optional error properties
1 parent c8b1523 commit ef486d5

File tree

6 files changed

+93
-20
lines changed

6 files changed

+93
-20
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,10 @@ Fixed handling of No Content responses
225225
## Changed
226226

227227
- Updated to ShipEngine API 1.1.202409060709
228+
229+
## 3.0.0-beta.14
230+
231+
## Changed
232+
233+
- Updated to ShipEngine API 1.1.202410081510
234+
- Add optional error properties, like field_name

ShipEngineSDK/Model/Error.cs

+42
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,45 @@ public partial class Error
5757
[JsonPropertyName("message"), JsonInclude]
5858
public string? Message { get; set; }
5959

60+
/// <summary>
61+
/// The name of the [shipping carrier](https://www.shipengine.com/docs/carriers/setup/) that generated the error, such as &#x60;fedex&#x60;, &#x60;dhl_express&#x60;, &#x60;stamps_com&#x60;, etc.
62+
/// </summary>
63+
/// <value>The name of the [shipping carrier](https://www.shipengine.com/docs/carriers/setup/) that generated the error, such as &#x60;fedex&#x60;, &#x60;dhl_express&#x60;, &#x60;stamps_com&#x60;, etc. </value>
64+
/// <remarks>
65+
/// This should not be used for input as it will be ignored on serialization.
66+
/// </remarks>
67+
/// <example>
68+
/// dhl_express
69+
/// </example>
70+
[JsonPropertyName("carrier_code"), JsonInclude]
71+
public string? CarrierCode { get; set; }
72+
73+
/// <summary>
74+
/// A string that uniquely identifies the carrier that generated the error.
75+
/// </summary>
76+
/// <value>A string that uniquely identifies the carrier that generated the error.</value>
77+
/// <remarks>
78+
/// This should not be used for input as it will be ignored on serialization.
79+
/// </remarks>
80+
/// <example>
81+
/// se-28529731
82+
/// </example>
83+
[JsonPropertyName("carrier_id"), JsonInclude]
84+
public string? CarrierId { get; set; }
85+
86+
/// <summary>
87+
/// The name of the field that caused the error
88+
/// </summary>
89+
/// <value>The name of the field that caused the error</value>
90+
/// <remarks>
91+
/// This should not be used for input as it will be ignored on serialization.
92+
/// </remarks>
93+
/// <example>
94+
/// shipment.ship_to.phone_number
95+
/// </example>
96+
[JsonPropertyName("field_name"), JsonInclude]
97+
public string? FieldName { get; set; }
98+
6099

61100
/// <summary>
62101
/// Returns the string presentation of the object
@@ -71,6 +110,9 @@ public override string ToString()
71110
sb.Append(" ErrorSource: ").Append(ErrorSource).Append("\n");
72111
sb.Append(" ErrorType: ").Append(ErrorType).Append("\n");
73112
sb.Append(" Message: ").Append(Message).Append("\n");
113+
sb.Append(" CarrierCode: ").Append(CarrierCode).Append("\n");
114+
sb.Append(" CarrierId: ").Append(CarrierId).Append("\n");
115+
sb.Append(" FieldName: ").Append(FieldName).Append("\n");
74116
#pragma warning restore CS0612 // Type or member is obsolete
75117
sb.Append("}\n");
76118
return sb.ToString();

ShipEngineSDK/ShipEngineSDK.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PackageId>ShipEngine</PackageId>
55
<PackageTags>sdk;rest;api;shipping;rates;label;tracking;cost;address;validation;normalization;fedex;ups;usps;</PackageTags>
66

7-
<Version>3.0.0-beta.13</Version>
7+
<Version>3.0.0-beta.14</Version>
88
<Authors>ShipEngine</Authors>
99
<Company>ShipEngine</Company>
1010
<Summary>The official ShipEngine C# SDK for .NET</Summary>

generation/swagger.json

+41-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.0",
33
"info": {
44
"title": "ShipEngine API",
5-
"version": "1.1.202410032110",
5+
"version": "1.1.202410081510",
66
"termsOfService": "https://www.shipengine.com/terms-of-service/",
77
"x-logo": {
88
"url": "https://shipengine.github.io/img/shipengine-logo-square.png",
@@ -5619,6 +5619,30 @@
56195619
"example": "Body of request cannot be null.",
56205620
"minLength": 1,
56215621
"description": "An error message associated with the failed API call"
5622+
},
5623+
"carrier_id": {
5624+
"readOnly": true,
5625+
"allOf": [
5626+
{
5627+
"$ref": "#/components/schemas/se_id"
5628+
}
5629+
],
5630+
"description": "A string that uniquely identifies the carrier that generated the error."
5631+
},
5632+
"carrier_code": {
5633+
"readOnly": true,
5634+
"allOf": [
5635+
{
5636+
"$ref": "#/components/schemas/carrier_code"
5637+
}
5638+
],
5639+
"description": "The name of the [shipping carrier](https://www.shipengine.com/docs/carriers/setup/) that generated the error, such as `fedex`, `dhl_express`, `stamps_com`, etc.\n"
5640+
},
5641+
"field_name": {
5642+
"type": "string",
5643+
"readOnly": true,
5644+
"example": "shipment.ship_to.phone_number",
5645+
"description": "The name of the field that caused the error"
56225646
}
56235647
}
56245648
},
@@ -5703,6 +5727,22 @@
57035727
],
57045728
"description": "The error code specified for the failed API Call"
57055729
},
5730+
"se_id": {
5731+
"title": "se_id",
5732+
"type": "string",
5733+
"minLength": 1,
5734+
"maxLength": 25,
5735+
"pattern": "^se(-[a-z0-9]+)+$",
5736+
"example": "se-28529731",
5737+
"description": "A string that uniquely identifies a ShipEngine resource, such as a carrier, label, shipment, etc."
5738+
},
5739+
"carrier_code": {
5740+
"title": "carrier_code",
5741+
"type": "string",
5742+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
5743+
"example": "dhl_express",
5744+
"description": "A [shipping carrier](https://www.shipengine.com/docs/carriers/setup/), such as `fedex`, `dhl_express`, `stamps_com`, etc.\n"
5745+
},
57065746
"list_account_settings_images_response_body": {
57075747
"title": "list_account_settings_images_response_body",
57085748
"allOf": [
@@ -6876,15 +6916,6 @@
68766916
],
68776917
"description": "The possible file formats in which shipping labels can be downloaded. We recommend `pdf` format because it is supported by all carriers, whereas some carriers do not support the `png` or `zpl` formats.\n\n|Label Format | Supported Carriers\n|--------------|-----------------------------------\n|`pdf` | All carriers\n|`png` | `fedex` <br> `stamps_com` <br> `ups` <br> `usps`\n|`zpl` | `access_worldwide` <br> `apc` <br> `asendia` <br> `dhl_global_mail` <br> `dhl_express` <br> `dhl_express_australia` <br> `dhl_express_canada` <br> `dhl_express_worldwide` <br> `dhl_express_uk` <br> `dpd` <br> `endicia` <br> `fedex` <br> `fedex_uk` <br> `firstmile` <br> `imex` <br> `newgistics` <br> `ontrac` <br> `rr_donnelley` <br> `stamps_com` <br> `ups` <br> `usps`\n"
68786918
},
6879-
"se_id": {
6880-
"title": "se_id",
6881-
"type": "string",
6882-
"minLength": 1,
6883-
"maxLength": 25,
6884-
"pattern": "^se(-[a-z0-9]+)+$",
6885-
"example": "se-28529731",
6886-
"description": "A string that uniquely identifies a ShipEngine resource, such as a carrier, label, shipment, etc."
6887-
},
68886919
"label_download": {
68896920
"title": "label_download",
68906921
"type": "object",
@@ -7462,13 +7493,6 @@
74627493
}
74637494
}
74647495
},
7465-
"carrier_code": {
7466-
"title": "carrier_code",
7467-
"type": "string",
7468-
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$",
7469-
"example": "dhl_express",
7470-
"description": "A [shipping carrier](https://www.shipengine.com/docs/carriers/setup/), such as `fedex`, `dhl_express`, `stamps_com`, etc.\n"
7471-
},
74727496
"service": {
74737497
"title": "service",
74747498
"type": "object",

openapitools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"ignoreFileOverride": "./.openapi-generator-ignore",
1515
"library": "generichost",
1616
"additionalProperties": {
17-
"packageVersion": "3.0.0-beta.12",
17+
"packageVersion": "3.0.0-beta.14",
1818
"targetFramework": "netstandard2.0",
1919
"validatable": false,
2020
"sourceFolder": "",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shipengine-dotnet",
3-
"version": "3.0.0-beta.12",
3+
"version": "3.0.0-beta.14",
44
"description": "Package primarily used to generate the API and models from OpenApi spec\"",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)