From b56ccab37a2a4b7a9e3594e3b88180e38c1fa1d7 Mon Sep 17 00:00:00 2001 From: Watson Zuo Date: Mon, 22 Sep 2025 19:23:54 +0800 Subject: [PATCH] refactor sdk struct --- README.md | 473 ++++++------ icon.png | Bin .../AfterShipTracking.csproj | 4 +- .../AfterShipTracking/AftershipClient.cs | 18 +- .../AfterShipTracking/Exception/ErrorCode.cs | 47 +- .../AfterShipTracking/Models/Checkpoint.cs | 108 +-- .../Models/CheckpointCoordinate.cs | 30 + .../Models/CheckpointEvents.cs | 30 + .../Models/CheckpointEventsReason.cs | 25 + .../Models/CheckpointSource.cs | 22 + .../AfterShipTracking/Models/Courier.cs | 48 +- .../Models/CourierConnection.cs | 21 +- ...nectionResponseForGetCourierConnections.cs | 50 +- ...ionResponseForGetCourierConnectionsData.cs | 30 + ...eForGetCourierConnectionsDataPagination.cs | 35 + .../Models/CourierCredentials.cs | 25 + .../Models/CourierResponse.cs | 23 +- .../Models/CourierResponseData.cs | 30 + .../Models/CreateTrackingRequest.cs | 194 ++--- .../Models/CreateTrackingRequestCustomers.cs | 45 ++ .../CreateTrackingRequestDeliveryType.cs | 24 + .../Models/CreateTrackingRequestLastMile.cs | 30 + .../Models/CreateTrackingResponse.cs | 693 +----------------- .../Models/CredentialField.cs | 13 +- .../DeleteCourierConnectionsByIdResponse.cs | 33 +- .../Models/DeleteTrackingByIdResponse.cs | 693 +----------------- .../Models/DetectCourierRequest.cs | 35 +- .../Models/DetectCourierResponse.cs | 18 +- .../Models/DetectCourierResponseData.cs | 30 + .../Models/EstimatedDeliveryDateRequest.cs | 159 +--- ...edDeliveryDateRequestDestinationAddress.cs | 45 ++ ...matedDeliveryDateRequestEstimatedPickup.cs | 40 + ...questEstimatedPickupOrderProcessingTime.cs | 30 + ...timatedDeliveryDateRequestOriginAddress.cs | 45 ++ .../EstimatedDeliveryDateRequestWeight.cs | 30 + .../Models/EstimatedDeliveryDateResponse.cs | 180 +---- ...dDeliveryDateResponseDestinationAddress.cs | 45 ++ ...atedDeliveryDateResponseEstimatedPickup.cs | 45 ++ ...ponseEstimatedPickupOrderProcessingTime.cs | 30 + ...imatedDeliveryDateResponseOriginAddress.cs | 45 ++ .../EstimatedDeliveryDateResponseWeight.cs | 30 + .../GetCourierConnectionsByIdResponse.cs | 33 +- .../Models/GetCourierConnectionsResponse.cs | 58 +- .../GetCourierConnectionsResponseData.cs | 30 + ...ourierConnectionsResponseDataPagination.cs | 35 + .../Models/GetCouriersResponse.cs | 18 +- .../Models/GetCouriersResponseData.cs | 30 + .../Models/GetTrackingByIdResponse.cs | 693 +----------------- .../Models/GetTrackingsResponse.cs | 58 +- .../Models/GetTrackingsResponseData.cs | 30 + .../GetTrackingsResponseDataPagination.cs | 35 + .../MarkTrackingCompletedByIdRequest.cs | 7 +- .../MarkTrackingCompletedByIdRequestReason.cs | 24 + .../MarkTrackingCompletedByIdResponse.cs | 693 +----------------- .../AfterShipTracking/Models/Meta.cs | 9 +- .../AfterShipTracking/Models/MetaType.cs | 30 + .../Models/PostCourierConnectionsRequest.cs | 1 - .../Models/PostCourierConnectionsResponse.cs | 33 +- .../Models/PredictBatchRequest.cs | 1 - .../Models/PredictBatchResponse.cs | 13 +- .../Models/PredictBatchResponseData.cs | 25 + .../Models/PredictRequest.cs | 201 ----- .../Models/PredictResponse.cs | 218 +----- .../PutCourierConnectionsByIdRequest.cs | 1 - .../PutCourierConnectionsByIdResponse.cs | 33 +- .../Models/RetrackTrackingByIdResponse.cs | 693 +----------------- .../AfterShipTracking/Models/Tag.cs | 10 +- .../AfterShipTracking/Models/Tracking.cs | 521 +++---------- .../TrackingAftershipEstimatedDeliveryDate.cs | 40 + .../Models/TrackingCarbonEmissions.cs | 30 + .../TrackingCourierEstimatedDeliveryDate.cs | 35 + .../TrackingCustomEstimatedDeliveryDate.cs | 40 + ...TrackingCustomEstimatedDeliveryDateType.cs | 22 + .../Models/TrackingCustomers.cs | 45 ++ .../Models/TrackingFirstEstimatedDelivery.cs | 45 ++ .../TrackingFirstEstimatedDeliverySource.cs | 26 + .../TrackingFirstEstimatedDeliveryType.cs | 22 + .../Models/TrackingFirstMile.cs | 45 ++ .../Models/TrackingLastMile.cs | 50 ++ .../Models/TrackingLastMileSource.cs | 22 + .../Models/TrackingLatestEstimatedDelivery.cs | 50 ++ .../TrackingLatestEstimatedDeliverySource.cs | 26 + .../TrackingLatestEstimatedDeliveryType.cs | 22 + .../Models/TrackingResponse.cs | 1 - .../Models/TrackingResponseForGetTrackings.cs | 50 +- .../TrackingResponseForGetTrackingsData.cs | 30 + ...ngResponseForGetTrackingsDataPagination.cs | 35 + .../Models/TrackingShipmentWeight.cs | 30 + .../Models/TrackingSignatureRequirement.cs | 28 + .../Models/UpdateTrackingByIdRequest.cs | 156 ++-- .../UpdateTrackingByIdRequestCustomers.cs | 45 ++ .../UpdateTrackingByIdRequestDeliveryType.cs | 24 + .../Models/UpdateTrackingByIdResponse.cs | 693 +----------------- .../Properties/AssemblyInfo.cs | 2 +- .../Public/AfterShipConfiguration.cs | 22 +- .../AfterShipTracking/Public/Authenticator.cs | 8 +- .../Public/Base/BaseResourceService.cs | 21 +- .../AfterShipTracking/Public/Base/Meta.cs | 26 + .../Public/Base/PaginationCursor.cs | 29 - .../Public/Base/PaginationPage.cs | 38 - .../Public/SystemNetHttpClient.cs | 12 +- .../RestAPI/Courier/CourierOption.cs | 12 +- .../RestAPI/Courier/CourierService.cs | 16 +- .../CourierConnectionOption.cs | 72 +- .../CourierConnectionService.cs | 84 ++- .../EstimatedDeliveryDateOption.cs | 2 +- .../EstimatedDeliveryDateService.cs | 18 +- .../RestAPI/Tracking/TrackingOption.cs | 186 +++-- .../RestAPI/Tracking/TrackingService.cs | 114 ++- 109 files changed, 2717 insertions(+), 6641 deletions(-) mode change 100755 => 100644 icon.png create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CheckpointCoordinate.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CheckpointEvents.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CheckpointEventsReason.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CheckpointSource.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsDataPagination.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CourierCredentials.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CourierResponseData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestCustomers.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestDeliveryType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestLastMile.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponseData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestDestinationAddress.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickup.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestOriginAddress.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestWeight.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseDestinationAddress.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickup.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseOriginAddress.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseWeight.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseDataPagination.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponseData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseDataPagination.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequestReason.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/MetaType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponseData.cs delete mode 100644 src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingAftershipEstimatedDeliveryDate.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingCarbonEmissions.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingCourierEstimatedDeliveryDate.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDate.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDateType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomers.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDelivery.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliverySource.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliveryType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstMile.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMile.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMileSource.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDelivery.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliverySource.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliveryType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsData.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsDataPagination.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingShipmentWeight.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/TrackingSignatureRequirement.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestCustomers.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestDeliveryType.cs create mode 100644 src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs delete mode 100644 src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs delete mode 100644 src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs diff --git a/README.md b/README.md index cc5c46a..5aa253c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you need support using AfterShip products, please contact support@aftership.c ## Table of Contents -- [AfterShip Tracking API library for C#](#aftership-tracking-api-library-for-c) +- [AfterShip Tracking API library for C#](#aftership-tracking-api-library-for-c#) - [Table of Contents](#table-of-contents) - [Before you begin](#before-you-begin) - [API and SDK Version](#api-and-sdk-version) @@ -20,10 +20,10 @@ If you need support using AfterShip products, please contact support@aftership.c - [Error Handling](#error-handling) - [Error List](#error-list) - [Endpoints](#endpoints) - - [/trackings](#trackings) - - [/couriers](#couriers) - [/courier-connections](#courier-connections) - [/estimated-delivery-date](#estimated-delivery-date) + - [/trackings](#trackings) + - [/couriers](#couriers) - [Help](#help) - [License](#license) @@ -38,18 +38,8 @@ Before you begin to integrate: ### API and SDK Version -Each SDK version is designed to work with a specific API version. Please refer to the table below to identify the supported API versions for each SDK version, ensuring you select the appropriate SDK version for the API version you intend to use. - -| SDK Version | Supported API Version | Branch | -| ----------- | --------------------- | ---------------------------------------------------------- | -| 12.x.x | 2025-07 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-07 | -| 11.x.x | 2025-04 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-04 | -| 10.x.x | 2025-01 | https://github.com/AfterShip/tracking-sdk-net/tree/2025-01 | -| 9.x.x | 2024-10 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-10 | -| 8.x.x | 2024-07 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-07 | -| 7.x.x | 2024-04 | https://github.com/AfterShip/tracking-sdk-net/tree/2024-04 | -| <=6.x.x | Legacy API | https://github.com/AfterShip/aftership-sdk-net | - +- SDK Version: +- API Version: 2025-07 ## Quick Start ### Installation @@ -79,27 +69,25 @@ For with Visual Studio Code: 2. In the opened window, search for "AfterShipTracking". 3. Select the AfterShipTracking package and the package version. - ## Constructor Create AfterShip instance with options -| Name | Type | Required | Description | -| ---------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| api_key | string | ✔ | Your AfterShip API key | -| auth_type | enum | | Default value: `AfterShipConfiguration.AUTHENTICATION_TYPE_API_KEY`
AES authentication: `AfterShipConfiguration.AUTHENTICATION_TYPE_AES`
RSA authentication: `AfterShipConfiguration.AUTHENTICATION_TYPE_RSA` | -| api_secret | string | | Required if the authentication type is `AfterShipConfiguration.AUTHENTICATION_TYPE_AES` or `AfterShipConfiguration.AUTHENTICATION_TYPE_RSA` | -| domain | string | | AfterShip API domain. Default value: https://api.aftership.com | -| user_agent | string | | User-defined user-agent string, please follow [RFC9110](https://www.rfc-editor.org/rfc/rfc9110#field.user-agent) format standard. | -| proxy | string | | HTTP proxy URL to use for requests.
Default value: `null`
Example: `http://192.168.0.100:8888` | -| max_retry | number | | Number of retries for each request. Default value: 2. Min is 0, Max is 10. | -| timeout | number | | Timeout for each request in milliseconds. | +| Name | Type | Required | Description | +| ---------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------- | +| api_key | string | ✔ | Your AfterShip API key | +| auth_type | enum | | Default value: `AuthType.API_KEY`
AES authentication: `AuthType.AES`
RSA authentication: `AuthType.RSA` | +| api_secret | string | | Required if the authentication type is `AuthType.AES` or `AuthType.RSA` | +| domain | string | | AfterShip API domain. Default value: https://api.aftership.com | +| user_agent | string | | User-defined user-agent string, please follow [RFC9110](https://www.rfc-editor.org/rfc/rfc9110#field.user-agent) format standard. | +| proxy | string | | HTTP proxy URL to use for requests.
Default value: `null`
Example: `http://192.168.0.100:8888` | +| max_retry | number | | Number of retries for each request. Default value: 2. Min is 0, Max is 10. | +| timeout | number | | Timeout for each request in milliseconds. | ### Example ```csharp using AfterShipTracking; - class Program { static void Main() @@ -112,315 +100,302 @@ class Program authenticationType: AfterShipConfiguration.AUTHENTICATION_TYPE_AES ); - CreateTrackingOptions options = new CreateTrackingOptions(); - options.CreateTrackingRequest = new CreateTrackingRequest(); - CreateTrackingRequest newTracking = new CreateTrackingRequest(); - newTracking.TrackingNumber = ""; - newTracking.Slug = ""; - options.CreateTrackingRequest = newTracking; - Tracking tracking = client.Tracking.CreateTracking(options); - if (tracking != null) - { - Console.WriteLine(tracking.Id); - } - }catch (Exception e) + GetTrackingByIdOptions options = new GetTrackingByIdOptions(); + GetTrackingByIdResponse response = client.Tracking.GetTrackingById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } + } catch (Exception e) { Console.WriteLine(e.Message); } } } + ``` ## Rate Limiter -See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-07/quickstart/rate-limit) to understand the AfterShip rate limit policy. +See the [Rate Limit](https://www.aftership.com/docs/tracking/quickstart/rate-limit) to understand the AfterShip rate limit policy. ## Error Handling The SDK will return an error object when there is any error during the request, with the following specification: -| Name | Type | Description | -| ------------- | ------ | ------------------------------ | -| message | string | Detail message of the error | -| code | enum | Error code enum for API Error. | -| meta_code | number | API response meta code. | -| status_code | number | HTTP status code. | -| response_body | string | API response body. | +| Name | Type | Description | +| --------------- | ------ | ------------------------------ | +| message | string | Detail message of the error | +| code | enum | Error code enum for API Error. | +| meta_code | number | API response meta code. | +| status_code | number | HTTP status code. | +| response_body | string | API response body. | +| response_header | object | API response header. | ### Error List | code | meta_code | status_code | message | | --------------------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | -| INVALID_JSON | 4001 | 400 | Invalid JSON data. | -| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | -| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | -| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | -| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | -| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | -| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | -| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | -| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | -| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | -| BAD_COURIER | 4012 | 400 | The error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | -| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | -| NOTIFICATION_REUQIRED | 4014 | 400 | notification object is required. | -| ID_INVALID | 4015 | 400 | The value of id is invalid. | -| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | -| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | -| API_KEY_INVALID | 401 | 401 | The API key is invalid. | -| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | -| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | -| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | -| INTERNAL_ERROR | 500 502 503 504 | 500 502 503 504 | Something went wrong on AfterShip's end. | +| INVALID_REQUEST | 400 | 400 | The request was invalid or cannot be otherwise served. | | +| INVALID_JSON | 4001 | 400 | Invalid JSON data. | | +| TRACKING_ALREADY_EXIST | 4003 | 400 | Tracking already exists. | | +| TRACKING_DOES_NOT_EXIST | 4004 | 404 | Tracking does not exist. | | +| TRACKING_NUMBER_INVALID | 4005 | 400 | The value of tracking_number is invalid. | | +| TRACKING_REQUIRED | 4006 | 400 | tracking object is required. | | +| TRACKING_NUMBER_REQUIRED | 4007 | 400 | tracking_number is required. | | +| VALUE_INVALID | 4008 | 400 | The value of [field_name] is invalid. | | +| VALUE_REQUIRED | 4009 | 400 | [field_name] is required. | | +| SLUG_INVALID | 4010 | 400 | The value of slug is invalid. | | +| MISSING_OR_INVALID_REQUIRED_FIELD | 4011 | 400 | Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name] | | +| BAD_COURIER | 4012 | 400 | The error message will be one of the following:1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers2. Unable to import shipment as we don't recognize the carrier from this tracking number.3. Unable to import shipment as the tracking number has an invalid format.4. Unable to import shipment as this carrier is no longer supported.5. Unable to import shipment as the tracking number does not belong to a carrier in that group. | | +| INACTIVE_RETRACK_NOT_ALLOWED | 4013 | 400 | Retrack is not allowed. You can only retrack an inactive tracking. | | +| NOTIFICATION_REQUIRED | 4014 | 400 | notification object is required. | | +| ID_INVALID | 4015 | 400 | The value of id is invalid. | | +| RETRACK_ONCE_ALLOWED | 4016 | 400 | Retrack is not allowed. You can only retrack each shipment once. | | +| TRACKING_NUMBER_FORMAT_INVALID | 4017 | 400 | The format of tracking_number is invalid. | | +| API_KEY_INVALID | 401 | 401 | The API Key is invalid. | | +| REQUEST_NOT_ALLOWED | 403 | 403 | The request is understood, but it has been refused or access is not allowed. | | +| NOT_FOUND | 404 | 404 | The URI requested is invalid or the resource requested does not exist. | | +| TOO_MANY_REQUEST | 429 | 429 | You have exceeded the API call rate limit. The default limit is 10 requests per second. | | +| INTERNAL_ERROR | 500 | 500 | Something went wrong on AfterShip's end. | | +| INTERNAL_ERROR | 502 | 502 | Something went wrong on AfterShip's end. | | +| INTERNAL_ERROR | 503 | 503 | Something went wrong on AfterShip's end. | | +| INTERNAL_ERROR | 504 | 504 | Something went wrong on AfterShip's end. | | + | ## Endpoints -The AfterShip instance has the following properties which are exactly the same as the API endpoints: - -- courier - Get a list of our supported couriers. -- tracking - Create trackings, update trackings, and get tracking results. -- courier-connection - Create courier connections, update courier connections, and get courier connections results. -- estimated-delivery-date - Get estimated delivery date for your order. - +The AfterShip SDK has the following resource which are exactly the same as the API endpoints: + +- CourierConnectionResource + - Get courier connections + - Create courier connections + - Get courier connection by id + - Update courier connection by id + - Delete courier connection by id +- EstimatedDeliveryDateResource + - Prediction for the Estimated Delivery Date + - Batch prediction for the Estimated Delivery Date +- TrackingResource + - Get trackings + - Create a tracking + - Get a tracking by ID + - Update a tracking by ID + - Delete a tracking by ID + - Retrack an expired tracking by ID + - Mark tracking as completed by ID +- CourierResource + - Get couriers + - Detect courier -### /trackings - -**POST** /trackings +### /courier-connections +**GET** /courier-connections ```csharp -CreateTrackingOptions options = new CreateTrackingOptions(); -options.CreateTrackingRequest = new CreateTrackingRequest(); -CreateTrackingRequest newTracking = new CreateTrackingRequest(); -newTracking.TrackingNumber = ""; -newTracking.Slug = ""; -options.CreateTrackingRequest = newTracking; -Tracking tracking = client.Tracking.CreateTracking(options); -if (tracking != null) -{ - Console.WriteLine(tracking.Id); -} + GetCourierConnectionsOptions options = new GetCourierConnectionsOptions(); + GetCourierConnectionsResponse response = client.CourierConnection.GetCourierConnections(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**DELETE** /trackings/:id +**POST** /courier-connections ```csharp -DeleteTrackingByIdOptions deleteOptions = new DeleteTrackingByIdOptions(); -Tracking resp = client.Tracking.DeleteTrackingById(""); - -if (resp != null) -{ - Console.WriteLine(resp.Id); -} + PostCourierConnectionsOptions options = new PostCourierConnectionsOptions(); + PostCourierConnectionsRequest postCourierConnectionsRequest = new PostCourierConnectionsRequest(); + postCourierConnectionsRequest.CourierSlug = "valid_value"; + postCourierConnectionsRequest.Credentials = ; + options.PostCourierConnectionsRequest = postCourierConnectionsRequest; + PostCourierConnectionsResponse response = client.CourierConnection.PostCourierConnections(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**GET** /trackings +**GET** /courier-connections/{id} ```csharp -GetTrackingsOptions options = new GetTrackingsOptions(); -options.Keyword = "test"; -GetTrackingsResponse trackingsData = client.Tracking.GetTrackings(options); -if (trackingsData != null && trackingsData.Trackings != null) -{ - for (int i = 0; i < trackingsData.Trackings.Length; i++) + GetCourierConnectionsByIdOptions options = new GetCourierConnectionsByIdOptions(); + GetCourierConnectionsByIdResponse response = client.CourierConnection.GetCourierConnectionsById("valid_value",options); + if (response != null) { - Console.WriteLine(trackingsData.Trackings[i].Id); + Console.WriteLine(response); } -} ``` -**GET** /trackings/:id +**PATCH** /courier-connections/{id} ```csharp -Tracking tracking = client.Tracking.GetTrackingById(""); -if (tracking != null) -{ - Console.WriteLine(tracking.TrackingNumber); -} + PutCourierConnectionsByIdOptions options = new PutCourierConnectionsByIdOptions(); + PutCourierConnectionsByIdRequest putCourierConnectionsByIdRequest = new PutCourierConnectionsByIdRequest(); + putCourierConnectionsByIdRequest.Credentials = ; + options.PutCourierConnectionsByIdRequest = putCourierConnectionsByIdRequest; + PutCourierConnectionsByIdResponse response = client.CourierConnection.PutCourierConnectionsById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**PUT** /trackings/:id +**DELETE** /courier-connections/{id} ```csharp -UpdateTrackingByIdOptions updateOptions = new UpdateTrackingByIdOptions(); -updateOptions.UpdateTrackingByIdRequest = new UpdateTrackingByIdRequest(); -UpdateTrackingByIdRequest trackingToUpdate = new UpdateTrackingByIdRequest(); -trackingToUpdate.Title = "this is a test new title"; -trackingToUpdate.Note = "some note"; -updateOptions.UpdateTrackingByIdRequest = trackingToUpdate; -Tracking tracking = client.Tracking.UpdateTrackingById("", updateOptions); - -if (tracking != null) -{ - Console.WriteLine(tracking.Title); - Console.WriteLine(tracking.Note); -} + DeleteCourierConnectionsByIdOptions options = new DeleteCourierConnectionsByIdOptions(); + DeleteCourierConnectionsByIdResponse response = client.CourierConnection.DeleteCourierConnectionsById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**POST** /trackings/:id/retrack +### /estimated-delivery-date +**POST** /estimated-delivery-date/predict ```csharp -RetrackTrackingByIdOptions options = new RetrackTrackingByIdOptions(); -Tracking tracking = client.Tracking.RetrackTrackingById(""); -Console.WriteLine(tracking.TrackingNumber); + PredictOptions options = new PredictOptions(); + EstimatedDeliveryDateRequest predictRequest = new EstimatedDeliveryDateRequest(); + predictRequest.Slug = "valid_value"; + EstimatedDeliveryDateRequestOriginAddress originAddress = new EstimatedDeliveryDateRequestOriginAddress(); + predictRequest.OriginAddress = originAddress; + EstimatedDeliveryDateRequestDestinationAddress destinationAddress = new EstimatedDeliveryDateRequestDestinationAddress(); + predictRequest.DestinationAddress = destinationAddress; + options.PredictRequest = predictRequest; + PredictResponse response = client.EstimatedDeliveryDate.Predict(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**POST** /trackings/:id/mark-as-completed +**POST** /estimated-delivery-date/predict-batch ```csharp -MarkTrackingCompletedByIdOptions options = new MarkTrackingCompletedByIdOptions(); -Tracking tracking = client.Tracking.RetrackTrackingById(""); -Console.WriteLine(tracking.TrackingNumber); + PredictBatchOptions options = new PredictBatchOptions(); + PredictBatchRequest predictBatchRequest = new PredictBatchRequest(); + options.PredictBatchRequest = predictBatchRequest; + PredictBatchResponse response = client.EstimatedDeliveryDate.PredictBatch(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -### /couriers -**GET** /couriers +### /trackings +**GET** /trackings ```csharp -GetCouriersOptions options = new GetCouriersOptions(); -GetCouriersResponse resp = client.Courier.GetCouriers(options); -Console.WriteLine(resp.Total); + GetTrackingsOptions options = new GetTrackingsOptions(); + GetTrackingsResponse response = client.Tracking.GetTrackings(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**POST** /couriers/detect +**POST** /trackings ```csharp -DetectCourierOptions options = new DetectCourierOptions(); -DetectCourierRequest tracking = new DetectCourierRequest(); -tracking.TrackingNumber = ""; -options.DetectCourierRequest = tracking; -DetectCourierResponse resp = client.Courier.DetectCourier(options); -Console.WriteLine(resp.Total); + CreateTrackingOptions options = new CreateTrackingOptions(); + CreateTrackingRequest createTrackingRequest = new CreateTrackingRequest(); + createTrackingRequest.TrackingNumber = "valid_value"; + options.CreateTrackingRequest = createTrackingRequest; + CreateTrackingResponse response = client.Tracking.CreateTracking(options); + if (response != null) + { + Console.WriteLine(response); + } ``` -### /courier-connections +**GET** /trackings/{id} -**POST** /courier-connections ```csharp -PostCourierConnectionsOptions postCourierConnectionsOptions = new PostCourierConnectionsOptions(); -postCourierConnectionsOptions.PostCourierConnectionsRequest = new PostCourierConnectionsRequest(); -PostCourierConnectionsRequest req = new PostCourierConnectionsRequest(); -req.CourierSlug = "dhl-api"; -Dictionary credentails = new Dictionary(); -credentails.Add("api_key", ""); -req.Credentials = credentails; -postCourierConnectionsOptions.PostCourierConnectionsRequest = req; -CourierConnection createdCourierConnection = client.CourierConnection.PostCourierConnections(postCourierConnectionsOptions); -if (createdCourierConnection != null) -{ - Console.WriteLine(createdCourierConnection.Id); -} + GetTrackingByIdOptions options = new GetTrackingByIdOptions(); + GetTrackingByIdResponse response = client.Tracking.GetTrackingById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**GET** /courier-connections +**PUT** /trackings/{id} + ```csharp -GetCourierConnectionsResponseCourierConnectionListData listCourierConnectionData = client.CourierConnection.GetCourierConnections(); -if (listCourierConnectionData != null) -{ - for (int i = 0; i < listCourierConnectionData.CourierConnections.Length; i++) + UpdateTrackingByIdOptions options = new UpdateTrackingByIdOptions(); + UpdateTrackingByIdRequest updateTrackingByIdRequest = new UpdateTrackingByIdRequest(); + options.UpdateTrackingByIdRequest = updateTrackingByIdRequest; + UpdateTrackingByIdResponse response = client.Tracking.UpdateTrackingById("valid_value",options); + if (response != null) { - Console.WriteLine(listCourierConnectionData.CourierConnections[i].Id); + Console.WriteLine(response); } -} ``` -**GET** /courier-connections/:id -```csharp -CourierConnection courierConnection = client.CourierConnection.GetCourierConnectionsById(""); -if (courierConnection != null) -{ - Console.WriteLine(courierConnection.Id); -} -``` +**DELETE** /trackings/{id} -**DELETE** /courier-connections/:id ```csharp -CourierConnection courierConnection = client.CourierConnection.DeleteCourierConnectionsById(""); -if (courierConnection != null) -{ - Console.WriteLine(courierConnection.Id); -} + DeleteTrackingByIdOptions options = new DeleteTrackingByIdOptions(); + DeleteTrackingByIdResponse response = client.Tracking.DeleteTrackingById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**PATCH** /courier-connections/:id +**POST** /trackings/{id}/retrack + ```csharp -PutCourierConnectionsByIdOptions putCourierConnectionsOptions = new PutCourierConnectionsByIdOptions(); -putCourierConnectionsOptions.PutCourierConnectionsByIdRequest = new PutCourierConnectionsByIdRequest(); -PutCourierConnectionsByIdRequest req = new PutCourierConnectionsByIdRequest(); - -Dictionary credentails = new Dictionary(); -credentails.Add("api_key", ""); -req.Credentials = credentails; -putCourierConnectionsOptions.PutCourierConnectionsByIdRequest = req; -CourierConnection courierConnection = client.CourierConnection.PutCourierConnectionsById("", putCourierConnectionsOptions); -if (courierConnection != null) -{ - Console.WriteLine(courierConnection.Id); -} + RetrackTrackingByIdOptions options = new RetrackTrackingByIdOptions(); + RetrackTrackingByIdResponse response = client.Tracking.RetrackTrackingById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` - -### /estimated-delivery-date - -**POST** /estimated-delivery-date/predict-batch +**POST** /trackings/{id}/mark-as-completed ```csharp -PredictBatchOptions options = new PredictBatchOptions(); -PredictBatchRequest request = new PredictBatchRequest(); - -EstimatedDeliveryDateRequest estimatedDeliveryDateRequest = new EstimatedDeliveryDateRequest(); - -DestinationAddressEstimatedDeliveryDateRequest dest = new DestinationAddressEstimatedDeliveryDateRequest(); -dest.CountryRegion = ""; -dest.State = ""; -estimatedDeliveryDateRequest.DestinationAddress = dest; - -OriginAddressEstimatedDeliveryDateRequest origin = new OriginAddressEstimatedDeliveryDateRequest(); -origin.CountryRegion = ""; -origin.State = ""; -estimatedDeliveryDateRequest.OriginAddress = origin; - -estimatedDeliveryDateRequest.Slug = ""; -estimatedDeliveryDateRequest.PickupTime = "2024-08-01 06:42:30"; -request.EstimatedDeliveryDates = new EstimatedDeliveryDateRequest[] { estimatedDeliveryDateRequest }; - -options.PredictBatchRequest = request; - -EstimatedPickupEstimatedDeliveryDateRequest r2 = new EstimatedPickupEstimatedDeliveryDateRequest(); -r2.BusinessDays = new int?[] { 0 }; - -PredictBatchResponse resp = client.EstimatedDeliveryDate.PredictBatch(options); -Console.WriteLine(resp.EstimatedDeliveryDates[0].PickupTime); + MarkTrackingCompletedByIdOptions options = new MarkTrackingCompletedByIdOptions(); + MarkTrackingCompletedByIdRequest markTrackingCompletedByIdRequest = new MarkTrackingCompletedByIdRequest(); + options.MarkTrackingCompletedByIdRequest = markTrackingCompletedByIdRequest; + MarkTrackingCompletedByIdResponse response = client.Tracking.MarkTrackingCompletedById("valid_value",options); + if (response != null) + { + Console.WriteLine(response); + } ``` -**POST** /estimated-delivery-date/predict +### /couriers +**GET** /couriers ```csharp -PredictOptions options = new PredictOptions(); -PredictRequest request = new PredictRequest(); - -EstimatedDeliveryDateRequest estimatedDeliveryDateRequest = new EstimatedDeliveryDateRequest(); - -DestinationAddressEstimatedDeliveryDateRequest dest = new DestinationAddressEstimatedDeliveryDateRequest(); -dest.CountryRegion = ""; -dest.State = ""; -estimatedDeliveryDateRequest.DestinationAddress = dest; - -OriginAddressEstimatedDeliveryDateRequest origin = new OriginAddressEstimatedDeliveryDateRequest(); -origin.CountryRegion = ""; -origin.State = ""; -estimatedDeliveryDateRequest.OriginAddress = origin; - -estimatedDeliveryDateRequest.Slug = ""; -estimatedDeliveryDateRequest.PickupTime = "2024-08-01 06:42:30"; + GetCouriersOptions options = new GetCouriersOptions(); + GetCouriersResponse response = client.Courier.GetCouriers(options); + if (response != null) + { + Console.WriteLine(response); + } +``` -options.PredictRequest = request; +**POST** /couriers/detect -EstimatedDeliveryDateResponse resp = client.EstimatedDeliveryDate.Predict(options); -Console.WriteLine(resp.PickupTime); +```csharp + DetectCourierOptions options = new DetectCourierOptions(); + DetectCourierRequest detectCourierRequest = new DetectCourierRequest(); + detectCourierRequest.TrackingNumber = "valid_value"; + options.DetectCourierRequest = detectCourierRequest; + DetectCourierResponse response = client.Courier.DetectCourier(options); + if (response != null) + { + Console.WriteLine(response); + } ``` + ## Help If you get stuck, we're here to help: @@ -429,6 +404,6 @@ If you get stuck, we're here to help: - Contact AfterShip official support via support@aftership.com ## License -Copyright (c) 2024 AfterShip +Copyright (c) 2025 AfterShip Licensed under the MIT license. \ No newline at end of file diff --git a/icon.png b/icon.png old mode 100755 new mode 100644 diff --git a/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj b/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj index d7f0517..becee6d 100644 --- a/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj +++ b/src/AfterShipTracking/AfterShipTracking/AfterShipTracking.csproj @@ -10,7 +10,7 @@ Copyright © AfterShip AfterShipTracking en-US - 13.0.0 + 14.0.0 AfterShip @@ -44,8 +44,6 @@ - - diff --git a/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs b/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs index 0d5dd4f..3d83c34 100644 --- a/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs +++ b/src/AfterShipTracking/AfterShipTracking/AftershipClient.cs @@ -64,10 +64,10 @@ public class AfterShipClient public IHttpClient HttpClient { get; } - public TrackingService Tracking { get; set; } - public CourierService Courier { get; set; } public CourierConnectionService CourierConnection { get; set; } public EstimatedDeliveryDateService EstimatedDeliveryDate { get; set; } + public TrackingService Tracking { get; set; } + public CourierService Courier { get; set; } public AfterShipClient( string domain = null, string apiKey = null, @@ -96,27 +96,27 @@ public AfterShipClient( HttpClient = httpClient ?? new SystemNetHttpClient(this.ApiBase, authenticator, this.MaxRetry, this.Timeout, this.UserAgent,this.Proxy); - Tracking = new TrackingService(HttpClient); - Courier = new CourierService(HttpClient); CourierConnection = new CourierConnectionService(HttpClient); EstimatedDeliveryDate = new EstimatedDeliveryDateService(HttpClient); + Tracking = new TrackingService(HttpClient); + Courier = new CourierService(HttpClient); } private void CheckConfig() { if (string.IsNullOrEmpty(ApiKey)) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "apiKey cannot be empty"); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "Invalid API key"); } if (this.Timeout < 0 || this.Timeout > 30000) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "timeout invalid, timeout must between 0 and 30000 (milliseconds)"); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: Timeout"); } if (this.MaxRetry < 0 || this.MaxRetry > 10) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "max retry invalid, max retry must between 0 and 10"); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: MaxRetry"); } string[] array = { @@ -127,14 +127,14 @@ private void CheckConfig() var authenticationType = AuthenticationType; if (!array.Contains(authenticationType)) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: authenticationType should be one of API_KEY, AES, RSA"); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: AuthenticationType"); } if (authenticationType == AfterShipConfiguration.AUTHENTICATION_TYPE_AES || authenticationType == AfterShipConfiguration.AUTHENTICATION_TYPE_AES) { if (string.IsNullOrEmpty(ApiSecret)) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "Invalid option: apiSecret cannot be empty"); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_OPTION, "Invalid option: ApiSecret"); } } } diff --git a/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs b/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs index 51a65b1..720efbf 100644 --- a/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs +++ b/src/AfterShipTracking/AfterShipTracking/Exception/ErrorCode.cs @@ -8,15 +8,12 @@ namespace AfterShipTracking { public class ErrorCode { - public const string REQUEST_ERROR = "REQUEST_ERROR"; - - // Common AfterShipError public const string INVALID_API_KEY = "INVALID_API_KEY"; public const string INVALID_OPTION = "INVALID_OPTION"; - public const string RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED"; + public const string BAD_REQUEST = "BAD_REQUEST"; + public const string RATE_LIMIT_EXCEED = "RATE_LIMIT_EXCEED"; public const string TIMED_OUT = "TIMED_OUT"; - - // API error + public const string UNKNOWN_ERROR = "UNKNOWN_ERROR"; public const string INVALID_REQUEST = "INVALID_REQUEST"; public const string INVALID_JSON = "INVALID_JSON"; public const string TRACKING_ALREADY_EXIST = "TRACKING_ALREADY_EXIST"; @@ -30,7 +27,7 @@ public class ErrorCode public const string MISSING_OR_INVALID_REQUIRED_FIELD = "MISSING_OR_INVALID_REQUIRED_FIELD"; public const string BAD_COURIER = "BAD_COURIER"; public const string INACTIVE_RETRACK_NOT_ALLOWED = "INACTIVE_RETRACK_NOT_ALLOWED"; - public const string NOTIFICATION_REUQIRED = "NOTIFICATION_REUQIRED"; + public const string NOTIFICATION_REQUIRED = "NOTIFICATION_REQUIRED"; public const string ID_INVALID = "ID_INVALID"; public const string RETRACK_ONCE_ALLOWED = "RETRACK_ONCE_ALLOWED"; public const string TRACKING_NUMBER_FORMAT_INVALID = "TRACKING_NUMBER_FORMAT_INVALID"; @@ -55,7 +52,7 @@ public class ErrorCode { 4011, MISSING_OR_INVALID_REQUIRED_FIELD }, { 4012, BAD_COURIER }, { 4013, INACTIVE_RETRACK_NOT_ALLOWED }, - { 4014, NOTIFICATION_REUQIRED }, + { 4014, NOTIFICATION_REQUIRED }, { 4015, ID_INVALID }, { 4016, RETRACK_ONCE_ALLOWED }, { 4017, TRACKING_NUMBER_FORMAT_INVALID }, @@ -69,36 +66,6 @@ public class ErrorCode { 504, INTERNAL_ERROR }, }; - private static Dictionary errorMessageMap = new Dictionary - { - { INVALID_API_KEY, "Invalid API key" }, - { INVALID_OPTION, "Invalid option" }, - { RATE_LIMIT_EXCEEDED, "You have exceeded the API call rate limit. The default limit is 10 requests per second." }, - { TIMED_OUT, "Request timed out" }, - { INVALID_REQUEST, "The request was invalid or cannot be otherwise served."}, - { INVALID_JSON, "Invalid JSON data."}, - { TRACKING_ALREADY_EXIST, "Tracking already exists."}, - { TRACKING_DOES_NOT_EXIST, "Tracking does not exist."}, - { TRACKING_NUMBER_INVALID, "The value of tracking_number is invalid."}, - { TRACKING_REQUIRED, "tracking object is required."}, - { TRACKING_NUMBER_REQUIRED, "tracking_number is required."}, - { VALUE_INVALID, "The value of [field_name] is invalid."}, - { VALUE_REQUIRED, "[field_name] is required."}, - { SLUG_INVALID, "The value of slug is invalid."}, - { MISSING_OR_INVALID_REQUIRED_FIELD, "Missing or invalid value of the required fields for this courier. Besides tracking_number, also required: [field_name]"}, - { BAD_COURIER, "The error message will be one of the following:1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers2. Unable to import shipment as we don’t recognize the carrier from this tracking number.3. Unable to import shipment as the tracking number has an invalid format.4. Unable to import shipment as this carrier is no longer supported.5. Unable to import shipment as the tracking number does not belong to a carrier in that group."}, - { INACTIVE_RETRACK_NOT_ALLOWED, "Retrack is not allowed. You can only retrack an inactive tracking."}, - { NOTIFICATION_REUQIRED, "notification object is required."}, - { ID_INVALID, "The value of id is invalid."}, - { RETRACK_ONCE_ALLOWED, "Retrack is not allowed. You can only retrack each shipment once."}, - { TRACKING_NUMBER_FORMAT_INVALID, "The format of tracking_number is invalid."}, - { API_KEY_INVALID, "The API Key is invalid."}, - { REQUEST_NOT_ALLOWED, "The request is understood, but it has been refused or access is not allowed."}, - { NOT_FOUND, "The URI requested is invalid or the resource requested does not exist."}, - { TOO_MANY_REQUEST, "You have exceeded the API call rate limit. The default limit is 10 requests per second."}, - { INTERNAL_ERROR, "Something went wrong on AfterShip's end."}, - }; - public static AfterShipError GenAPIError(int statusCode, int metaCode, string responseBody = null, string message = null, object responseHeader= null) { string errorCode = LocateErrorCode(metaCode); @@ -114,7 +81,7 @@ public static AfterShipError GenError(string errorCode, int? statusCode, int? me { if (string.IsNullOrEmpty(message)) { - message = errorMessageMap.GetValueOrDefault(errorCode) ?? "Unknown error"; + message = "Unknown error"; } return new AfterShipError(message, errorCode, statusCode, metaCode, responseBody, responseHeader); } @@ -125,7 +92,7 @@ private static string LocateErrorCode(int metaCode) { return errorMap[metaCode]; } - return INVALID_REQUEST; + return UNKNOWN_ERROR; } } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs b/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs index ce7cf9d..8f434f8 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/Checkpoint.cs @@ -16,146 +16,90 @@ public class Checkpoint /// /// CreatedAt The date and time of the checkpoint event was added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. /// - [JsonProperty("created_at",NullValueHandling = NullValueHandling.Ignore)] - public string? CreatedAt { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } /// /// Slug The unique code of courier for this checkpoint. Get courier slug /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } + [JsonProperty("slug")] + public string Slug { get; set; } /// /// CheckpointTime The date and time of the checkpoint event, provided by the carrier. It uses the timezone of the checkpoint. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("checkpoint_time",NullValueHandling = NullValueHandling.Ignore)] - public string? CheckpointTime { get; set; } + [JsonProperty("checkpoint_time")] + public string CheckpointTime { get; set; } /// /// Location Location info provided by carrier /// - [JsonProperty("location",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("location")] public string? Location { get; set; } /// /// City City info provided by carrier /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("city")] public string? City { get; set; } /// /// State State info provided by carrier /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("state")] public string? State { get; set; } /// /// Zip Postal code info provided by carrier /// - [JsonProperty("zip",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("zip")] public string? Zip { get; set; } /// /// Coordinate The latitude and longitude coordinates indicate the precise location of the shipments that are currently in transit. /// - [JsonProperty("coordinate",NullValueHandling = NullValueHandling.Ignore)] - public CoordinateCheckpoint? Coordinate { get; set; } + [JsonProperty("coordinate")] + public CheckpointCoordinate? Coordinate { get; set; } /// /// CountryRegion Country/Region ISO Alpha-3 (three letters) of the checkpoint /// - [JsonProperty("country_region",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("country_region")] public string? CountryRegion { get; set; } /// /// CountryRegionName Country/Region name of the checkpoint, may also contain other location info. /// - [JsonProperty("country_region_name",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("country_region_name")] public string? CountryRegionName { get; set; } /// /// Message Checkpoint message /// - [JsonProperty("message",NullValueHandling = NullValueHandling.Ignore)] - public string? Message { get; set; } + [JsonProperty("message")] + public string Message { get; set; } /// /// Tag Current status of tracking. ( /// - [JsonProperty("tag",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("tag")] public Tag? Tag { get; set; } /// /// Subtag Current subtag of checkpoint. ( /// - [JsonProperty("subtag",NullValueHandling = NullValueHandling.Ignore)] - public string? Subtag { get; set; } + [JsonProperty("subtag")] + public string Subtag { get; set; } /// /// SubtagMessage Normalized checkpoint message. ( /// - [JsonProperty("subtag_message",NullValueHandling = NullValueHandling.Ignore)] - public string? SubtagMessage { get; set; } + [JsonProperty("subtag_message")] + public string SubtagMessage { get; set; } /// /// RawTag Checkpoint raw status provided by courier /// - [JsonProperty("raw_tag",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("raw_tag")] public string? RawTag { get; set; } /// /// Events The array provides details about specific event(s) that occurred to a shipment, such as "returned_to_sender". You can find the full list of events and reasons - The events' value for the same checkpoint message is subject to change as we consistently strive to enhance the performance of this feature. /// - [JsonProperty("events",NullValueHandling = NullValueHandling.Ignore)] - public EventsCheckpoint? [] Events { get; set; } + [JsonProperty("events")] + public CheckpointEvents [] Events { get; set; } /// /// Source The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed. /// - [JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)] - public string? Source { get; set; } + [JsonProperty("source")] + public CheckpointSource? Source { get; set; } public Checkpoint() { } } - - /// - /// - /// - public class CoordinateCheckpoint - { - /// - /// Latitude Represents the latitude. - /// - [JsonProperty("latitude",NullValueHandling = NullValueHandling.Ignore)] - public double? Latitude { get; set; } - /// - /// Longitude Represents the longitude. - /// - [JsonProperty("longitude",NullValueHandling = NullValueHandling.Ignore)] - public double? Longitude { get; set; } - - public CoordinateCheckpoint() - { - } - } - /// - /// - /// - public class ReasonEventsCheckpoint - { - /// - /// Code The code of the reason. - /// - [JsonProperty("code",NullValueHandling = NullValueHandling.Ignore)] - public string? Code { get; set; } - - public ReasonEventsCheckpoint() - { - } - } - /// - /// - /// - public class EventsCheckpoint - { - /// - /// Code Represents the event code. - /// - [JsonProperty("code",NullValueHandling = NullValueHandling.Ignore)] - public string? Code { get; set; } - /// - /// Reason Describes the specific reason that led to the event. - /// - [JsonProperty("reason",NullValueHandling = NullValueHandling.Ignore)] - public ReasonEventsCheckpoint? Reason { get; set; } - - public EventsCheckpoint() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CheckpointCoordinate.cs b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointCoordinate.cs new file mode 100644 index 0000000..1aef5a8 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointCoordinate.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The latitude and longitude coordinates indicate the precise location of the shipments that are currently in transit. + /// + public class CheckpointCoordinate + { + /// + /// Latitude Represents the latitude. + /// + [JsonProperty("latitude")] + public double Latitude { get; set; } + /// + /// Longitude Represents the longitude. + /// + [JsonProperty("longitude")] + public double Longitude { get; set; } + public CheckpointCoordinate() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEvents.cs b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEvents.cs new file mode 100644 index 0000000..fada92c --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEvents.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class CheckpointEvents + { + /// + /// Code Represents the event code. + /// + [JsonProperty("code")] + public string Code { get; set; } + /// + /// Reason Describes the specific reason that led to the event. + /// + [JsonProperty("reason")] + public CheckpointEventsReason? Reason { get; set; } + public CheckpointEvents() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEventsReason.cs b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEventsReason.cs new file mode 100644 index 0000000..41458fa --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointEventsReason.cs @@ -0,0 +1,25 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// Describes the specific reason that led to the event. + /// + public class CheckpointEventsReason + { + /// + /// Code The code of the reason. + /// + [JsonProperty("code")] + public string Code { get; set; } + public CheckpointEventsReason() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CheckpointSource.cs b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointSource.cs new file mode 100644 index 0000000..bd4304e --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CheckpointSource.cs @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum CheckpointSource + { + [EnumMember(Value = "carrier")] + Carrier, + [EnumMember(Value = "user")] + User, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs b/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs index bff14c9..01f57fb 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/Courier.cs @@ -16,76 +16,60 @@ public class Courier /// /// Slug Unique code of courier. Get the slugs from . /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } + [JsonProperty("slug")] + public string Slug { get; set; } /// /// Name Name of courier /// - [JsonProperty("name",NullValueHandling = NullValueHandling.Ignore)] - public string? Name { get; set; } + [JsonProperty("name")] + public string Name { get; set; } /// /// Phone Contact phone number of courier /// - [JsonProperty("phone",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("phone")] public string? Phone { get; set; } /// /// OtherName Other name of courier /// - [JsonProperty("other_name",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("other_name")] public string? OtherName { get; set; } /// /// WebUrl Website link of courier /// - [JsonProperty("web_url",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("web_url")] public string? WebUrl { get; set; } /// /// RequiredFields The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country_region` /// - [JsonProperty("required_fields",NullValueHandling = NullValueHandling.Ignore)] - public string? [] RequiredFields { get; set; } + [JsonProperty("required_fields")] + public AdditionalFields? [] RequiredFields { get; set; } /// /// OptionalFields The extra fields which are optional for tracking. Basically it's the same as required_fields, but the difference is that only some of the tracking numbers require these fields. /// - [JsonProperty("optional_fields",NullValueHandling = NullValueHandling.Ignore)] - public string? [] OptionalFields { get; set; } + [JsonProperty("optional_fields")] + public AdditionalFields? [] OptionalFields { get; set; } /// /// DefaultLanguage Default language of tracking results /// - [JsonProperty("default_language",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("default_language")] public string? DefaultLanguage { get; set; } /// /// SupportLanguages Other supported languages /// - [JsonProperty("support_languages",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("support_languages")] public string? [] SupportLanguages { get; set; } /// /// ServiceFromCountryRegions Country/Region code (ISO Alpha-3) where the courier provides service /// - [JsonProperty("service_from_country_regions",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("service_from_country_regions")] public string? [] ServiceFromCountryRegions { get; set; } /// /// Credentials Refers to the authentication details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to create a carrier connection. The content varies by carrier. /// - [JsonProperty("credentials",NullValueHandling = NullValueHandling.Ignore)] - public CredentialsCourier? Credentials { get; set; } + [JsonProperty("credentials")] + public CourierCredentials Credentials { get; set; } public Courier() { } } - - /// - /// - /// - public class CredentialsCourier - { - /// - /// Fields Through this field, users can get the specific authentication information needed when creating a courier connection to one specific carrier, such as API keys, usernames, and passwords. Each field includes properties like name, data type, and whether it's required. - /// - [JsonProperty("fields",NullValueHandling = NullValueHandling.Ignore)] - public CredentialField? [] Fields { get; set; } - - public CredentialsCourier() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnection.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnection.cs index f773d5f..1f5c318 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnection.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnection.cs @@ -16,31 +16,30 @@ public class CourierConnection /// /// Id The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection. /// - [JsonProperty("id",NullValueHandling = NullValueHandling.Ignore)] - public string? Id { get; set; } + [JsonProperty("id")] + public string Id { get; set; } /// /// CourierSlug Unique courier code. Get courier codes . /// - [JsonProperty("courier_slug",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierSlug { get; set; } + [JsonProperty("courier_slug")] + public string CourierSlug { get; set; } /// /// Credentials It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier. /// - [JsonProperty("credentials",NullValueHandling = NullValueHandling.Ignore)] - public Dictionary? Credentials { get; set; } + [JsonProperty("credentials")] + public Dictionary Credentials { get; set; } /// /// CreatedAt The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. /// - [JsonProperty("created_at",NullValueHandling = NullValueHandling.Ignore)] - public string? CreatedAt { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } /// /// UpdatedAt The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. /// - [JsonProperty("updated_at",NullValueHandling = NullValueHandling.Ignore)] - public string? UpdatedAt { get; set; } + [JsonProperty("updated_at")] + public string UpdatedAt { get; set; } public CourierConnection() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnections.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnections.cs index 7f8cc52..134ab44 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnections.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnections.cs @@ -21,56 +21,10 @@ public class CourierConnectionResponseForGetCourierConnections /// /// Data /// - [JsonProperty("data",NullValueHandling = NullValueHandling.Ignore)] - public DataCourierConnectionResponseForGetCourierConnections? Data { get; set; } + [JsonProperty("data")] + public CourierConnectionResponseForGetCourierConnectionsData Data { get; set; } public CourierConnectionResponseForGetCourierConnections() { } } - - /// - /// - /// - public class DataCourierConnectionResponseForGetCourierConnections - { - /// - /// Pagination - /// - [JsonProperty("pagination",NullValueHandling = NullValueHandling.Ignore)] - public PaginationDataCourierConnectionResponseForGetCourierConnections? Pagination { get; set; } - /// - /// CourierConnections - /// - [JsonProperty("courier_connections",NullValueHandling = NullValueHandling.Ignore)] - public CourierConnection? [] CourierConnections { get; set; } - - public DataCourierConnectionResponseForGetCourierConnections() - { - } - } - /// - /// - /// - public class PaginationDataCourierConnectionResponseForGetCourierConnections - { - /// - /// Total The total number of courier connections. - /// - [JsonProperty("total",NullValueHandling = NullValueHandling.Ignore)] - public int? Total { get; set; } - /// - /// NextCursor A string representing the cursor value for the next page of results. - /// - [JsonProperty("next_cursor",NullValueHandling = NullValueHandling.Ignore)] - public string? NextCursor { get; set; } - /// - /// HasNextPage To indicate if next page is available. - /// - [JsonProperty("has_next_page",NullValueHandling = NullValueHandling.Ignore)] - public bool? HasNextPage { get; set; } - - public PaginationDataCourierConnectionResponseForGetCourierConnections() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsData.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsData.cs new file mode 100644 index 0000000..6c4e862 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class CourierConnectionResponseForGetCourierConnectionsData + { + /// + /// Pagination + /// + [JsonProperty("pagination")] + public CourierConnectionResponseForGetCourierConnectionsDataPagination Pagination { get; set; } + /// + /// CourierConnections + /// + [JsonProperty("courier_connections")] + public CourierConnection [] CourierConnections { get; set; } + public CourierConnectionResponseForGetCourierConnectionsData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsDataPagination.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsDataPagination.cs new file mode 100644 index 0000000..41e3e13 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierConnectionResponseForGetCourierConnectionsDataPagination.cs @@ -0,0 +1,35 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class CourierConnectionResponseForGetCourierConnectionsDataPagination + { + /// + /// Total The total number of courier connections. + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// NextCursor A string representing the cursor value for the next page of results. + /// + [JsonProperty("next_cursor")] + public string NextCursor { get; set; } + /// + /// HasNextPage To indicate if next page is available. + /// + [JsonProperty("has_next_page")] + public bool HasNextPage { get; set; } + public CourierConnectionResponseForGetCourierConnectionsDataPagination() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierCredentials.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierCredentials.cs new file mode 100644 index 0000000..d215b0d --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierCredentials.cs @@ -0,0 +1,25 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// Refers to the authentication details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to create a carrier connection. The content varies by carrier. + /// + public class CourierCredentials + { + /// + /// Fields Through this field, users can get the specific authentication information needed when creating a courier connection to one specific carrier, such as API keys, usernames, and passwords. Each field includes properties like name, data type, and whether it's required. + /// + [JsonProperty("fields")] + public CredentialField [] Fields { get; set; } + public CourierCredentials() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponse.cs index 39ed558..ab3cfd0 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CourierResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponse.cs @@ -22,30 +22,9 @@ public class CourierResponse /// Data /// [JsonProperty("data")] - public DataCourierResponse Data { get; set; } + public CourierResponseData Data { get; set; } public CourierResponse() { } } - - /// - /// - /// - public class DataCourierResponse - { - /// - /// Total Total count of courier objects - /// - [JsonProperty("total",NullValueHandling = NullValueHandling.Ignore)] - public int? Total { get; set; } - /// - /// Couriers Array of object. - /// - [JsonProperty("couriers",NullValueHandling = NullValueHandling.Ignore)] - public Courier? [] Couriers { get; set; } - - public DataCourierResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseData.cs new file mode 100644 index 0000000..958c02f --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CourierResponseData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class CourierResponseData + { + /// + /// Total Total count of courier objects + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// Couriers Array of object. + /// + [JsonProperty("couriers")] + public Courier [] Couriers { get; set; } + public CourierResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs index 581c620..19a7419 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequest.cs @@ -16,8 +16,8 @@ public class CreateTrackingRequest /// /// Id Tracking ID that is system-generated by default and can be customized by the user when creating a tracking. /// - [JsonProperty("id",NullValueHandling = NullValueHandling.Ignore)] - public string? Id { get; set; } + [JsonProperty("id")] + public string Id { get; set; } /// /// TrackingNumber Tracking number of a shipment.Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.We only accept tracking numbers with length from 4 to 100We currently support the following characters in a tracking number:- A - Z- 0 - 9- `-` (Hyphen)- . (Period)- _ (Underscore)- / (Slash) /// @@ -26,231 +26,175 @@ public class CreateTrackingRequest /// /// Slug Unique courier code. Get courier codes . /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } + [JsonProperty("slug")] + public string Slug { get; set; } /// /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). /// - [JsonProperty("title",NullValueHandling = NullValueHandling.Ignore)] - public string? Title { get; set; } + [JsonProperty("title")] + public string Title { get; set; } /// /// OrderId A globally-unique identifier for the order. /// - [JsonProperty("order_id",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderId { get; set; } + [JsonProperty("order_id")] + public string OrderId { get; set; } /// /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any /// - [JsonProperty("custom_fields",NullValueHandling = NullValueHandling.Ignore)] - public Dictionary? CustomFields { get; set; } + [JsonProperty("custom_fields")] + public Dictionary CustomFields { get; set; } /// /// OrderIdPath The URL for the order in your system or store. /// - [JsonProperty("order_id_path",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderIdPath { get; set; } + [JsonProperty("order_id_path")] + public string OrderIdPath { get; set; } /// /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an to specify the language. /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] - public string? Language { get; set; } + [JsonProperty("language")] + public string Language { get; set; } /// /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("order_promised_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderPromisedDeliveryDate { get; set; } + [JsonProperty("order_promised_delivery_date")] + public string OrderPromisedDeliveryDate { get; set; } /// /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door /// - [JsonProperty("delivery_type",NullValueHandling = NullValueHandling.Ignore)] - public string? DeliveryType { get; set; } + [JsonProperty("delivery_type")] + public CreateTrackingRequestDeliveryType? DeliveryType { get; set; } /// /// PickupLocation Shipment pickup location for receiver /// - [JsonProperty("pickup_location",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupLocation { get; set; } + [JsonProperty("pickup_location")] + public string PickupLocation { get; set; } /// /// PickupNote Shipment pickup note for receiver /// - [JsonProperty("pickup_note",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupNote { get; set; } + [JsonProperty("pickup_note")] + public string PickupNote { get; set; } /// /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. /// - [JsonProperty("tracking_account_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingAccountNumber { get; set; } + [JsonProperty("tracking_account_number")] + public string TrackingAccountNumber { get; set; } /// /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. /// - [JsonProperty("tracking_key",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingKey { get; set; } + [JsonProperty("tracking_key")] + public string TrackingKey { get; set; } /// /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. /// - [JsonProperty("tracking_ship_date",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingShipDate { get; set; } + [JsonProperty("tracking_ship_date")] + public string TrackingShipDate { get; set; } /// /// OriginCountryRegion The for more details. /// - [JsonProperty("origin_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginCountryRegion { get; set; } + [JsonProperty("origin_country_region")] + public string OriginCountryRegion { get; set; } /// /// OriginState The state of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_state",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginState { get; set; } + [JsonProperty("origin_state")] + public string OriginState { get; set; } /// /// OriginCity The city of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_city",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginCity { get; set; } + [JsonProperty("origin_city")] + public string OriginCity { get; set; } /// /// OriginPostalCode The postal of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginPostalCode { get; set; } + [JsonProperty("origin_postal_code")] + public string OriginPostalCode { get; set; } /// /// OriginRawLocation The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginRawLocation { get; set; } + [JsonProperty("origin_raw_location")] + public string OriginRawLocation { get; set; } /// /// DestinationCountryRegion The for more details. /// - [JsonProperty("destination_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationCountryRegion { get; set; } + [JsonProperty("destination_country_region")] + public string DestinationCountryRegion { get; set; } /// /// DestinationState The state of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. /// - [JsonProperty("destination_state",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationState { get; set; } + [JsonProperty("destination_state")] + public string DestinationState { get; set; } /// /// DestinationCity The city of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("destination_city",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationCity { get; set; } + [JsonProperty("destination_city")] + public string DestinationCity { get; set; } /// /// DestinationPostalCode The postal of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. /// - [JsonProperty("destination_postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationPostalCode { get; set; } + [JsonProperty("destination_postal_code")] + public string DestinationPostalCode { get; set; } /// /// DestinationRawLocation The shipping address that the shipment is shipping to. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("destination_raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationRawLocation { get; set; } + [JsonProperty("destination_raw_location")] + public string DestinationRawLocation { get; set; } /// /// Note Text field for the note /// - [JsonProperty("note",NullValueHandling = NullValueHandling.Ignore)] - public string? Note { get; set; } + [JsonProperty("note")] + public string Note { get; set; } /// /// SlugGroup Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. ( /// - [JsonProperty("slug_group",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("slug_group")] public SlugGroup? SlugGroup { get; set; } /// /// OrderDate Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 /// - [JsonProperty("order_date",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderDate { get; set; } + [JsonProperty("order_date")] + public string OrderDate { get; set; } /// /// OrderNumber A unique, human-readable identifier for the order. /// - [JsonProperty("order_number",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderNumber { get; set; } + [JsonProperty("order_number")] + public string OrderNumber { get; set; } /// /// ShipmentType The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier. /// - [JsonProperty("shipment_type",NullValueHandling = NullValueHandling.Ignore)] - public string? ShipmentType { get; set; } + [JsonProperty("shipment_type")] + public string ShipmentType { get; set; } /// /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. /// - [JsonProperty("shipment_tags",NullValueHandling = NullValueHandling.Ignore)] - public string? [] ShipmentTags { get; set; } + [JsonProperty("shipment_tags")] + public string [] ShipmentTags { get; set; } /// /// CourierConnectionId If you’ve connected multiple accounts for a single carrier on AfterShip, you can now use the courier_connection_id field to tell AfterShip which carrier account you’ve used to handle a shipment so we can track it. ( /// - [JsonProperty("courier_connection_id",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierConnectionId { get; set; } + [JsonProperty("courier_connection_id")] + public string CourierConnectionId { get; set; } /// /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . /// - [JsonProperty("location_id",NullValueHandling = NullValueHandling.Ignore)] - public string? LocationId { get; set; } + [JsonProperty("location_id")] + public string LocationId { get; set; } /// /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc /// - [JsonProperty("shipping_method",NullValueHandling = NullValueHandling.Ignore)] - public string? ShippingMethod { get; set; } + [JsonProperty("shipping_method")] + public string ShippingMethod { get; set; } /// /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. /// - [JsonProperty("last_mile",NullValueHandling = NullValueHandling.Ignore)] - public LastMileCreateTrackingRequest? LastMile { get; set; } + [JsonProperty("last_mile")] + public CreateTrackingRequestLastMile LastMile { get; set; } /// /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. /// - [JsonProperty("customers",NullValueHandling = NullValueHandling.Ignore)] - public CustomersCreateTrackingRequest? [] Customers { get; set; } + [JsonProperty("customers")] + public CreateTrackingRequestCustomers [] Customers { get; set; } public CreateTrackingRequest() { } } - - /// - /// - /// - public class LastMileCreateTrackingRequest - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } - - public LastMileCreateTrackingRequest() - { - } - } - /// - /// - /// - public class CustomersCreateTrackingRequest - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role",NullValueHandling = NullValueHandling.Ignore)] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name",NullValueHandling = NullValueHandling.Ignore)] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number",NullValueHandling = NullValueHandling.Ignore)] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email",NullValueHandling = NullValueHandling.Ignore)] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] - public string? Language { get; set; } - - public CustomersCreateTrackingRequest() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestCustomers.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestCustomers.cs new file mode 100644 index 0000000..8910774 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestCustomers.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class CreateTrackingRequestCustomers + { + /// + /// Role The role of the customer, indicating whether the customer is an individual or a company. + /// + [JsonProperty("role")] + public string Role { get; set; } + /// + /// Name Customer name associated with the tracking. + /// + [JsonProperty("name")] + public string Name { get; set; } + /// + /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; set; } + /// + /// Email Email address(es) to receive email notifications. + /// + [JsonProperty("email")] + public string Email { get; set; } + /// + /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. + /// + [JsonProperty("language")] + public string Language { get; set; } + public CreateTrackingRequestCustomers() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestDeliveryType.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestDeliveryType.cs new file mode 100644 index 0000000..e764a38 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestDeliveryType.cs @@ -0,0 +1,24 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum CreateTrackingRequestDeliveryType + { + [EnumMember(Value = "pickup_at_store")] + PickupAtStore, + [EnumMember(Value = "door_to_door")] + DoorToDoor, + [EnumMember(Value = "pickup_at_courier")] + PickupAtCourier, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestLastMile.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestLastMile.cs new file mode 100644 index 0000000..7f33829 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingRequestLastMile.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + /// + public class CreateTrackingRequestLastMile + { + /// + /// TrackingNumber The tracking number of the last-mile carrier. + /// + [JsonProperty("tracking_number")] + public string TrackingNumber { get; set; } + /// + /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . + /// + [JsonProperty("slug")] + public string Slug { get; set; } + public CreateTrackingRequestLastMile() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs index 7c5ecb4..2882a72 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CreateTrackingResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class CreateTrackingResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateCreateTrackingResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightCreateTrackingResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateCreateTrackingResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateCreateTrackingResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryCreateTrackingResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryCreateTrackingResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsCreateTrackingResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileCreateTrackingResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileCreateTrackingResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersCreateTrackingResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public CreateTrackingResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateCreateTrackingResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateCreateTrackingResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightCreateTrackingResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightCreateTrackingResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateCreateTrackingResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateCreateTrackingResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateCreateTrackingResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateCreateTrackingResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryCreateTrackingResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryCreateTrackingResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryCreateTrackingResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryCreateTrackingResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsCreateTrackingResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsCreateTrackingResponse() - { - } - } - /// - /// - /// - public class FirstMileCreateTrackingResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileCreateTrackingResponse() - { - } - } - /// - /// - /// - public class LastMileCreateTrackingResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileCreateTrackingResponse() - { - } - } - /// - /// - /// - public class CustomersCreateTrackingResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersCreateTrackingResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/CredentialField.cs b/src/AfterShipTracking/AfterShipTracking/Models/CredentialField.cs index a915aae..6126eb6 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/CredentialField.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/CredentialField.cs @@ -16,21 +16,20 @@ public class CredentialField /// /// Name The display name of the credential field that users must provide when creating a carrier connection. /// - [JsonProperty("name",NullValueHandling = NullValueHandling.Ignore)] - public string? Name { get; set; } + [JsonProperty("name")] + public string Name { get; set; } /// /// Type The data type of the credential field, indicating what kind of input is expected. /// - [JsonProperty("type",NullValueHandling = NullValueHandling.Ignore)] - public string? Type { get; set; } + [JsonProperty("type")] + public string Type { get; set; } /// /// Required It indicates whether the credentials field must be provided or not when creating a carrier connection. /// - [JsonProperty("required",NullValueHandling = NullValueHandling.Ignore)] - public bool? Required { get; set; } + [JsonProperty("required")] + public bool Required { get; set; } public CredentialField() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DeleteCourierConnectionsByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/DeleteCourierConnectionsByIdResponse.cs index 98f7451..eddbf21 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/DeleteCourierConnectionsByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/DeleteCourierConnectionsByIdResponse.cs @@ -4,43 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// This model represents user-created courier connection details. AfterShip will use this information to retrieve tracking updates from carriers based on the provided tracking numbers. - /// public class DeleteCourierConnectionsByIdResponse { - /// - /// Id The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// CourierSlug Unique courier code. Get courier codes . - /// - [JsonProperty("courier_slug")] - public string? CourierSlug { get; set; } - /// - /// Credentials It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier. - /// - [JsonProperty("credentials")] - public Dictionary? Credentials { get; set; } - /// - /// CreatedAt The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } + public Headers ResponseHeader { get; set; } + public CourierConnection Data { get; set; } public DeleteCourierConnectionsByIdResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs index 0a073fb..62bae54 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/DeleteTrackingByIdResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class DeleteTrackingByIdResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateDeleteTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightDeleteTrackingByIdResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateDeleteTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryDeleteTrackingByIdResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryDeleteTrackingByIdResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsDeleteTrackingByIdResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileDeleteTrackingByIdResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileDeleteTrackingByIdResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersDeleteTrackingByIdResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public DeleteTrackingByIdResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateDeleteTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightDeleteTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateDeleteTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryDeleteTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryDeleteTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsDeleteTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstMileDeleteTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LastMileDeleteTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileDeleteTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomersDeleteTrackingByIdResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersDeleteTrackingByIdResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs index c88c62e..30d250f 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierRequest.cs @@ -21,51 +21,50 @@ public class DetectCourierRequest /// /// Slug If not specified, Aftership will automatically detect the courier based on the tracking number format and your . Use array to input a list of couriers for auto detect. Cannot be used with slug_group at the same time. /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? [] Slug { get; set; } + [JsonProperty("slug")] + public string [] Slug { get; set; } /// /// DestinationPostalCode The postal code of receiver's address. Required by some couriers. Refer to for more details /// - [JsonProperty("destination_postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationPostalCode { get; set; } + [JsonProperty("destination_postal_code")] + public string DestinationPostalCode { get; set; } /// /// TrackingShipDate Shipping date in `YYYYMMDD` format. Required by some couriers. Refer to for more details /// - [JsonProperty("tracking_ship_date",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingShipDate { get; set; } + [JsonProperty("tracking_ship_date")] + public string TrackingShipDate { get; set; } /// /// TrackingAccountNumber Account number of the shipper for a specific courier. Required by some couriers. Refer to for more details /// - [JsonProperty("tracking_account_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingAccountNumber { get; set; } + [JsonProperty("tracking_account_number")] + public string TrackingAccountNumber { get; set; } /// /// TrackingKey Key of the shipment for a specific courier. Required by some couriers. Refer to for more details /// - [JsonProperty("tracking_key",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingKey { get; set; } + [JsonProperty("tracking_key")] + public string TrackingKey { get; set; } /// /// DestinationState State of the destination shipping address of the shipment. Required by some couriers. /// - [JsonProperty("destination_state",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationState { get; set; } + [JsonProperty("destination_state")] + public string DestinationState { get; set; } /// /// SlugGroup Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. ( /// - [JsonProperty("slug_group",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("slug_group")] public SlugGroup? SlugGroup { get; set; } /// /// OriginCountryRegion Enter . /// - [JsonProperty("origin_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginCountryRegion { get; set; } + [JsonProperty("origin_country_region")] + public string OriginCountryRegion { get; set; } /// /// DestinationCountryRegion Enter . /// - [JsonProperty("destination_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationCountryRegion { get; set; } + [JsonProperty("destination_country_region")] + public string DestinationCountryRegion { get; set; } public DetectCourierRequest() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs index 31afe62..1e0f13d 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponse.cs @@ -4,28 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class DetectCourierResponse { - /// - /// Total Total count of courier objects - /// - [JsonProperty("total")] - public int? Total { get; set; } - /// - /// Couriers Array of object. - /// - [JsonProperty("couriers")] - public Courier? [] Couriers { get; set; } + public Headers ResponseHeader { get; set; } + public DetectCourierResponseData Data { get; set; } public DetectCourierResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponseData.cs new file mode 100644 index 0000000..0d152f5 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/DetectCourierResponseData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class DetectCourierResponseData + { + /// + /// Total Total count of courier objects + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// Couriers Array of object. + /// + [JsonProperty("couriers")] + public Courier [] Couriers { get; set; } + public DetectCourierResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs index 1ead1b6..052ec7f 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequest.cs @@ -21,181 +21,40 @@ public class EstimatedDeliveryDateRequest /// /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to . /// - [JsonProperty("service_type_name",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("service_type_name")] public string? ServiceTypeName { get; set; } /// /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination. /// [JsonProperty("origin_address")] - public OriginAddressEstimatedDeliveryDateRequest OriginAddress { get; set; } + public EstimatedDeliveryDateRequestOriginAddress OriginAddress { get; set; } /// /// DestinationAddress The final destination of the customer where the delivery will be made. /// [JsonProperty("destination_address")] - public DestinationAddressEstimatedDeliveryDateRequest DestinationAddress { get; set; } + public EstimatedDeliveryDateRequestDestinationAddress DestinationAddress { get; set; } /// /// Weight AfterShip uses this object to calculate the total weight of the order. /// - [JsonProperty("weight",NullValueHandling = NullValueHandling.Ignore)] - public WeightEstimatedDeliveryDateRequest? Weight { get; set; } + [JsonProperty("weight")] + public EstimatedDeliveryDateRequestWeight? Weight { get; set; } /// /// PackageCount The number of packages. /// - [JsonProperty("package_count",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("package_count")] public int? PackageCount { get; set; } /// /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required. /// - [JsonProperty("pickup_time",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("pickup_time")] public string? PickupTime { get; set; } /// /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. /// - [JsonProperty("estimated_pickup",NullValueHandling = NullValueHandling.Ignore)] - public EstimatedPickupEstimatedDeliveryDateRequest? EstimatedPickup { get; set; } + [JsonProperty("estimated_pickup")] + public EstimatedDeliveryDateRequestEstimatedPickup? EstimatedPickup { get; set; } public EstimatedDeliveryDateRequest() { } } - - /// - /// - /// - public class OriginAddressEstimatedDeliveryDateRequest - { - /// - /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public OriginAddressEstimatedDeliveryDateRequest() - { - } - } - /// - /// - /// - public class DestinationAddressEstimatedDeliveryDateRequest - { - /// - /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the destination address where the package will be delivered. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public DestinationAddressEstimatedDeliveryDateRequest() - { - } - } - /// - /// - /// - public class WeightEstimatedDeliveryDateRequest - { - /// - /// Unit The weight unit of the package. - /// - [JsonProperty("unit")] - public string Unit { get; set; } - /// - /// Value The weight of the shipment. - /// - [JsonProperty("value")] - public double Value { get; set; } - - public WeightEstimatedDeliveryDateRequest() - { - } - } - /// - /// - /// - public class EstimatedPickupEstimatedDeliveryDateRequest - { - /// - /// OrderTime The local order time in the origin address time zone of the package. - /// - [JsonProperty("order_time")] - public string OrderTime { get; set; } - /// - /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. - /// - [JsonProperty("order_cutoff_time",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderCutoffTime { get; set; } - /// - /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. - /// - [JsonProperty("business_days",NullValueHandling = NullValueHandling.Ignore)] - public int? [] BusinessDays { get; set; } - /// - /// OrderProcessingTime - /// - [JsonProperty("order_processing_time",NullValueHandling = NullValueHandling.Ignore)] - public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest? OrderProcessingTime { get; set; } - - public EstimatedPickupEstimatedDeliveryDateRequest() - { - } - } - /// - /// - /// - public class OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest - { - /// - /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. - /// - [JsonProperty("unit",NullValueHandling = NullValueHandling.Ignore)] - public string? Unit { get; set; } - /// - /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. - /// - [JsonProperty("value",NullValueHandling = NullValueHandling.Ignore)] - public double? Value { get; set; } - - public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateRequest() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestDestinationAddress.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestDestinationAddress.cs new file mode 100644 index 0000000..2ce0484 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestDestinationAddress.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The final destination of the customer where the delivery will be made. + /// + public class EstimatedDeliveryDateRequestDestinationAddress + { + /// + /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. + /// + [JsonProperty("country_region")] + public string CountryRegion { get; set; } + /// + /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. + /// + [JsonProperty("state")] + public string? State { get; set; } + /// + /// City City of the destination address where the package will be delivered. + /// + [JsonProperty("city")] + public string? City { get; set; } + /// + /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. + /// + [JsonProperty("postal_code")] + public string? PostalCode { get; set; } + /// + /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. + /// + [JsonProperty("raw_location")] + public string? RawLocation { get; set; } + public EstimatedDeliveryDateRequestDestinationAddress() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickup.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickup.cs new file mode 100644 index 0000000..686ed9e --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickup.cs @@ -0,0 +1,40 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. + /// + public class EstimatedDeliveryDateRequestEstimatedPickup + { + /// + /// OrderTime The local order time in the origin address time zone of the package. + /// + [JsonProperty("order_time")] + public string OrderTime { get; set; } + /// + /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. + /// + [JsonProperty("order_cutoff_time")] + public string? OrderCutoffTime { get; set; } + /// + /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. + /// + [JsonProperty("business_days")] + public int? [] BusinessDays { get; set; } + /// + /// OrderProcessingTime + /// + [JsonProperty("order_processing_time")] + public EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime? OrderProcessingTime { get; set; } + public EstimatedDeliveryDateRequestEstimatedPickup() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime.cs new file mode 100644 index 0000000..7691029 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime + { + /// + /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. + /// + [JsonProperty("value")] + public double Value { get; set; } + public EstimatedDeliveryDateRequestEstimatedPickupOrderProcessingTime() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestOriginAddress.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestOriginAddress.cs new file mode 100644 index 0000000..d9695b0 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestOriginAddress.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The location from where the package is picked up by the carrier to be delivered to the final destination. + /// + public class EstimatedDeliveryDateRequestOriginAddress + { + /// + /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. + /// + [JsonProperty("country_region")] + public string CountryRegion { get; set; } + /// + /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. + /// + [JsonProperty("state")] + public string? State { get; set; } + /// + /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. + /// + [JsonProperty("city")] + public string? City { get; set; } + /// + /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. + /// + [JsonProperty("postal_code")] + public string? PostalCode { get; set; } + /// + /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. + /// + [JsonProperty("raw_location")] + public string? RawLocation { get; set; } + public EstimatedDeliveryDateRequestOriginAddress() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestWeight.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestWeight.cs new file mode 100644 index 0000000..e9b38cd --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateRequestWeight.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// AfterShip uses this object to calculate the total weight of the order. + /// + public class EstimatedDeliveryDateRequestWeight + { + /// + /// Unit The weight unit of the package. + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value The weight of the shipment. + /// + [JsonProperty("value")] + public double Value { get; set; } + public EstimatedDeliveryDateRequestWeight() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs index 6e3bab1..afe3b66 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponse.cs @@ -26,206 +26,60 @@ public class EstimatedDeliveryDateResponse /// /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to . /// - [JsonProperty("service_type_name",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("service_type_name")] public string? ServiceTypeName { get; set; } /// /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination. /// [JsonProperty("origin_address")] - public OriginAddressEstimatedDeliveryDateResponse OriginAddress { get; set; } + public EstimatedDeliveryDateResponseOriginAddress OriginAddress { get; set; } /// /// DestinationAddress The final destination of the customer where the delivery will be made. /// [JsonProperty("destination_address")] - public DestinationAddressEstimatedDeliveryDateResponse DestinationAddress { get; set; } + public EstimatedDeliveryDateResponseDestinationAddress DestinationAddress { get; set; } /// /// Weight AfterShip uses this object to calculate the total weight of the order. /// - [JsonProperty("weight",NullValueHandling = NullValueHandling.Ignore)] - public WeightEstimatedDeliveryDateResponse? Weight { get; set; } + [JsonProperty("weight")] + public EstimatedDeliveryDateResponseWeight? Weight { get; set; } /// /// PackageCount The number of packages. /// - [JsonProperty("package_count",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("package_count")] public int? PackageCount { get; set; } /// /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required. /// - [JsonProperty("pickup_time",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("pickup_time")] public string? PickupTime { get; set; } /// /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. /// - [JsonProperty("estimated_pickup",NullValueHandling = NullValueHandling.Ignore)] - public EstimatedPickupEstimatedDeliveryDateResponse? EstimatedPickup { get; set; } + [JsonProperty("estimated_pickup")] + public EstimatedDeliveryDateResponseEstimatedPickup? EstimatedPickup { get; set; } /// /// EstimatedDeliveryDate The estimated arrival date of the shipment, provided by AfterShip. /// - [JsonProperty("estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDate { get; set; } + [JsonProperty("estimated_delivery_date")] + public string EstimatedDeliveryDate { get; set; } /// /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . /// - [JsonProperty("confidence_code",NullValueHandling = NullValueHandling.Ignore)] - public double? ConfidenceCode { get; set; } + [JsonProperty("confidence_code")] + public double ConfidenceCode { get; set; } /// /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment, provided by AfterShip. /// - [JsonProperty("estimated_delivery_date_min",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMin { get; set; } + [JsonProperty("estimated_delivery_date_min")] + public string EstimatedDeliveryDateMin { get; set; } /// /// EstimatedDeliveryDateMax The latest estimated delivery date of the shipment, provided by AfterShip. /// - [JsonProperty("estimated_delivery_date_max",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMax { get; set; } + [JsonProperty("estimated_delivery_date_max")] + public string EstimatedDeliveryDateMax { get; set; } public EstimatedDeliveryDateResponse() { } } - - /// - /// - /// - public class OriginAddressEstimatedDeliveryDateResponse - { - /// - /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public OriginAddressEstimatedDeliveryDateResponse() - { - } - } - /// - /// - /// - public class DestinationAddressEstimatedDeliveryDateResponse - { - /// - /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the destination address where the package will be delivered. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public DestinationAddressEstimatedDeliveryDateResponse() - { - } - } - /// - /// - /// - public class WeightEstimatedDeliveryDateResponse - { - /// - /// Unit The weight unit of the package. - /// - [JsonProperty("unit")] - public string Unit { get; set; } - /// - /// Value The weight of the shipment. - /// - [JsonProperty("value")] - public double Value { get; set; } - - public WeightEstimatedDeliveryDateResponse() - { - } - } - /// - /// - /// - public class EstimatedPickupEstimatedDeliveryDateResponse - { - /// - /// OrderTime The local order time in the origin address time zone of the package. - /// - [JsonProperty("order_time")] - public string OrderTime { get; set; } - /// - /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. - /// - [JsonProperty("order_cutoff_time",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderCutoffTime { get; set; } - /// - /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. - /// - [JsonProperty("business_days",NullValueHandling = NullValueHandling.Ignore)] - public int? [] BusinessDays { get; set; } - /// - /// OrderProcessingTime - /// - [JsonProperty("order_processing_time",NullValueHandling = NullValueHandling.Ignore)] - public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse? OrderProcessingTime { get; set; } - /// - /// PickupTime The local pickup time of the package. - /// - [JsonProperty("pickup_time",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupTime { get; set; } - - public EstimatedPickupEstimatedDeliveryDateResponse() - { - } - } - /// - /// - /// - public class OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse - { - /// - /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. - /// - [JsonProperty("unit",NullValueHandling = NullValueHandling.Ignore)] - public string? Unit { get; set; } - /// - /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. - /// - [JsonProperty("value",NullValueHandling = NullValueHandling.Ignore)] - public double? Value { get; set; } - - public OrderProcessingTimeEstimatedPickupEstimatedDeliveryDateResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseDestinationAddress.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseDestinationAddress.cs new file mode 100644 index 0000000..8cf06ff --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseDestinationAddress.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The final destination of the customer where the delivery will be made. + /// + public class EstimatedDeliveryDateResponseDestinationAddress + { + /// + /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. + /// + [JsonProperty("country_region")] + public string CountryRegion { get; set; } + /// + /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. + /// + [JsonProperty("state")] + public string? State { get; set; } + /// + /// City City of the destination address where the package will be delivered. + /// + [JsonProperty("city")] + public string? City { get; set; } + /// + /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. + /// + [JsonProperty("postal_code")] + public string? PostalCode { get; set; } + /// + /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. + /// + [JsonProperty("raw_location")] + public string? RawLocation { get; set; } + public EstimatedDeliveryDateResponseDestinationAddress() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickup.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickup.cs new file mode 100644 index 0000000..f84680a --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickup.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. + /// + public class EstimatedDeliveryDateResponseEstimatedPickup + { + /// + /// OrderTime The local order time in the origin address time zone of the package. + /// + [JsonProperty("order_time")] + public string OrderTime { get; set; } + /// + /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. + /// + [JsonProperty("order_cutoff_time")] + public string? OrderCutoffTime { get; set; } + /// + /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. + /// + [JsonProperty("business_days")] + public int? [] BusinessDays { get; set; } + /// + /// OrderProcessingTime + /// + [JsonProperty("order_processing_time")] + public EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime? OrderProcessingTime { get; set; } + /// + /// PickupTime The local pickup time of the package. + /// + [JsonProperty("pickup_time")] + public string? PickupTime { get; set; } + public EstimatedDeliveryDateResponseEstimatedPickup() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime.cs new file mode 100644 index 0000000..104aed3 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime + { + /// + /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. + /// + [JsonProperty("value")] + public double Value { get; set; } + public EstimatedDeliveryDateResponseEstimatedPickupOrderProcessingTime() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseOriginAddress.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseOriginAddress.cs new file mode 100644 index 0000000..54a0895 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseOriginAddress.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The location from where the package is picked up by the carrier to be delivered to the final destination. + /// + public class EstimatedDeliveryDateResponseOriginAddress + { + /// + /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. + /// + [JsonProperty("country_region")] + public string CountryRegion { get; set; } + /// + /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. + /// + [JsonProperty("state")] + public string? State { get; set; } + /// + /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. + /// + [JsonProperty("city")] + public string? City { get; set; } + /// + /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. + /// + [JsonProperty("postal_code")] + public string? PostalCode { get; set; } + /// + /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. + /// + [JsonProperty("raw_location")] + public string? RawLocation { get; set; } + public EstimatedDeliveryDateResponseOriginAddress() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseWeight.cs b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseWeight.cs new file mode 100644 index 0000000..0ae85c2 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/EstimatedDeliveryDateResponseWeight.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// AfterShip uses this object to calculate the total weight of the order. + /// + public class EstimatedDeliveryDateResponseWeight + { + /// + /// Unit The weight unit of the package. + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value The weight of the shipment. + /// + [JsonProperty("value")] + public double Value { get; set; } + public EstimatedDeliveryDateResponseWeight() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsByIdResponse.cs index 3e8dda3..bc5684b 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsByIdResponse.cs @@ -4,43 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// This model represents user-created courier connection details. AfterShip will use this information to retrieve tracking updates from carriers based on the provided tracking numbers. - /// public class GetCourierConnectionsByIdResponse { - /// - /// Id The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// CourierSlug Unique courier code. Get courier codes . - /// - [JsonProperty("courier_slug")] - public string? CourierSlug { get; set; } - /// - /// Credentials It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier. - /// - [JsonProperty("credentials")] - public Dictionary? Credentials { get; set; } - /// - /// CreatedAt The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } + public Headers ResponseHeader { get; set; } + public CourierConnection Data { get; set; } public GetCourierConnectionsByIdResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponse.cs index c15b4f1..5dcaf18 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponse.cs @@ -4,68 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class GetCourierConnectionsResponse { - /// - /// Pagination - /// - [JsonProperty("pagination")] - public PaginationGetCourierConnectionsResponse? Pagination { get; set; } - /// - /// CourierConnections - /// - [JsonProperty("courier_connections")] - public CourierConnection? [] CourierConnections { get; set; } - /// - /// Count - /// - [JsonProperty("total")] - public int? Count { get; set; } - /// - /// Page - /// - [JsonProperty("page")] - public int? Page { get; set; } - /// - /// Limit - /// - [JsonProperty("limit")] - public int? Limit { get; set; } + public Headers ResponseHeader { get; set; } + public GetCourierConnectionsResponseData Data { get; set; } public GetCourierConnectionsResponse() { } } - - /// - /// - /// - public class PaginationGetCourierConnectionsResponse - { - /// - /// Total The total number of courier connections. - /// - [JsonProperty("total")] - public int? Total { get; set; } - /// - /// NextCursor A string representing the cursor value for the next page of results. - /// - [JsonProperty("next_cursor")] - public string? NextCursor { get; set; } - /// - /// HasNextPage To indicate if next page is available. - /// - [JsonProperty("has_next_page")] - public bool? HasNextPage { get; set; } - - public PaginationGetCourierConnectionsResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseData.cs new file mode 100644 index 0000000..2ff671e --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class GetCourierConnectionsResponseData + { + /// + /// Pagination + /// + [JsonProperty("pagination")] + public GetCourierConnectionsResponseDataPagination Pagination { get; set; } + /// + /// CourierConnections + /// + [JsonProperty("courier_connections")] + public CourierConnection [] CourierConnections { get; set; } + public GetCourierConnectionsResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseDataPagination.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseDataPagination.cs new file mode 100644 index 0000000..679b75d --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCourierConnectionsResponseDataPagination.cs @@ -0,0 +1,35 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class GetCourierConnectionsResponseDataPagination + { + /// + /// Total The total number of courier connections. + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// NextCursor A string representing the cursor value for the next page of results. + /// + [JsonProperty("next_cursor")] + public string NextCursor { get; set; } + /// + /// HasNextPage To indicate if next page is available. + /// + [JsonProperty("has_next_page")] + public bool HasNextPage { get; set; } + public GetCourierConnectionsResponseDataPagination() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponse.cs index 0b2c001..295304f 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponse.cs @@ -4,28 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class GetCouriersResponse { - /// - /// Total Total count of courier objects - /// - [JsonProperty("total")] - public int? Total { get; set; } - /// - /// Couriers Array of object. - /// - [JsonProperty("couriers")] - public Courier? [] Couriers { get; set; } + public Headers ResponseHeader { get; set; } + public GetCouriersResponseData Data { get; set; } public GetCouriersResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponseData.cs new file mode 100644 index 0000000..c208696 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetCouriersResponseData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class GetCouriersResponseData + { + /// + /// Total Total count of courier objects + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// Couriers Array of object. + /// + [JsonProperty("couriers")] + public Courier [] Couriers { get; set; } + public GetCouriersResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs index c588cfb..d262933 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingByIdResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class GetTrackingByIdResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateGetTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightGetTrackingByIdResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateGetTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateGetTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryGetTrackingByIdResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryGetTrackingByIdResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsGetTrackingByIdResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileGetTrackingByIdResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileGetTrackingByIdResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersGetTrackingByIdResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public GetTrackingByIdResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateGetTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightGetTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateGetTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateGetTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryGetTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryGetTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsGetTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstMileGetTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LastMileGetTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileGetTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomersGetTrackingByIdResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersGetTrackingByIdResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs index 09dc577..866b9c7 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponse.cs @@ -4,68 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class GetTrackingsResponse { - /// - /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects. - /// - [JsonProperty("pagination")] - public PaginationGetTrackingsResponse? Pagination { get; set; } - /// - /// Trackings Array of - /// - [JsonProperty("trackings")] - public Tracking? [] Trackings { get; set; } - /// - /// Page - /// - [JsonProperty("page")] - public int? Page { get; set; } - /// - /// Limit - /// - [JsonProperty("limit")] - public int? Limit { get; set; } - /// - /// Count - /// - [JsonProperty("total")] - public int? Count { get; set; } + public Headers ResponseHeader { get; set; } + public GetTrackingsResponseData Data { get; set; } public GetTrackingsResponse() { } } - - /// - /// - /// - public class PaginationGetTrackingsResponse - { - /// - /// Total The total number of trackings. - /// - [JsonProperty("total")] - public int? Total { get; set; } - /// - /// NextCursor A string representing the cursor value for the next page of results. - /// - [JsonProperty("next_cursor")] - public string? NextCursor { get; set; } - /// - /// HasNextPage To indicate if next page is available. - /// - [JsonProperty("has_next_page")] - public bool? HasNextPage { get; set; } - - public PaginationGetTrackingsResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseData.cs new file mode 100644 index 0000000..e8f4872 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class GetTrackingsResponseData + { + /// + /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects. + /// + [JsonProperty("pagination")] + public GetTrackingsResponseDataPagination Pagination { get; set; } + /// + /// Trackings Array of + /// + [JsonProperty("trackings")] + public Tracking [] Trackings { get; set; } + public GetTrackingsResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseDataPagination.cs b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseDataPagination.cs new file mode 100644 index 0000000..47fc990 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/GetTrackingsResponseDataPagination.cs @@ -0,0 +1,35 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The Pagination holds the information for the pagination when the response contains multiple objects. + /// + public class GetTrackingsResponseDataPagination + { + /// + /// Total The total number of trackings. + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// NextCursor A string representing the cursor value for the next page of results. + /// + [JsonProperty("next_cursor")] + public string NextCursor { get; set; } + /// + /// HasNextPage To indicate if next page is available. + /// + [JsonProperty("has_next_page")] + public bool HasNextPage { get; set; } + public GetTrackingsResponseDataPagination() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs index c981432..18a4083 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequest.cs @@ -17,15 +17,14 @@ public class MarkTrackingCompletedByIdRequest /// Reason One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`. /// [JsonProperty("reason")] - public string Reason { get; set; } + public MarkTrackingCompletedByIdRequestReason? Reason { get; set; } /// /// EventDatetime The actual occurrence time of the marked tracking status.The field supports the following formats: - YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("event_datetime",NullValueHandling = NullValueHandling.Ignore)] - public string? EventDatetime { get; set; } + [JsonProperty("event_datetime")] + public string EventDatetime { get; set; } public MarkTrackingCompletedByIdRequest() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequestReason.cs b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequestReason.cs new file mode 100644 index 0000000..a522dad --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdRequestReason.cs @@ -0,0 +1,24 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MarkTrackingCompletedByIdRequestReason + { + [EnumMember(Value = "DELIVERED")] + Delivered, + [EnumMember(Value = "LOST")] + Lost, + [EnumMember(Value = "RETURNED_TO_SENDER")] + ReturnedToSender, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs index d7cec5b..7b3bce4 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/MarkTrackingCompletedByIdResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class MarkTrackingCompletedByIdResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightMarkTrackingCompletedByIdResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsMarkTrackingCompletedByIdResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileMarkTrackingCompletedByIdResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileMarkTrackingCompletedByIdResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersMarkTrackingCompletedByIdResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public MarkTrackingCompletedByIdResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightMarkTrackingCompletedByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsMarkTrackingCompletedByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class FirstMileMarkTrackingCompletedByIdResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class LastMileMarkTrackingCompletedByIdResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileMarkTrackingCompletedByIdResponse() - { - } - } - /// - /// - /// - public class CustomersMarkTrackingCompletedByIdResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersMarkTrackingCompletedByIdResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Meta.cs b/src/AfterShipTracking/AfterShipTracking/Models/Meta.cs index 851c3d3..85f49df 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/Meta.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/Meta.cs @@ -21,16 +21,15 @@ public class Meta /// /// Message error message, only exist if the response status is not 2xx /// - [JsonProperty("message",NullValueHandling = NullValueHandling.Ignore)] - public string? Message { get; set; } + [JsonProperty("message")] + public string Message { get; set; } /// /// Type error type, only exist if the response status is not 2xx /// - [JsonProperty("type",NullValueHandling = NullValueHandling.Ignore)] - public string? Type { get; set; } + [JsonProperty("type")] + public MetaType? Type { get; set; } public Meta() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/MetaType.cs b/src/AfterShipTracking/AfterShipTracking/Models/MetaType.cs new file mode 100644 index 0000000..4ae2b43 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/MetaType.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// error type, only exist if the response status is not 2xx + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MetaType + { + [EnumMember(Value = "BadRequest")] + BadRequest, + [EnumMember(Value = "Unauthorized")] + Unauthorized, + [EnumMember(Value = "Forbidden")] + Forbidden, + [EnumMember(Value = "NotFound")] + NotFound, + [EnumMember(Value = "TooManyRequests")] + TooManyRequests, + [EnumMember(Value = "InternalError")] + InternalError, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsRequest.cs index 1c0aaa9..a890e06 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsRequest.cs @@ -27,5 +27,4 @@ public PostCourierConnectionsRequest() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsResponse.cs index a4ec419..5842233 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PostCourierConnectionsResponse.cs @@ -4,43 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// This model represents user-created courier connection details. AfterShip will use this information to retrieve tracking updates from carriers based on the provided tracking numbers. - /// public class PostCourierConnectionsResponse { - /// - /// Id The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// CourierSlug Unique courier code. Get courier codes . - /// - [JsonProperty("courier_slug")] - public string? CourierSlug { get; set; } - /// - /// Credentials It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier. - /// - [JsonProperty("credentials")] - public Dictionary? Credentials { get; set; } - /// - /// CreatedAt The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } + public Headers ResponseHeader { get; set; } + public CourierConnection Data { get; set; } public PostCourierConnectionsResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs index e5fab4c..2a6a473 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchRequest.cs @@ -22,5 +22,4 @@ public PredictBatchRequest() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs index 9c2cbc8..906cd5e 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponse.cs @@ -4,23 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class PredictBatchResponse { - /// - /// EstimatedDeliveryDates - /// - [JsonProperty("estimated_delivery_dates")] - public EstimatedDeliveryDateResponse [] EstimatedDeliveryDates { get; set; } + public Headers ResponseHeader { get; set; } + public PredictBatchResponseData Data { get; set; } public PredictBatchResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponseData.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponseData.cs new file mode 100644 index 0000000..70c6062 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictBatchResponseData.cs @@ -0,0 +1,25 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class PredictBatchResponseData + { + /// + /// EstimatedDeliveryDates + /// + [JsonProperty("estimated_delivery_dates")] + public EstimatedDeliveryDateResponse [] EstimatedDeliveryDates { get; set; } + public PredictBatchResponseData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs deleted file mode 100644 index ff619ed..0000000 --- a/src/AfterShipTracking/AfterShipTracking/Models/PredictRequest.cs +++ /dev/null @@ -1,201 +0,0 @@ -/* - * This code was auto generated by AfterShip SDK Generator. - * Do not edit the class manually. - */ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace AfterShipTracking -{ - /// - /// - /// - public class PredictRequest - { - /// - /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download. - /// - [JsonProperty("slug")] - public string Slug { get; set; } - /// - /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to . - /// - [JsonProperty("service_type_name",NullValueHandling = NullValueHandling.Ignore)] - public string? ServiceTypeName { get; set; } - /// - /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination. - /// - [JsonProperty("origin_address")] - public OriginAddressPredictRequest OriginAddress { get; set; } - /// - /// DestinationAddress The final destination of the customer where the delivery will be made. - /// - [JsonProperty("destination_address")] - public DestinationAddressPredictRequest DestinationAddress { get; set; } - /// - /// Weight AfterShip uses this object to calculate the total weight of the order. - /// - [JsonProperty("weight",NullValueHandling = NullValueHandling.Ignore)] - public WeightPredictRequest? Weight { get; set; } - /// - /// PackageCount The number of packages. - /// - [JsonProperty("package_count",NullValueHandling = NullValueHandling.Ignore)] - public int? PackageCount { get; set; } - /// - /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required. - /// - [JsonProperty("pickup_time",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupTime { get; set; } - /// - /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. - /// - [JsonProperty("estimated_pickup",NullValueHandling = NullValueHandling.Ignore)] - public EstimatedPickupPredictRequest? EstimatedPickup { get; set; } - public PredictRequest() - { - } - } - - /// - /// - /// - public class OriginAddressPredictRequest - { - /// - /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public OriginAddressPredictRequest() - { - } - } - /// - /// - /// - public class DestinationAddressPredictRequest - { - /// - /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("state",NullValueHandling = NullValueHandling.Ignore)] - public string? State { get; set; } - /// - /// City City of the destination address where the package will be delivered. - /// - [JsonProperty("city",NullValueHandling = NullValueHandling.Ignore)] - public string? City { get; set; } - /// - /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. - /// - [JsonProperty("raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? RawLocation { get; set; } - - public DestinationAddressPredictRequest() - { - } - } - /// - /// - /// - public class WeightPredictRequest - { - /// - /// Unit The weight unit of the package. - /// - [JsonProperty("unit")] - public string Unit { get; set; } - /// - /// Value The weight of the shipment. - /// - [JsonProperty("value")] - public double Value { get; set; } - - public WeightPredictRequest() - { - } - } - /// - /// - /// - public class EstimatedPickupPredictRequest - { - /// - /// OrderTime The local order time in the origin address time zone of the package. - /// - [JsonProperty("order_time")] - public string OrderTime { get; set; } - /// - /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. - /// - [JsonProperty("order_cutoff_time",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderCutoffTime { get; set; } - /// - /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. - /// - [JsonProperty("business_days",NullValueHandling = NullValueHandling.Ignore)] - public int? [] BusinessDays { get; set; } - /// - /// OrderProcessingTime - /// - [JsonProperty("order_processing_time",NullValueHandling = NullValueHandling.Ignore)] - public OrderProcessingTimeEstimatedPickupPredictRequest? OrderProcessingTime { get; set; } - - public EstimatedPickupPredictRequest() - { - } - } - /// - /// - /// - public class OrderProcessingTimeEstimatedPickupPredictRequest - { - /// - /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. - /// - [JsonProperty("unit",NullValueHandling = NullValueHandling.Ignore)] - public string? Unit { get; set; } - /// - /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. - /// - [JsonProperty("value",NullValueHandling = NullValueHandling.Ignore)] - public double? Value { get; set; } - - public OrderProcessingTimeEstimatedPickupPredictRequest() - { - } - } -} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs index e04895a..4a9ac0d 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PredictResponse.cs @@ -4,228 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// - /// public class PredictResponse { - /// - /// Id A string that acts as a unique identifier for the estimated delivery date value generated by AfterShip Predict API - /// - [JsonProperty("id")] - public string Id { get; set; } - /// - /// Slug AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download. - /// - [JsonProperty("slug")] - public string Slug { get; set; } - /// - /// ServiceTypeName AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to . - /// - [JsonProperty("service_type_name")] - public string? ServiceTypeName { get; set; } - /// - /// OriginAddress The location from where the package is picked up by the carrier to be delivered to the final destination. - /// - [JsonProperty("origin_address")] - public OriginAddressPredictResponse OriginAddress { get; set; } - /// - /// DestinationAddress The final destination of the customer where the delivery will be made. - /// - [JsonProperty("destination_address")] - public DestinationAddressPredictResponse DestinationAddress { get; set; } - /// - /// Weight AfterShip uses this object to calculate the total weight of the order. - /// - [JsonProperty("weight")] - public WeightPredictResponse? Weight { get; set; } - /// - /// PackageCount The number of packages. - /// - [JsonProperty("package_count")] - public int? PackageCount { get; set; } - /// - /// PickupTime The local pickup time in the origin address time zone of the package.Either `pickup_time` or `estimated_pickup` is required. - /// - [JsonProperty("pickup_time")] - public string? PickupTime { get; set; } - /// - /// EstimatedPickup The local pickup time of the package.Either `pickup_time` or `estimated_pickup` is required. - /// - [JsonProperty("estimated_pickup")] - public EstimatedPickupPredictResponse? EstimatedPickup { get; set; } - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment, provided by AfterShip. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment, provided by AfterShip. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The latest estimated delivery date of the shipment, provided by AfterShip. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } + public Headers ResponseHeader { get; set; } + public EstimatedDeliveryDateResponse Data { get; set; } public PredictResponse() { } } - - /// - /// - /// - public class OriginAddressPredictResponse - { - /// - /// CountryRegion The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("state")] - public string? State { get; set; } - /// - /// City City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City. - /// - [JsonProperty("city")] - public string? City { get; set; } - /// - /// PostalCode Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. Either `origin_address.state` or `origin_address.postal_code` is required. - /// - [JsonProperty("postal_code")] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address. - /// - [JsonProperty("raw_location")] - public string? RawLocation { get; set; } - - public OriginAddressPredictResponse() - { - } - } - /// - /// - /// - public class DestinationAddressPredictResponse - { - /// - /// CountryRegion The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code. - /// - [JsonProperty("country_region")] - public string CountryRegion { get; set; } - /// - /// State State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("state")] - public string? State { get; set; } - /// - /// City City of the destination address where the package will be delivered. - /// - [JsonProperty("city")] - public string? City { get; set; } - /// - /// PostalCode Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required. - /// - [JsonProperty("postal_code")] - public string? PostalCode { get; set; } - /// - /// RawLocation Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address. - /// - [JsonProperty("raw_location")] - public string? RawLocation { get; set; } - - public DestinationAddressPredictResponse() - { - } - } - /// - /// - /// - public class WeightPredictResponse - { - /// - /// Unit The weight unit of the package. - /// - [JsonProperty("unit")] - public string Unit { get; set; } - /// - /// Value The weight of the shipment. - /// - [JsonProperty("value")] - public double Value { get; set; } - - public WeightPredictResponse() - { - } - } - /// - /// - /// - public class EstimatedPickupPredictResponse - { - /// - /// OrderTime The local order time in the origin address time zone of the package. - /// - [JsonProperty("order_time")] - public string OrderTime { get; set; } - /// - /// OrderCutoffTime Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00. - /// - [JsonProperty("order_cutoff_time")] - public string? OrderCutoffTime { get; set; } - /// - /// BusinessDays Operating days in a week. Number refers to the weekday.E.g., [1,2,3,4,5] means operating days are from Monday to Friday.AfterShip will set [1,2,3,4,5] as the default value. - /// - [JsonProperty("business_days")] - public int? [] BusinessDays { get; set; } - /// - /// OrderProcessingTime - /// - [JsonProperty("order_processing_time")] - public OrderProcessingTimeEstimatedPickupPredictResponse? OrderProcessingTime { get; set; } - /// - /// PickupTime The local pickup time of the package. - /// - [JsonProperty("pickup_time")] - public string? PickupTime { get; set; } - - public EstimatedPickupPredictResponse() - { - } - } - /// - /// - /// - public class OrderProcessingTimeEstimatedPickupPredictResponse - { - /// - /// Unit Processing time of an order, from being placed to being picked up. Only support day as value now.AfterShip will set day as the default value. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value Processing time of an order, from being placed to being picked up.AfterShip will set 0 as the default value. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public OrderProcessingTimeEstimatedPickupPredictResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdRequest.cs index d96ef55..d2ebf50 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdRequest.cs @@ -22,5 +22,4 @@ public PutCourierConnectionsByIdRequest() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdResponse.cs index 30e1352..a5e512d 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/PutCourierConnectionsByIdResponse.cs @@ -4,43 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// This model represents user-created courier connection details. AfterShip will use this information to retrieve tracking updates from carriers based on the provided tracking numbers. - /// public class PutCourierConnectionsByIdResponse { - /// - /// Id The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// CourierSlug Unique courier code. Get courier codes . - /// - [JsonProperty("courier_slug")] - public string? CourierSlug { get; set; } - /// - /// Credentials It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier. - /// - [JsonProperty("credentials")] - public Dictionary? Credentials { get; set; } - /// - /// CreatedAt The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } + public Headers ResponseHeader { get; set; } + public CourierConnection Data { get; set; } public PutCourierConnectionsByIdResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs index d6fb4f1..86f1ec6 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/RetrackTrackingByIdResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class RetrackTrackingByIdResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateRetrackTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightRetrackTrackingByIdResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateRetrackTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryRetrackTrackingByIdResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryRetrackTrackingByIdResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsRetrackTrackingByIdResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileRetrackTrackingByIdResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileRetrackTrackingByIdResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersRetrackTrackingByIdResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public RetrackTrackingByIdResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateRetrackTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightRetrackTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateRetrackTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryRetrackTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryRetrackTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsRetrackTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstMileRetrackTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LastMileRetrackTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileRetrackTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomersRetrackTrackingByIdResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersRetrackTrackingByIdResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Tag.cs b/src/AfterShipTracking/AfterShipTracking/Models/Tag.cs index d2abeb6..017f5c5 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/Tag.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/Tag.cs @@ -17,17 +17,17 @@ public enum Tag [EnumMember(Value = "Pending")] Pending, [EnumMember(Value = "InfoReceived")] - Inforeceived, + InfoReceived, [EnumMember(Value = "InTransit")] - Intransit, + InTransit, [EnumMember(Value = "OutForDelivery")] - Outfordelivery, + OutForDelivery, [EnumMember(Value = "AttemptFail")] - Attemptfail, + AttemptFail, [EnumMember(Value = "Delivered")] Delivered, [EnumMember(Value = "AvailableForPickup")] - Availableforpickup, + AvailableForPickup, [EnumMember(Value = "Exception")] Exception, [EnumMember(Value = "Expired")] diff --git a/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs b/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs index 3fecdc4..d712d0e 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/Tracking.cs @@ -16,691 +16,380 @@ public class Tracking /// /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. /// - [JsonProperty("id",NullValueHandling = NullValueHandling.Ignore)] - public string? Id { get; set; } + [JsonProperty("id")] + public string Id { get; set; } /// /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. /// - [JsonProperty("legacy_id",NullValueHandling = NullValueHandling.Ignore)] - public string? LegacyId { get; set; } + [JsonProperty("legacy_id")] + public string LegacyId { get; set; } /// /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. /// - [JsonProperty("created_at",NullValueHandling = NullValueHandling.Ignore)] - public string? CreatedAt { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } /// /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. /// - [JsonProperty("updated_at",NullValueHandling = NullValueHandling.Ignore)] - public string? UpdatedAt { get; set; } + [JsonProperty("updated_at")] + public string UpdatedAt { get; set; } /// /// TrackingNumber Tracking number. /// - [JsonProperty("tracking_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingNumber { get; set; } + [JsonProperty("tracking_number")] + public string TrackingNumber { get; set; } /// /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } + [JsonProperty("slug")] + public string Slug { get; set; } /// /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. /// - [JsonProperty("active",NullValueHandling = NullValueHandling.Ignore)] - public bool? Active { get; set; } + [JsonProperty("active")] + public bool Active { get; set; } /// /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. /// - [JsonProperty("custom_fields",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("custom_fields")] public Dictionary? CustomFields { get; set; } /// /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. /// - [JsonProperty("transit_time",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("transit_time")] public int? TransitTime { get; set; } /// /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. /// - [JsonProperty("origin_country_region",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("origin_country_region")] public string? OriginCountryRegion { get; set; } /// /// OriginState The state of the sender’s address. /// - [JsonProperty("origin_state",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("origin_state")] public string? OriginState { get; set; } /// /// OriginCity The city of the sender’s address. /// - [JsonProperty("origin_city",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("origin_city")] public string? OriginCity { get; set; } /// /// OriginPostalCode The postal code of the sender’s address. /// - [JsonProperty("origin_postal_code",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("origin_postal_code")] public string? OriginPostalCode { get; set; } /// /// OriginRawLocation The sender address that the shipment is shipping from. /// - [JsonProperty("origin_raw_location",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("origin_raw_location")] public string? OriginRawLocation { get; set; } /// /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. /// - [JsonProperty("destination_country_region",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("destination_country_region")] public string? DestinationCountryRegion { get; set; } /// /// DestinationState The state of the recipient’s address. /// - [JsonProperty("destination_state",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("destination_state")] public string? DestinationState { get; set; } /// /// DestinationCity The city of the recipient’s address. /// - [JsonProperty("destination_city",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("destination_city")] public string? DestinationCity { get; set; } /// /// DestinationPostalCode The postal code of the recipient’s address. /// - [JsonProperty("destination_postal_code",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("destination_postal_code")] public string? DestinationPostalCode { get; set; } /// /// DestinationRawLocation The shipping address that the shipment is shipping to. /// - [JsonProperty("destination_raw_location",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("destination_raw_location")] public string? DestinationRawLocation { get; set; } /// /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. /// - [JsonProperty("courier_destination_country_region",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("courier_destination_country_region")] public string? CourierDestinationCountryRegion { get; set; } /// /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. /// - [JsonProperty("courier_estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public CourierEstimatedDeliveryDateTracking? CourierEstimatedDeliveryDate { get; set; } + [JsonProperty("courier_estimated_delivery_date")] + public TrackingCourierEstimatedDeliveryDate? CourierEstimatedDeliveryDate { get; set; } /// /// Note Text field for the note. /// - [JsonProperty("note",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("note")] public string? Note { get; set; } /// /// OrderId A globally-unique identifier for the order. /// - [JsonProperty("order_id",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("order_id")] public string? OrderId { get; set; } /// /// OrderIdPath The URL for the order in your system or store. /// - [JsonProperty("order_id_path",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("order_id_path")] public string? OrderIdPath { get; set; } /// /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. /// - [JsonProperty("order_date",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("order_date")] public string? OrderDate { get; set; } /// /// ShipmentPackageCount Number of packages under the tracking. /// - [JsonProperty("shipment_package_count",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("shipment_package_count")] public double? ShipmentPackageCount { get; set; } /// /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("shipment_pickup_date",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("shipment_pickup_date")] public string? ShipmentPickupDate { get; set; } /// /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("shipment_delivery_date",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("shipment_delivery_date")] public string? ShipmentDeliveryDate { get; set; } /// /// ShipmentType The carrier service type for the shipment. /// - [JsonProperty("shipment_type",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("shipment_type")] public string? ShipmentType { get; set; } /// /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making /// - [JsonProperty("shipment_weight",NullValueHandling = NullValueHandling.Ignore)] - public ShipmentWeightTracking? ShipmentWeight { get; set; } + [JsonProperty("shipment_weight")] + public TrackingShipmentWeight? ShipmentWeight { get; set; } /// /// SignedBy Signed by information for delivered shipment. /// - [JsonProperty("signed_by",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("signed_by")] public string? SignedBy { get; set; } /// /// Source Source of how this tracking is added. /// - [JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)] - public string? Source { get; set; } + [JsonProperty("source")] + public string Source { get; set; } /// /// Tag Current status of tracking. ( /// - [JsonProperty("tag",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("tag")] public Tag? Tag { get; set; } /// /// Subtag Current subtag of tracking. ( /// - [JsonProperty("subtag",NullValueHandling = NullValueHandling.Ignore)] - public string? Subtag { get; set; } + [JsonProperty("subtag")] + public string Subtag { get; set; } /// /// SubtagMessage Normalized tracking message. ( /// - [JsonProperty("subtag_message",NullValueHandling = NullValueHandling.Ignore)] - public string? SubtagMessage { get; set; } + [JsonProperty("subtag_message")] + public string SubtagMessage { get; set; } /// /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). /// - [JsonProperty("title",NullValueHandling = NullValueHandling.Ignore)] - public string? Title { get; set; } + [JsonProperty("title")] + public string Title { get; set; } /// /// TrackedCount Number of attempts AfterShip tracks at courier's system. /// - [JsonProperty("tracked_count",NullValueHandling = NullValueHandling.Ignore)] - public double? TrackedCount { get; set; } + [JsonProperty("tracked_count")] + public double TrackedCount { get; set; } /// /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null /// - [JsonProperty("last_mile_tracking_supported",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("last_mile_tracking_supported")] public bool? LastMileTrackingSupported { get; set; } /// /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("language")] public string? Language { get; set; } /// /// UniqueToken Deprecated /// - [JsonProperty("unique_token",NullValueHandling = NullValueHandling.Ignore)] - public string? UniqueToken { get; set; } + [JsonProperty("unique_token")] + public string UniqueToken { get; set; } /// /// Checkpoints Array of checkpoint object describes the checkpoint information. /// - [JsonProperty("checkpoints",NullValueHandling = NullValueHandling.Ignore)] - public Checkpoint? [] Checkpoints { get; set; } + [JsonProperty("checkpoints")] + public Checkpoint [] Checkpoints { get; set; } /// /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. /// - [JsonProperty("subscribed_smses",NullValueHandling = NullValueHandling.Ignore)] - public string? [] SubscribedSmses { get; set; } + [JsonProperty("subscribed_smses")] + public string [] SubscribedSmses { get; set; } /// /// SubscribedEmails Email address(es) subscribed to receive email notifications. /// - [JsonProperty("subscribed_emails",NullValueHandling = NullValueHandling.Ignore)] - public string? [] SubscribedEmails { get; set; } + [JsonProperty("subscribed_emails")] + public string [] SubscribedEmails { get; set; } /// /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. /// - [JsonProperty("return_to_sender",NullValueHandling = NullValueHandling.Ignore)] - public bool? ReturnToSender { get; set; } + [JsonProperty("return_to_sender")] + public bool ReturnToSender { get; set; } /// /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("order_promised_delivery_date",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("order_promised_delivery_date")] public string? OrderPromisedDeliveryDate { get; set; } /// /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door /// - [JsonProperty("delivery_type",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("delivery_type")] public string? DeliveryType { get; set; } /// /// PickupLocation Shipment pickup location for receiver /// - [JsonProperty("pickup_location",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("pickup_location")] public string? PickupLocation { get; set; } /// /// PickupNote Shipment pickup note for receiver /// - [JsonProperty("pickup_note",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("pickup_note")] public string? PickupNote { get; set; } /// /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. /// - [JsonProperty("courier_tracking_link",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("courier_tracking_link")] public string? CourierTrackingLink { get; set; } /// /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("first_attempted_at",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("first_attempted_at")] public string? FirstAttemptedAt { get; set; } /// /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. /// - [JsonProperty("courier_redirect_link",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("courier_redirect_link")] public string? CourierRedirectLink { get; set; } /// /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. /// - [JsonProperty("tracking_account_number",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("tracking_account_number")] public string? TrackingAccountNumber { get; set; } /// /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. /// - [JsonProperty("tracking_key",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("tracking_key")] public string? TrackingKey { get; set; } /// /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. /// - [JsonProperty("tracking_ship_date",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("tracking_ship_date")] public string? TrackingShipDate { get; set; } /// /// OnTimeStatus Whether the tracking is delivered on time or not. /// - [JsonProperty("on_time_status",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("on_time_status")] public string? OnTimeStatus { get; set; } /// /// OnTimeDifference The difference days of the on time. /// - [JsonProperty("on_time_difference",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("on_time_difference")] public double? OnTimeDifference { get; set; } /// /// OrderTags The tags of the order. /// - [JsonProperty("order_tags",NullValueHandling = NullValueHandling.Ignore)] - public string? [] OrderTags { get; set; } + [JsonProperty("order_tags")] + public string [] OrderTags { get; set; } /// /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. /// - [JsonProperty("aftership_estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public AftershipEstimatedDeliveryDateTracking? AftershipEstimatedDeliveryDate { get; set; } + [JsonProperty("aftership_estimated_delivery_date")] + public TrackingAftershipEstimatedDeliveryDate? AftershipEstimatedDeliveryDate { get; set; } /// /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. /// - [JsonProperty("custom_estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public CustomEstimatedDeliveryDateTracking? CustomEstimatedDeliveryDate { get; set; } + [JsonProperty("custom_estimated_delivery_date")] + public TrackingCustomEstimatedDeliveryDate? CustomEstimatedDeliveryDate { get; set; } /// /// OrderNumber A unique, human-readable identifier for the order. /// - [JsonProperty("order_number",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("order_number")] public string? OrderNumber { get; set; } /// /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. /// - [JsonProperty("first_estimated_delivery",NullValueHandling = NullValueHandling.Ignore)] - public FirstEstimatedDeliveryTracking? FirstEstimatedDelivery { get; set; } + [JsonProperty("first_estimated_delivery")] + public TrackingFirstEstimatedDelivery? FirstEstimatedDelivery { get; set; } /// /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. /// - [JsonProperty("latest_estimated_delivery",NullValueHandling = NullValueHandling.Ignore)] - public LatestEstimatedDeliveryTracking? LatestEstimatedDelivery { get; set; } + [JsonProperty("latest_estimated_delivery")] + public TrackingLatestEstimatedDelivery? LatestEstimatedDelivery { get; set; } /// /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. /// - [JsonProperty("shipment_tags",NullValueHandling = NullValueHandling.Ignore)] - public string? [] ShipmentTags { get; set; } + [JsonProperty("shipment_tags")] + public string [] ShipmentTags { get; set; } /// /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. ///
- [JsonProperty("courier_connection_id",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("courier_connection_id")] public string? CourierConnectionId { get; set; } /// /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. /// - [JsonProperty("carbon_emissions",NullValueHandling = NullValueHandling.Ignore)] - public CarbonEmissionsTracking? CarbonEmissions { get; set; } + [JsonProperty("carbon_emissions")] + public TrackingCarbonEmissions? CarbonEmissions { get; set; } /// /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . /// - [JsonProperty("location_id",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("location_id")] public string? LocationId { get; set; } /// /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. /// - [JsonProperty("shipping_method",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("shipping_method")] public string? ShippingMethod { get; set; } /// /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. /// - [JsonProperty("failed_delivery_attempts",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("failed_delivery_attempts")] public int? FailedDeliveryAttempts { get; set; } /// /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
///
- [JsonProperty("signature_requirement",NullValueHandling = NullValueHandling.Ignore)] - public string? SignatureRequirement { get; set; } + [JsonProperty("signature_requirement")] + public TrackingSignatureRequirement? SignatureRequirement { get; set; } /// /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. /// - [JsonProperty("delivery_location_type",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("delivery_location_type")] public string? DeliveryLocationType { get; set; } /// /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. /// - [JsonProperty("aftership_tracking_url",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("aftership_tracking_url")] public string? AftershipTrackingUrl { get; set; } /// /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. /// - [JsonProperty("aftership_tracking_order_url",NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("aftership_tracking_order_url")] public string? AftershipTrackingOrderUrl { get; set; } /// /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. /// - [JsonProperty("first_mile",NullValueHandling = NullValueHandling.Ignore)] - public FirstMileTracking? FirstMile { get; set; } + [JsonProperty("first_mile")] + public TrackingFirstMile? FirstMile { get; set; } /// /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. /// - [JsonProperty("last_mile",NullValueHandling = NullValueHandling.Ignore)] - public LastMileTracking? LastMile { get; set; } + [JsonProperty("last_mile")] + public TrackingLastMile? LastMile { get; set; } /// /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. /// - [JsonProperty("customers",NullValueHandling = NullValueHandling.Ignore)] - public CustomersTracking? [] Customers { get; set; } + [JsonProperty("customers")] + public TrackingCustomers [] Customers { get; set; } public Tracking() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateTracking - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateTracking() - { - } - } - /// - /// - /// - public class ShipmentWeightTracking - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit",NullValueHandling = NullValueHandling.Ignore)] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value",NullValueHandling = NullValueHandling.Ignore)] - public double? Value { get; set; } - - public ShipmentWeightTracking() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateTracking - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code",NullValueHandling = NullValueHandling.Ignore)] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max",NullValueHandling = NullValueHandling.Ignore)] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateTracking() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateTracking - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type",NullValueHandling = NullValueHandling.Ignore)] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime",NullValueHandling = NullValueHandling.Ignore)] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateTracking() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryTracking - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type",NullValueHandling = NullValueHandling.Ignore)] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime",NullValueHandling = NullValueHandling.Ignore)] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryTracking() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryTracking - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type",NullValueHandling = NullValueHandling.Ignore)] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime",NullValueHandling = NullValueHandling.Ignore)] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max",NullValueHandling = NullValueHandling.Ignore)] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason",NullValueHandling = NullValueHandling.Ignore)] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryTracking() - { - } - } - /// - /// - /// - public class CarbonEmissionsTracking - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit",NullValueHandling = NullValueHandling.Ignore)] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value",NullValueHandling = NullValueHandling.Ignore)] - public double? Value { get; set; } - - public CarbonEmissionsTracking() - { - } - } - /// - /// - /// - public class FirstMileTracking - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time",NullValueHandling = NullValueHandling.Ignore)] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierTrackingLink { get; set; } - - public FirstMileTracking() - { - } - } - /// - /// - /// - public class LastMileTracking - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time",NullValueHandling = NullValueHandling.Ignore)] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link",NullValueHandling = NullValueHandling.Ignore)] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source",NullValueHandling = NullValueHandling.Ignore)] - public string? Source { get; set; } - - public LastMileTracking() - { - } - } - /// - /// - /// - public class CustomersTracking - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role",NullValueHandling = NullValueHandling.Ignore)] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name",NullValueHandling = NullValueHandling.Ignore)] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number",NullValueHandling = NullValueHandling.Ignore)] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email",NullValueHandling = NullValueHandling.Ignore)] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] - public string? Language { get; set; } - - public CustomersTracking() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingAftershipEstimatedDeliveryDate.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingAftershipEstimatedDeliveryDate.cs new file mode 100644 index 0000000..3993a84 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingAftershipEstimatedDeliveryDate.cs @@ -0,0 +1,40 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + /// + public class TrackingAftershipEstimatedDeliveryDate + { + /// + /// EstimatedDeliveryDate The estimated arrival date of the shipment. + /// + [JsonProperty("estimated_delivery_date")] + public string EstimatedDeliveryDate { get; set; } + /// + /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . + /// + [JsonProperty("confidence_code")] + public double ConfidenceCode { get; set; } + /// + /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. + /// + [JsonProperty("estimated_delivery_date_min")] + public string EstimatedDeliveryDateMin { get; set; } + /// + /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. + /// + [JsonProperty("estimated_delivery_date_max")] + public string EstimatedDeliveryDateMax { get; set; } + public TrackingAftershipEstimatedDeliveryDate() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingCarbonEmissions.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCarbonEmissions.cs new file mode 100644 index 0000000..fd334b7 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCarbonEmissions.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. + /// + public class TrackingCarbonEmissions + { + /// + /// Unit The unit in which the value field is expressed. Allowed values: kg + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value The total amount of carbon emissions + /// + [JsonProperty("value")] + public double Value { get; set; } + public TrackingCarbonEmissions() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingCourierEstimatedDeliveryDate.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCourierEstimatedDeliveryDate.cs new file mode 100644 index 0000000..ed78ab1 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCourierEstimatedDeliveryDate.cs @@ -0,0 +1,35 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The field contains the estimated delivery date provided by the carrier. + /// + public class TrackingCourierEstimatedDeliveryDate + { + /// + /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + /// + [JsonProperty("estimated_delivery_date")] + public string? EstimatedDeliveryDate { get; set; } + /// + /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + /// + [JsonProperty("estimated_delivery_date_min")] + public string? EstimatedDeliveryDateMin { get; set; } + /// + /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ + /// + [JsonProperty("estimated_delivery_date_max")] + public string? EstimatedDeliveryDateMax { get; set; } + public TrackingCourierEstimatedDeliveryDate() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDate.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDate.cs new file mode 100644 index 0000000..4745dae --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDate.cs @@ -0,0 +1,40 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. + /// + public class TrackingCustomEstimatedDeliveryDate + { + /// + /// Type The format of the EDD. Either a single date or a date range. + /// + [JsonProperty("type")] + public TrackingCustomEstimatedDeliveryDateType? Type { get; set; } + /// + /// Datetime The specific EDD date. + /// + [JsonProperty("datetime")] + public string? Datetime { get; set; } + /// + /// DatetimeMin For a date range EDD format, the date for the lower end of the range. + /// + [JsonProperty("datetime_min")] + public string? DatetimeMin { get; set; } + /// + /// DatetimeMax For a date range EDD format, the date for the upper end of the range. + /// + [JsonProperty("datetime_max")] + public string? DatetimeMax { get; set; } + public TrackingCustomEstimatedDeliveryDate() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDateType.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDateType.cs new file mode 100644 index 0000000..8b6129f --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomEstimatedDeliveryDateType.cs @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The format of the EDD. Either a single date or a date range. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingCustomEstimatedDeliveryDateType + { + [EnumMember(Value = "range")] + Range, + [EnumMember(Value = "specific")] + Specific, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomers.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomers.cs new file mode 100644 index 0000000..34600d9 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingCustomers.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class TrackingCustomers + { + /// + /// Role The role of the customer, indicating whether the customer is an individual or a company. + /// + [JsonProperty("role")] + public string? Role { get; set; } + /// + /// Name Customer name associated with the tracking. + /// + [JsonProperty("name")] + public string? Name { get; set; } + /// + /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. + /// + [JsonProperty("phone_number")] + public string? PhoneNumber { get; set; } + /// + /// Email Email address(es) to receive email notifications. + /// + [JsonProperty("email")] + public string? Email { get; set; } + /// + /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. + /// + [JsonProperty("language")] + public string? Language { get; set; } + public TrackingCustomers() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDelivery.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDelivery.cs new file mode 100644 index 0000000..ce2c06a --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDelivery.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + /// + public class TrackingFirstEstimatedDelivery + { + /// + /// Type The format of the EDD. Either a single date or a date range. + /// + [JsonProperty("type")] + public TrackingFirstEstimatedDeliveryType? Type { get; set; } + /// + /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. + /// + [JsonProperty("source")] + public TrackingFirstEstimatedDeliverySource? Source { get; set; } + /// + /// Datetime The latest EDD time. + /// + [JsonProperty("datetime")] + public string? Datetime { get; set; } + /// + /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. + /// + [JsonProperty("datetime_min")] + public string? DatetimeMin { get; set; } + /// + /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. + /// + [JsonProperty("datetime_max")] + public string? DatetimeMax { get; set; } + public TrackingFirstEstimatedDelivery() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliverySource.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliverySource.cs new file mode 100644 index 0000000..ec63c6f --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliverySource.cs @@ -0,0 +1,26 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingFirstEstimatedDeliverySource + { + [EnumMember(Value = "Carrier EDD")] + CarrierEdd, + [EnumMember(Value = "AfterShip EDD")] + AfterShipEdd, + [EnumMember(Value = "Custom EDD")] + CustomEdd, + [EnumMember(Value = "Order EDD")] + OrderEdd, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliveryType.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliveryType.cs new file mode 100644 index 0000000..c4d9885 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstEstimatedDeliveryType.cs @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The format of the EDD. Either a single date or a date range. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingFirstEstimatedDeliveryType + { + [EnumMember(Value = "range")] + Range, + [EnumMember(Value = "specific")] + Specific, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstMile.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstMile.cs new file mode 100644 index 0000000..4633c9b --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingFirstMile.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. + /// + public class TrackingFirstMile + { + /// + /// TrackingNumber The tracking number of the first-mile carrier. + /// + [JsonProperty("tracking_number")] + public string TrackingNumber { get; set; } + /// + /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . + /// + [JsonProperty("slug")] + public string Slug { get; set; } + /// + /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date + /// + [JsonProperty("transit_time")] + public int? TransitTime { get; set; } + /// + /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". + /// + [JsonProperty("courier_redirect_link")] + public string? CourierRedirectLink { get; set; } + /// + /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". + /// + [JsonProperty("courier_tracking_link")] + public string? CourierTrackingLink { get; set; } + public TrackingFirstMile() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMile.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMile.cs new file mode 100644 index 0000000..cbc78f1 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMile.cs @@ -0,0 +1,50 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. + /// + public class TrackingLastMile + { + /// + /// TrackingNumber The tracking number of the last-mile carrier. + /// + [JsonProperty("tracking_number")] + public string TrackingNumber { get; set; } + /// + /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . + /// + [JsonProperty("slug")] + public string Slug { get; set; } + /// + /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date + /// + [JsonProperty("transit_time")] + public int? TransitTime { get; set; } + /// + /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". + /// + [JsonProperty("courier_tracking_link")] + public string? CourierTrackingLink { get; set; } + /// + /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". + /// + [JsonProperty("courier_redirect_link")] + public string? CourierRedirectLink { get; set; } + /// + /// Source The field indicates the source of last-mile carrier. + /// + [JsonProperty("source")] + public TrackingLastMileSource? Source { get; set; } + public TrackingLastMile() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMileSource.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMileSource.cs new file mode 100644 index 0000000..9f2b68d --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLastMileSource.cs @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The field indicates the source of last-mile carrier. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingLastMileSource + { + [EnumMember(Value = "system")] + System, + [EnumMember(Value = "user")] + User, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDelivery.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDelivery.cs new file mode 100644 index 0000000..7c88c92 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDelivery.cs @@ -0,0 +1,50 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. + /// + public class TrackingLatestEstimatedDelivery + { + /// + /// Type The format of the EDD. Either a single date or a date range. + /// + [JsonProperty("type")] + public TrackingLatestEstimatedDeliveryType? Type { get; set; } + /// + /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. + /// + [JsonProperty("source")] + public TrackingLatestEstimatedDeliverySource? Source { get; set; } + /// + /// Datetime The latest EDD time. + /// + [JsonProperty("datetime")] + public string? Datetime { get; set; } + /// + /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. + /// + [JsonProperty("datetime_min")] + public string? DatetimeMin { get; set; } + /// + /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. + /// + [JsonProperty("datetime_max")] + public string? DatetimeMax { get; set; } + /// + /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . + /// + [JsonProperty("revise_reason")] + public string? ReviseReason { get; set; } + public TrackingLatestEstimatedDelivery() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliverySource.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliverySource.cs new file mode 100644 index 0000000..e261e7b --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliverySource.cs @@ -0,0 +1,26 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingLatestEstimatedDeliverySource + { + [EnumMember(Value = "Carrier EDD")] + CarrierEdd, + [EnumMember(Value = "AfterShip EDD")] + AfterShipEdd, + [EnumMember(Value = "Custom EDD")] + CustomEdd, + [EnumMember(Value = "Order EDD")] + OrderEdd, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliveryType.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliveryType.cs new file mode 100644 index 0000000..3326166 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingLatestEstimatedDeliveryType.cs @@ -0,0 +1,22 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The format of the EDD. Either a single date or a date range. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingLatestEstimatedDeliveryType + { + [EnumMember(Value = "range")] + Range, + [EnumMember(Value = "specific")] + Specific, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponse.cs index 743d2f2..c3d6f68 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponse.cs @@ -27,5 +27,4 @@ public TrackingResponse() { } } - } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackings.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackings.cs index 662724e..84b2667 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackings.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackings.cs @@ -21,56 +21,10 @@ public class TrackingResponseForGetTrackings /// /// Data /// - [JsonProperty("data",NullValueHandling = NullValueHandling.Ignore)] - public DataTrackingResponseForGetTrackings? Data { get; set; } + [JsonProperty("data")] + public TrackingResponseForGetTrackingsData Data { get; set; } public TrackingResponseForGetTrackings() { } } - - /// - /// - /// - public class DataTrackingResponseForGetTrackings - { - /// - /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects. - /// - [JsonProperty("pagination",NullValueHandling = NullValueHandling.Ignore)] - public PaginationDataTrackingResponseForGetTrackings? Pagination { get; set; } - /// - /// Trackings Array of - /// - [JsonProperty("trackings",NullValueHandling = NullValueHandling.Ignore)] - public Tracking? [] Trackings { get; set; } - - public DataTrackingResponseForGetTrackings() - { - } - } - /// - /// - /// - public class PaginationDataTrackingResponseForGetTrackings - { - /// - /// Total The total number of trackings. - /// - [JsonProperty("total",NullValueHandling = NullValueHandling.Ignore)] - public int? Total { get; set; } - /// - /// NextCursor A string representing the cursor value for the next page of results. - /// - [JsonProperty("next_cursor",NullValueHandling = NullValueHandling.Ignore)] - public string? NextCursor { get; set; } - /// - /// HasNextPage To indicate if next page is available. - /// - [JsonProperty("has_next_page",NullValueHandling = NullValueHandling.Ignore)] - public bool? HasNextPage { get; set; } - - public PaginationDataTrackingResponseForGetTrackings() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsData.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsData.cs new file mode 100644 index 0000000..8d066df --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsData.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class TrackingResponseForGetTrackingsData + { + /// + /// Pagination The Pagination holds the information for the pagination when the response contains multiple objects. + /// + [JsonProperty("pagination")] + public TrackingResponseForGetTrackingsDataPagination Pagination { get; set; } + /// + /// Trackings Array of + /// + [JsonProperty("trackings")] + public Tracking [] Trackings { get; set; } + public TrackingResponseForGetTrackingsData() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsDataPagination.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsDataPagination.cs new file mode 100644 index 0000000..3825988 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingResponseForGetTrackingsDataPagination.cs @@ -0,0 +1,35 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The Pagination holds the information for the pagination when the response contains multiple objects. + /// + public class TrackingResponseForGetTrackingsDataPagination + { + /// + /// Total The total number of trackings. + /// + [JsonProperty("total")] + public int Total { get; set; } + /// + /// NextCursor A string representing the cursor value for the next page of results. + /// + [JsonProperty("next_cursor")] + public string NextCursor { get; set; } + /// + /// HasNextPage To indicate if next page is available. + /// + [JsonProperty("has_next_page")] + public bool HasNextPage { get; set; } + public TrackingResponseForGetTrackingsDataPagination() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingShipmentWeight.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingShipmentWeight.cs new file mode 100644 index 0000000..e20c19a --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingShipmentWeight.cs @@ -0,0 +1,30 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making + /// + public class TrackingShipmentWeight + { + /// + /// Unit The unit in which the value field is expressed. + /// + [JsonProperty("unit")] + public string Unit { get; set; } + /// + /// Value The total amount of shipment weight. + /// + [JsonProperty("value")] + public double Value { get; set; } + public TrackingShipmentWeight() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/TrackingSignatureRequirement.cs b/src/AfterShipTracking/AfterShipTracking/Models/TrackingSignatureRequirement.cs new file mode 100644 index 0000000..4d00950 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/TrackingSignatureRequirement.cs @@ -0,0 +1,28 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.</br> + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TrackingSignatureRequirement + { + [EnumMember(Value = "signature_required")] + SignatureRequired, + [EnumMember(Value = "adult_signature_required")] + AdultSignatureRequired, + [EnumMember(Value = "indirect_signature_required")] + IndirectSignatureRequired, + [EnumMember(Value = "no_signature_required")] + NoSignatureRequired, + [EnumMember(Value = "null")] + Null, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs index ab2fdf8..7ad2949 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequest.cs @@ -16,191 +16,155 @@ public class UpdateTrackingByIdRequest /// /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). /// - [JsonProperty("title",NullValueHandling = NullValueHandling.Ignore)] - public string? Title { get; set; } + [JsonProperty("title")] + public string Title { get; set; } /// /// OrderId A globally-unique identifier for the order. /// - [JsonProperty("order_id",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderId { get; set; } + [JsonProperty("order_id")] + public string OrderId { get; set; } /// /// OrderIdPath The URL for the order in your system or store. /// - [JsonProperty("order_id_path",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderIdPath { get; set; } + [JsonProperty("order_id_path")] + public string OrderIdPath { get; set; } /// /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any /// - [JsonProperty("custom_fields",NullValueHandling = NullValueHandling.Ignore)] - public Dictionary? CustomFields { get; set; } + [JsonProperty("custom_fields")] + public Dictionary CustomFields { get; set; } /// /// Note Text field for the note.Input `""` to clear the value of this field. /// - [JsonProperty("note",NullValueHandling = NullValueHandling.Ignore)] - public string? Note { get; set; } + [JsonProperty("note")] + public string Note { get; set; } /// /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an to specify the language. /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] - public string? Language { get; set; } + [JsonProperty("language")] + public string Language { get; set; } /// /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ /// - [JsonProperty("order_promised_delivery_date",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderPromisedDeliveryDate { get; set; } + [JsonProperty("order_promised_delivery_date")] + public string OrderPromisedDeliveryDate { get; set; } /// /// DeliveryType Shipment delivery type- `pickup_at_store`- `pickup_at_courier`- `door_to_door` /// - [JsonProperty("delivery_type",NullValueHandling = NullValueHandling.Ignore)] - public string? DeliveryType { get; set; } + [JsonProperty("delivery_type")] + public UpdateTrackingByIdRequestDeliveryType? DeliveryType { get; set; } /// /// PickupLocation Shipment pickup location for receiver /// - [JsonProperty("pickup_location",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupLocation { get; set; } + [JsonProperty("pickup_location")] + public string PickupLocation { get; set; } /// /// PickupNote Shipment pickup note for receiver /// - [JsonProperty("pickup_note",NullValueHandling = NullValueHandling.Ignore)] - public string? PickupNote { get; set; } + [JsonProperty("pickup_note")] + public string PickupNote { get; set; } /// /// Slug Unique code of each courier. Provide a single courier.(https://admin.aftership.com/settings/couriers). Get a list of courier slug using /// - [JsonProperty("slug",NullValueHandling = NullValueHandling.Ignore)] - public string? Slug { get; set; } + [JsonProperty("slug")] + public string Slug { get; set; } /// /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. /// - [JsonProperty("tracking_account_number",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingAccountNumber { get; set; } + [JsonProperty("tracking_account_number")] + public string TrackingAccountNumber { get; set; } /// /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. /// - [JsonProperty("tracking_key",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingKey { get; set; } + [JsonProperty("tracking_key")] + public string TrackingKey { get; set; } /// /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. /// - [JsonProperty("tracking_ship_date",NullValueHandling = NullValueHandling.Ignore)] - public string? TrackingShipDate { get; set; } + [JsonProperty("tracking_ship_date")] + public string TrackingShipDate { get; set; } /// /// OrderNumber A unique, human-readable identifier for the order. /// - [JsonProperty("order_number",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderNumber { get; set; } + [JsonProperty("order_number")] + public string OrderNumber { get; set; } /// /// OrderDate Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 /// - [JsonProperty("order_date",NullValueHandling = NullValueHandling.Ignore)] - public string? OrderDate { get; set; } + [JsonProperty("order_date")] + public string OrderDate { get; set; } /// /// ShipmentType The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier. /// - [JsonProperty("shipment_type",NullValueHandling = NullValueHandling.Ignore)] - public string? ShipmentType { get; set; } + [JsonProperty("shipment_type")] + public string ShipmentType { get; set; } /// /// OriginCountryRegion The for more details. /// - [JsonProperty("origin_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginCountryRegion { get; set; } + [JsonProperty("origin_country_region")] + public string OriginCountryRegion { get; set; } /// /// OriginState The state of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_state",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginState { get; set; } + [JsonProperty("origin_state")] + public string OriginState { get; set; } /// /// OriginCity The city of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_city",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginCity { get; set; } + [JsonProperty("origin_city")] + public string OriginCity { get; set; } /// /// OriginPostalCode The postal of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginPostalCode { get; set; } + [JsonProperty("origin_postal_code")] + public string OriginPostalCode { get; set; } /// /// OriginRawLocation The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("origin_raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? OriginRawLocation { get; set; } + [JsonProperty("origin_raw_location")] + public string OriginRawLocation { get; set; } /// /// DestinationCountryRegion The for more details. /// - [JsonProperty("destination_country_region",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationCountryRegion { get; set; } + [JsonProperty("destination_country_region")] + public string DestinationCountryRegion { get; set; } /// /// DestinationState The state of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. /// - [JsonProperty("destination_state",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationState { get; set; } + [JsonProperty("destination_state")] + public string DestinationState { get; set; } /// /// DestinationCity The city of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("destination_city",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationCity { get; set; } + [JsonProperty("destination_city")] + public string DestinationCity { get; set; } /// /// DestinationPostalCode The postal of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. /// - [JsonProperty("destination_postal_code",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationPostalCode { get; set; } + [JsonProperty("destination_postal_code")] + public string DestinationPostalCode { get; set; } /// /// DestinationRawLocation The shipping address that the shipment is shipping to. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. /// - [JsonProperty("destination_raw_location",NullValueHandling = NullValueHandling.Ignore)] - public string? DestinationRawLocation { get; set; } + [JsonProperty("destination_raw_location")] + public string DestinationRawLocation { get; set; } /// /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . /// - [JsonProperty("location_id",NullValueHandling = NullValueHandling.Ignore)] - public string? LocationId { get; set; } + [JsonProperty("location_id")] + public string LocationId { get; set; } /// /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. /// - [JsonProperty("shipping_method",NullValueHandling = NullValueHandling.Ignore)] - public string? ShippingMethod { get; set; } + [JsonProperty("shipping_method")] + public string ShippingMethod { get; set; } /// /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. /// - [JsonProperty("customers",NullValueHandling = NullValueHandling.Ignore)] - public CustomersUpdateTrackingByIdRequest? [] Customers { get; set; } + [JsonProperty("customers")] + public UpdateTrackingByIdRequestCustomers [] Customers { get; set; } public UpdateTrackingByIdRequest() { } } - - /// - /// - /// - public class CustomersUpdateTrackingByIdRequest - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role",NullValueHandling = NullValueHandling.Ignore)] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name",NullValueHandling = NullValueHandling.Ignore)] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number",NullValueHandling = NullValueHandling.Ignore)] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email",NullValueHandling = NullValueHandling.Ignore)] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language",NullValueHandling = NullValueHandling.Ignore)] - public string? Language { get; set; } - - public CustomersUpdateTrackingByIdRequest() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestCustomers.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestCustomers.cs new file mode 100644 index 0000000..9c190aa --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestCustomers.cs @@ -0,0 +1,45 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + /// + /// + /// + public class UpdateTrackingByIdRequestCustomers + { + /// + /// Role The role of the customer, indicating whether the customer is an individual or a company. + /// + [JsonProperty("role")] + public string Role { get; set; } + /// + /// Name Customer name associated with the tracking. + /// + [JsonProperty("name")] + public string Name { get; set; } + /// + /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; set; } + /// + /// Email Email address(es) to receive email notifications. + /// + [JsonProperty("email")] + public string Email { get; set; } + /// + /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. + /// + [JsonProperty("language")] + public string Language { get; set; } + public UpdateTrackingByIdRequestCustomers() + { + } + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestDeliveryType.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestDeliveryType.cs new file mode 100644 index 0000000..a28b8cd --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdRequestDeliveryType.cs @@ -0,0 +1,24 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace AfterShipTracking +{ + /// + /// Shipment delivery type- `pickup_at_store`- `pickup_at_courier`- `door_to_door` + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum UpdateTrackingByIdRequestDeliveryType + { + [EnumMember(Value = "pickup_at_store")] + PickupAtStore, + [EnumMember(Value = "pickup_at_courier")] + PickupAtCourier, + [EnumMember(Value = "door_to_door")] + DoorToDoor, + } +} diff --git a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs index 3655d8d..1ad6333 100644 --- a/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs +++ b/src/AfterShipTracking/AfterShipTracking/Models/UpdateTrackingByIdResponse.cs @@ -4,703 +4,16 @@ */ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using Headers = System.Net.Http.Headers.HttpResponseHeaders; namespace AfterShipTracking { - /// - /// Object describes the tracking information.
- ///
public class UpdateTrackingByIdResponse { - /// - /// Id A system-generated tracking ID by default, which can be customized by the user when creating a tracking. - /// - [JsonProperty("id")] - public string? Id { get; set; } - /// - /// LegacyId The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. - /// - [JsonProperty("legacy_id")] - public string? LegacyId { get; set; } - /// - /// CreatedAt The date and time the shipment was imported or added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("created_at")] - public string? CreatedAt { get; set; } - /// - /// UpdatedAt The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. - /// - [JsonProperty("updated_at")] - public string? UpdatedAt { get; set; } - /// - /// TrackingNumber Tracking number. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as `unrecognized`. Get courier codes . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// Active Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - /// - /// CustomFields Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. - /// - [JsonProperty("custom_fields")] - public Dictionary? CustomFields { get; set; } - /// - /// TransitTime Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date. - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// OriginCountryRegion The for the origin country/region. E.g. USA for the United States. - /// - [JsonProperty("origin_country_region")] - public string? OriginCountryRegion { get; set; } - /// - /// OriginState The state of the sender’s address. - /// - [JsonProperty("origin_state")] - public string? OriginState { get; set; } - /// - /// OriginCity The city of the sender’s address. - /// - [JsonProperty("origin_city")] - public string? OriginCity { get; set; } - /// - /// OriginPostalCode The postal code of the sender’s address. - /// - [JsonProperty("origin_postal_code")] - public string? OriginPostalCode { get; set; } - /// - /// OriginRawLocation The sender address that the shipment is shipping from. - /// - [JsonProperty("origin_raw_location")] - public string? OriginRawLocation { get; set; } - /// - /// DestinationCountryRegion The for the destination country/region. E.g. USA for the United States. - /// - [JsonProperty("destination_country_region")] - public string? DestinationCountryRegion { get; set; } - /// - /// DestinationState The state of the recipient’s address. - /// - [JsonProperty("destination_state")] - public string? DestinationState { get; set; } - /// - /// DestinationCity The city of the recipient’s address. - /// - [JsonProperty("destination_city")] - public string? DestinationCity { get; set; } - /// - /// DestinationPostalCode The postal code of the recipient’s address. - /// - [JsonProperty("destination_postal_code")] - public string? DestinationPostalCode { get; set; } - /// - /// DestinationRawLocation The shipping address that the shipment is shipping to. - /// - [JsonProperty("destination_raw_location")] - public string? DestinationRawLocation { get; set; } - /// - /// CourierDestinationCountryRegion Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country. - /// - [JsonProperty("courier_destination_country_region")] - public string? CourierDestinationCountryRegion { get; set; } - /// - /// CourierEstimatedDeliveryDate The field contains the estimated delivery date provided by the carrier. - /// - [JsonProperty("courier_estimated_delivery_date")] - public CourierEstimatedDeliveryDateUpdateTrackingByIdResponse? CourierEstimatedDeliveryDate { get; set; } - /// - /// Note Text field for the note. - /// - [JsonProperty("note")] - public string? Note { get; set; } - /// - /// OrderId A globally-unique identifier for the order. - /// - [JsonProperty("order_id")] - public string? OrderId { get; set; } - /// - /// OrderIdPath The URL for the order in your system or store. - /// - [JsonProperty("order_id_path")] - public string? OrderIdPath { get; set; } - /// - /// OrderDate The date and time the order was created in your system or store. It uses the format: `YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. - /// - [JsonProperty("order_date")] - public string? OrderDate { get; set; } - /// - /// ShipmentPackageCount Number of packages under the tracking. - /// - [JsonProperty("shipment_package_count")] - public double? ShipmentPackageCount { get; set; } - /// - /// ShipmentPickupDate The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_pickup_date")] - public string? ShipmentPickupDate { get; set; } - /// - /// ShipmentDeliveryDate The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("shipment_delivery_date")] - public string? ShipmentDeliveryDate { get; set; } - /// - /// ShipmentType The carrier service type for the shipment. - /// - [JsonProperty("shipment_type")] - public string? ShipmentType { get; set; } - /// - /// ShipmentWeight The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making - /// - [JsonProperty("shipment_weight")] - public ShipmentWeightUpdateTrackingByIdResponse? ShipmentWeight { get; set; } - /// - /// SignedBy Signed by information for delivered shipment. - /// - [JsonProperty("signed_by")] - public string? SignedBy { get; set; } - /// - /// Source Source of how this tracking is added. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Tag Current status of tracking. ( - /// - [JsonProperty("tag")] - public Tag? Tag { get; set; } - /// - /// Subtag Current subtag of tracking. ( - /// - [JsonProperty("subtag")] - public string? Subtag { get; set; } - /// - /// SubtagMessage Normalized tracking message. ( - /// - [JsonProperty("subtag_message")] - public string? SubtagMessage { get; set; } - /// - /// Title By default this field shows the `tracking_number`, but you can customize it as you wish with any info (e.g. the order number). - /// - [JsonProperty("title")] - public string? Title { get; set; } - /// - /// TrackedCount Number of attempts AfterShip tracks at courier's system. - /// - [JsonProperty("tracked_count")] - public double? TrackedCount { get; set; } - /// - /// LastMileTrackingSupported Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null - /// - [JsonProperty("last_mile_tracking_supported")] - public bool? LastMileTrackingSupported { get; set; } - /// - /// Language The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - /// - /// UniqueToken Deprecated - /// - [JsonProperty("unique_token")] - public string? UniqueToken { get; set; } - /// - /// Checkpoints Array of checkpoint object describes the checkpoint information. - /// - [JsonProperty("checkpoints")] - public Checkpoint? [] Checkpoints { get; set; } - /// - /// SubscribedSmses Phone number(s) subscribed to receive sms notifications. - /// - [JsonProperty("subscribed_smses")] - public string? [] SubscribedSmses { get; set; } - /// - /// SubscribedEmails Email address(es) subscribed to receive email notifications. - /// - [JsonProperty("subscribed_emails")] - public string? [] SubscribedEmails { get; set; } - /// - /// ReturnToSender Whether or not the shipment is returned to sender. Value is `true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. - /// - [JsonProperty("return_to_sender")] - public bool? ReturnToSender { get; set; } - /// - /// OrderPromisedDeliveryDate The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("order_promised_delivery_date")] - public string? OrderPromisedDeliveryDate { get; set; } - /// - /// DeliveryType Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door - /// - [JsonProperty("delivery_type")] - public string? DeliveryType { get; set; } - /// - /// PickupLocation Shipment pickup location for receiver - /// - [JsonProperty("pickup_location")] - public string? PickupLocation { get; set; } - /// - /// PickupNote Shipment pickup note for receiver - /// - [JsonProperty("pickup_note")] - public string? PickupNote { get; set; } - /// - /// CourierTrackingLink Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// FirstAttemptedAt The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("first_attempted_at")] - public string? FirstAttemptedAt { get; set; } - /// - /// CourierRedirectLink Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to "US" by default. - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// TrackingAccountNumber Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details. - /// - [JsonProperty("tracking_account_number")] - public string? TrackingAccountNumber { get; set; } - /// - /// TrackingKey Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details. - /// - [JsonProperty("tracking_key")] - public string? TrackingKey { get; set; } - /// - /// TrackingShipDate The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. - /// - [JsonProperty("tracking_ship_date")] - public string? TrackingShipDate { get; set; } - /// - /// OnTimeStatus Whether the tracking is delivered on time or not. - /// - [JsonProperty("on_time_status")] - public string? OnTimeStatus { get; set; } - /// - /// OnTimeDifference The difference days of the on time. - /// - [JsonProperty("on_time_difference")] - public double? OnTimeDifference { get; set; } - /// - /// OrderTags The tags of the order. - /// - [JsonProperty("order_tags")] - public string? [] OrderTags { get; set; } - /// - /// AftershipEstimatedDeliveryDate The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("aftership_estimated_delivery_date")] - public AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse? AftershipEstimatedDeliveryDate { get; set; } - /// - /// CustomEstimatedDeliveryDate Estimated delivery time of the shipment based on your . It uses the format `YYYY-MM-DD` based on the shipment recipient’s timezone. - /// - [JsonProperty("custom_estimated_delivery_date")] - public CustomEstimatedDeliveryDateUpdateTrackingByIdResponse? CustomEstimatedDeliveryDate { get; set; } - /// - /// OrderNumber A unique, human-readable identifier for the order. - /// - [JsonProperty("order_number")] - public string? OrderNumber { get; set; } - /// - /// FirstEstimatedDelivery The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("first_estimated_delivery")] - public FirstEstimatedDeliveryUpdateTrackingByIdResponse? FirstEstimatedDelivery { get; set; } - /// - /// LatestEstimatedDelivery The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format `YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. - /// - [JsonProperty("latest_estimated_delivery")] - public LatestEstimatedDeliveryUpdateTrackingByIdResponse? LatestEstimatedDelivery { get; set; } - /// - /// ShipmentTags Used to add tags to your shipments to help categorize and filter them easily. - /// - [JsonProperty("shipment_tags")] - public string? [] ShipmentTags { get; set; } - /// - /// CourierConnectionId If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(
In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. - ///
- [JsonProperty("courier_connection_id")] - public string? CourierConnectionId { get; set; } - /// - /// CarbonEmissions The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. - /// - [JsonProperty("carbon_emissions")] - public CarbonEmissionsUpdateTrackingByIdResponse? CarbonEmissions { get; set; } - /// - /// LocationId The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking's origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . - /// - [JsonProperty("location_id")] - public string? LocationId { get; set; } - /// - /// ShippingMethod The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. - /// - [JsonProperty("shipping_method")] - public string? ShippingMethod { get; set; } - /// - /// FailedDeliveryAttempts By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers' delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. - /// - [JsonProperty("failed_delivery_attempts")] - public int? FailedDeliveryAttempts { get; set; } - /// - /// SignatureRequirement The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient's signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.
- ///
- [JsonProperty("signature_requirement")] - public string? SignatureRequirement { get; set; } - /// - /// DeliveryLocationType The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. - /// - [JsonProperty("delivery_location_type")] - public string? DeliveryLocationType { get; set; } - /// - /// AftershipTrackingUrl The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_url")] - public string? AftershipTrackingUrl { get; set; } - /// - /// AftershipTrackingOrderUrl The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. - /// - [JsonProperty("aftership_tracking_order_url")] - public string? AftershipTrackingOrderUrl { get; set; } - /// - /// FirstMile The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object. - /// - [JsonProperty("first_mile")] - public FirstMileUpdateTrackingByIdResponse? FirstMile { get; set; } - /// - /// LastMile This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. - /// - [JsonProperty("last_mile")] - public LastMileUpdateTrackingByIdResponse? LastMile { get; set; } - /// - /// Customers The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. - /// - [JsonProperty("customers")] - public CustomersUpdateTrackingByIdResponse? [] Customers { get; set; } + public Headers ResponseHeader { get; set; } + public Tracking Data { get; set; } public UpdateTrackingByIdResponse() { } } - - /// - /// - /// - public class CourierEstimatedDeliveryDateUpdateTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// EstimatedDeliveryDateMin The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public CourierEstimatedDeliveryDateUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class ShipmentWeightUpdateTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of shipment weight. - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public ShipmentWeightUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse - { - /// - /// EstimatedDeliveryDate The estimated arrival date of the shipment. - /// - [JsonProperty("estimated_delivery_date")] - public string? EstimatedDeliveryDate { get; set; } - /// - /// ConfidenceCode Indicates the confidence level and associated reason for an AI EDD prediction request. For a comprehensive list of confidence codes, refer to . - /// - [JsonProperty("confidence_code")] - public double? ConfidenceCode { get; set; } - /// - /// EstimatedDeliveryDateMin Earliest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_min")] - public string? EstimatedDeliveryDateMin { get; set; } - /// - /// EstimatedDeliveryDateMax Latest estimated delivery date of the shipment. - /// - [JsonProperty("estimated_delivery_date_max")] - public string? EstimatedDeliveryDateMax { get; set; } - - public AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomEstimatedDeliveryDateUpdateTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Datetime The specific EDD date. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public CustomEstimatedDeliveryDateUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstEstimatedDeliveryUpdateTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - - public FirstEstimatedDeliveryUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LatestEstimatedDeliveryUpdateTrackingByIdResponse - { - /// - /// Type The format of the EDD. Either a single date or a date range. - /// - [JsonProperty("type")] - public string? Type { get; set; } - /// - /// Source The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings. - /// - [JsonProperty("source")] - public string? Source { get; set; } - /// - /// Datetime The latest EDD time. - /// - [JsonProperty("datetime")] - public string? Datetime { get; set; } - /// - /// DatetimeMin For a date range EDD format, the date and time for the lower end of the range. - /// - [JsonProperty("datetime_min")] - public string? DatetimeMin { get; set; } - /// - /// DatetimeMax For a date range EDD format, the date and time for the upper end of the range. - /// - [JsonProperty("datetime_max")] - public string? DatetimeMax { get; set; } - /// - /// ReviseReason Explains the reason for a change to the latest_estimated_delivery. This string will only have a value if:1. The source for the latest EDD is AfterShip EDD. 2. The reason for the change is known.For a comprehensive list of reasons, please refer to . - /// - [JsonProperty("revise_reason")] - public string? ReviseReason { get; set; } - - public LatestEstimatedDeliveryUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CarbonEmissionsUpdateTrackingByIdResponse - { - /// - /// Unit The unit in which the value field is expressed. Allowed values: kg - /// - [JsonProperty("unit")] - public string? Unit { get; set; } - /// - /// Value The total amount of carbon emissions - /// - [JsonProperty("value")] - public double? Value { get; set; } - - public CarbonEmissionsUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class FirstMileUpdateTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the first-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the first-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the first-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the first-mile transit time.- First mile transit time (in days) = Handover date - Pickup date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the first-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the first-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - - public FirstMileUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class LastMileUpdateTrackingByIdResponse - { - /// - /// TrackingNumber The tracking number of the last-mile carrier. - /// - [JsonProperty("tracking_number")] - public string? TrackingNumber { get; set; } - /// - /// Slug The unique code of the carrier responsible for the last-mile of the shipment. Find all the courier slugs . - /// - [JsonProperty("slug")] - public string? Slug { get; set; } - /// - /// TransitTime The transit time for the last-mile of a shipment in days. This field is calculated based on whether the handed_over_to_last_mile_carrier or the received_by_last_mile_carrier event is detected by AfterShip. The handover event date is used to calculate the last-mile transit time.- Last mile transit time (in days)= Delivered date - Handover date - /// - [JsonProperty("transit_time")] - public int? TransitTime { get; set; } - /// - /// CourierTrackingLink The field contains the official tracking URL of the last-mile carrier, if available. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_tracking_link")] - public string? CourierTrackingLink { get; set; } - /// - /// CourierRedirectLink The field provides the link for modifying delivery instructions (such as delivery date and shipping address), if supported by the last-mile carrier. The language parameter of this link is determined by the destination country/region and the language associated with the shipment. If the destination country/region and language data is unavailable, AfterShip will default the language parameter to "US". - /// - [JsonProperty("courier_redirect_link")] - public string? CourierRedirectLink { get; set; } - /// - /// Source The field indicates the source of last-mile carrier. - /// - [JsonProperty("source")] - public string? Source { get; set; } - - public LastMileUpdateTrackingByIdResponse() - { - } - } - /// - /// - /// - public class CustomersUpdateTrackingByIdResponse - { - /// - /// Role The role of the customer, indicating whether the customer is an individual or a company. - /// - [JsonProperty("role")] - public string? Role { get; set; } - /// - /// Name Customer name associated with the tracking. - /// - [JsonProperty("name")] - public string? Name { get; set; } - /// - /// PhoneNumber The phone number(s) to receive SMS notifications. Phone numbers should begin with a `+` sign and include the area code. - /// - [JsonProperty("phone_number")] - public string? PhoneNumber { get; set; } - /// - /// Email Email address(es) to receive email notifications. - /// - [JsonProperty("email")] - public string? Email { get; set; } - /// - /// Language The preferred language of the customer. If you have set up AfterShip notifications in different languages, we use this to send the tracking updates to the customer in their preferred language. - /// - [JsonProperty("language")] - public string? Language { get; set; } - - public CustomersUpdateTrackingByIdResponse() - { - } - } } diff --git a/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs b/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs index bc2f1a1..9e381c3 100644 --- a/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs +++ b/src/AfterShipTracking/AfterShipTracking/Properties/AssemblyInfo.cs @@ -12,5 +12,5 @@ internal class AssemblyInformation { - public const string AssemblyInformationalVersion = "13.0.0"; + public const string AssemblyInformationalVersion = "14.0.0"; } diff --git a/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs b/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs index 1ac02b3..bce41db 100644 --- a/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs +++ b/src/AfterShipTracking/AfterShipTracking/Public/AfterShipConfiguration.cs @@ -12,10 +12,10 @@ public static class AfterShipConfiguration public const string AUTHENTICATION_TYPE_AES = "AES"; public const string AUTHENTICATION_TYPE_RSA = "RSA"; - public const string SDK_PREFIX = "AFTERSHIP_TRACKING_SDK"; + public const string SDK_PREFIX = "AFTERSHIP_TRACKING_SDK_"; public const int DEFAULT_MAX_RETRY = 2; - public const int DEFAULT_TIMEOUT = 10000; - public const string DEFAULT_USER_AGENT = "tracking-sdk-net/13.0.0 (https://www.aftership.com) System.Net.Http.HttpClient/0.0.0"; + public const int DEFAULT_TIMEOUT = 30000; + public const string DEFAULT_USER_AGENT = "tracking-sdk-net/14.0.0 (https://www.aftership.com) System.Net.Http.HttpClient/0.0.0"; public const string DEFAULT_DOMAIN = "https://api.aftership.com"; private static string domain; @@ -38,7 +38,7 @@ public static string Domain { return domain; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_DOMAIN") ?? DEFAULT_DOMAIN; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"DOMAIN") ?? DEFAULT_DOMAIN; } set @@ -59,7 +59,7 @@ public static int MaxRetry { return maxRetry; } - if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "_MAX_RETRY"), out int n) && n > 0) + if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "MAX_RETRY"), out int n) && n > 0) { return n; } @@ -82,7 +82,7 @@ public static int Timeout { return timeout; } - if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "_TIMEOUT"), out int n) && n > 0) + if (int.TryParse(Environment.GetEnvironmentVariable(SDK_PREFIX + "TIMEOUT"), out int n) && n > 0) { return n; } @@ -106,7 +106,7 @@ public static string UserAgent { return userAgent; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_USER_AGENT") ?? null; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"USER_AGENT") ?? null; } set @@ -127,7 +127,7 @@ public static string Proxy { return proxy; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_PROXY") ?? ""; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"PROXY") ?? ""; } set @@ -147,7 +147,7 @@ public static string ApiKey { return apiKey; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_API_KEY") ?? ""; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"API_KEY") ?? ""; } set @@ -167,7 +167,7 @@ public static string ApiSecret { return apiSecret; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_API_SECRET") ?? ""; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"API_SECRET") ?? ""; } set @@ -187,7 +187,7 @@ public static string AuthenticationType { return authenticationType; } - return Environment.GetEnvironmentVariable(SDK_PREFIX+"_AUTHENTICATION_TYPE") ?? AUTHENTICATION_TYPE_API_KEY; + return Environment.GetEnvironmentVariable(SDK_PREFIX+"AUTHENTICATION_TYPE") ?? AUTHENTICATION_TYPE_API_KEY; } set diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs b/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs index d0752a9..7002cd8 100644 --- a/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs +++ b/src/AfterShipTracking/AfterShipTracking/Public/Authenticator.cs @@ -61,9 +61,9 @@ public void Sign(HttpRequestMessage request) { rs = CanonicalResource(request); } - catch (Exception e) + catch (Exception) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_REQUEST, e.Message); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "Invalid request"); } byte[] bodyBytes; @@ -89,9 +89,9 @@ public void Sign(HttpRequestMessage request) { rsaSign = Encryption.RsaPssSha256Encrypt(s, this.ApiSecret); } - catch (Exception e) + catch (Exception) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, e.Message); + throw ErrorCode.GenSDKError(ErrorCode.INVALID_API_KEY, "Invalid API key"); } tmpHeaders.TryAddWithoutValidation("as-signature-rsa-sha256", rsaSign); diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs index 4c10b06..c42130a 100644 --- a/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs +++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/BaseResourceService.cs @@ -13,7 +13,8 @@ public class BaseResourceService private static JsonSerializerSettings settings = new JsonSerializerSettings { DateParseHandling = DateParseHandling.None, - DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind + DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind, + NullValueHandling = NullValueHandling.Ignore }; public static T ProcessResponse(Response response) @@ -30,7 +31,7 @@ public static T ProcessResponse(Response response) } catch (Newtonsoft.Json.JsonException) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } return obj; @@ -51,7 +52,7 @@ public static T ProcessData(Response response) } catch (Newtonsoft.Json.JsonException) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } return obj; @@ -72,7 +73,7 @@ public static T ProcessResponseData(Response response, IAdapter adap } catch (Newtonsoft.Json.JsonException) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } return obj; @@ -87,13 +88,13 @@ private static AfterShipError BuildAfterShipException(Response response) } catch (Newtonsoft.Json.JsonException) { - return ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } var meta = jObject["meta"]; if (meta == null) { - return ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, "Invalid response content:" + response.Content); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } int.TryParse(meta["code"]?.ToString(), out int code); @@ -107,9 +108,9 @@ public static string ToJson(object model) { return JsonConvert.SerializeObject(model, settings); } - catch (JsonException e) + catch (JsonException) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, e.Message); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } } @@ -119,9 +120,9 @@ public static T FromJson(string value) { return JsonConvert.DeserializeObject(value,settings); } - catch (JsonException e) + catch (JsonException) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_JSON, e.Message); + throw ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } } } diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs new file mode 100644 index 0000000..6b20523 --- /dev/null +++ b/src/AfterShipTracking/AfterShipTracking/Public/Base/Meta.cs @@ -0,0 +1,26 @@ +/* + * This code was auto generated by AfterShip SDK Generator. + * Do not edit the class manually. + */ +using Newtonsoft.Json; + +namespace AfterShipTracking +{ + public class Meta + { + [JsonProperty("code")] + public int? Code { get; set; } + [JsonProperty("type")] + public string? Type { get; set; } + [JsonProperty("message")] + public string? Message { get; set; } + + public Meta(int code, string type, string message) + { + Code = code; + Type = type; + Message = message; + } + } +} + diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs deleted file mode 100644 index 0ccb033..0000000 --- a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationCursor.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This code was auto generated by AfterShip SDK Generator. - * Do not edit the class manually. - */ -using Newtonsoft.Json; - -namespace AfterShipTracking.Public._base -{ - public class PaginationCursor : IBasePage - { - /// - /// Total count - /// - [JsonProperty("total")] - public int Total; - - /// - /// Has next page - /// - [JsonProperty("previous_cursor")] - public string PreviousCursor { get; } - - /// - /// Next cursor - /// - [JsonProperty("next_cursor")] - public string NextCursor { get; } - } -} diff --git a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs b/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs deleted file mode 100644 index 41d53f6..0000000 --- a/src/AfterShipTracking/AfterShipTracking/Public/Base/PaginationPage.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This code was auto generated by AfterShip SDK Generator. - * Do not edit the class manually. - */ -using Newtonsoft.Json; - -namespace AfterShipTracking -{ - public class PaginationPage - { - /// - /// Page index - /// - [JsonProperty("cursor")] - public string? Cursor { get; set; } - - /// - /// Total count - /// - [JsonProperty("total")] - public int? Total { get; set; } - - - /// - /// Total count - /// - [JsonProperty("has_next_page")] - public bool? HasNextPage { get; set; } - - public PaginationPage(string? cursor, int? total, bool hasNextPage = false) - { - Cursor = cursor; - Total = total; - HasNextPage = hasNextPage; - } - } -} - diff --git a/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs b/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs index ef2ae24..5ba999d 100644 --- a/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs +++ b/src/AfterShipTracking/AfterShipTracking/Public/SystemNetHttpClient.cs @@ -51,7 +51,7 @@ public class SystemNetHttpClient : IHttpClient static SystemNetHttpClient() { - // Enable support for TLS 1.2, as Tracking's API requires it. This should only be + // Enable support for TLS 1.2, as AfterShip's API requires it. This should only be // necessary for .NET Framework 4.5 as more recent runtimes should have TLS 1.2 enabled // by default, but it can be disabled in some environments. ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | @@ -81,7 +81,7 @@ public SystemNetHttpClient( { if (string.IsNullOrEmpty(baseUrl)) { - throw ErrorCode.GenSDKError(ErrorCode.INVALID_REQUEST, "Base url empty"); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "Base url empty"); } this.baseUrl = baseUrl; @@ -206,7 +206,7 @@ await reader.ReadToEndAsync().ConfigureAwait(false)) requestException = null; if (retry > this.MaxNetworkRetries) { - requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT, ErrorCode.TIMED_OUT); + requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT, "Request timed out."); break; } var httpRequest = this.BuildRequestMessage(request); @@ -214,7 +214,7 @@ await reader.ReadToEndAsync().ConfigureAwait(false)) var stopwatch = Stopwatch.StartNew(); // if (this.IsRateOverflow()) // { - // throw ErrorCode.GenSDKError(ErrorCode.RATE_LIMIT_EXCEEDED, ErrorCode.RATE_LIMIT_EXCEEDED); + // throw ErrorCode.GenSDKError(ErrorCode.RATE_LIMIT_EXCEED, "You have exceeded the API call rate limit. The default limit is 10 requests per second."); // } try { @@ -223,11 +223,11 @@ await reader.ReadToEndAsync().ConfigureAwait(false)) } catch (HttpRequestException) { - requestException = ErrorCode.GenSDKError(ErrorCode.INTERNAL_ERROR, ErrorCode.INTERNAL_ERROR); ; + requestException = ErrorCode.GenSDKError(ErrorCode.UNKNOWN_ERROR, "Something went wrong on AfterShip's end."); } catch (OperationCanceledException) { - requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT,ErrorCode.TIMED_OUT); + requestException = ErrorCode.GenSDKError(ErrorCode.TIMED_OUT, "Request timed out."); } stopwatch.Stop(); diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs index cc40685..022f1c4 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierOption.cs @@ -16,14 +16,18 @@ public GetCouriersOptions() { } - public string Active { get; set; } - public string Slug { get; set; } + public bool? Active { get; set; } + public string? Slug { get; set; } override public List> GetQueryParams() { var p = new List>(); - p.Add(new KeyValuePair("active", Active)); - p.Add(new KeyValuePair("slug", Slug)); + if (Active != null) { + p.Add(new KeyValuePair("active", Active.ToString().ToLower())); + } + if (Slug != null) { + p.Add(new KeyValuePair("slug", Slug)); + } return p; } } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs index fc68c62..1dd12bc 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Courier/CourierService.cs @@ -26,7 +26,13 @@ public GetCouriersResponse GetCouriers( GetCouriersOptions? options = null) ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + GetCouriersResponseData responseData = ProcessData(response); + + GetCouriersResponse result = new GetCouriersResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } public DetectCourierResponse DetectCourier( DetectCourierOptions? options = null) { @@ -38,7 +44,13 @@ public DetectCourierResponse DetectCourier( DetectCourierOptions? options = null ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + DetectCourierResponseData responseData = ProcessData(response); + + DetectCourierResponse result = new DetectCourierResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } } } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionOption.cs index bc483b3..4009096 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionOption.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionOption.cs @@ -10,78 +10,84 @@ namespace AfterShipTracking /// /// Description /// - public class PutCourierConnectionsByIdOptions : BaseOptions + public class GetCourierConnectionsOptions : BaseOptions { - public PutCourierConnectionsByIdOptions() + public GetCourierConnectionsOptions() { } + public string? CourierSlug { get; set; } + public string? Cursor { get; set; } + public string? Limit { get; set; } - public PutCourierConnectionsByIdRequest PutCourierConnectionsByIdRequest { get; set; } - - override public string GetBody() + override public List> GetQueryParams() { - string body = null; - - if ( PutCourierConnectionsByIdRequest != null) - { - body = BaseResourceService.ToJson(PutCourierConnectionsByIdRequest); + var p = new List>(); + if (CourierSlug != null) { + p.Add(new KeyValuePair("courier_slug", CourierSlug)); } - return body; + if (Cursor != null) { + p.Add(new KeyValuePair("cursor", Cursor)); + } + if (Limit != null) { + p.Add(new KeyValuePair("limit", Limit)); + } + return p; } } /// /// Description /// - public class DeleteCourierConnectionsByIdOptions : BaseOptions + public class PostCourierConnectionsOptions : BaseOptions { - public DeleteCourierConnectionsByIdOptions() + public PostCourierConnectionsOptions() { } + public PostCourierConnectionsRequest PostCourierConnectionsRequest { get; set; } + + override public string GetBody() + { + string body = null; + + if ( PostCourierConnectionsRequest != null) + { + body = BaseResourceService.ToJson(PostCourierConnectionsRequest); + } + return body; + } } /// /// Description /// - public class GetCourierConnectionsOptions : BaseOptions + public class GetCourierConnectionsByIdOptions : BaseOptions { - public GetCourierConnectionsOptions() + public GetCourierConnectionsByIdOptions() { } - public string CourierSlug { get; set; } - public string Cursor { get; set; } - public string Limit { get; set; } - override public List> GetQueryParams() - { - var p = new List>(); - p.Add(new KeyValuePair("courier_slug", CourierSlug)); - p.Add(new KeyValuePair("cursor", Cursor)); - p.Add(new KeyValuePair("limit", Limit)); - return p; - } } /// /// Description /// - public class PostCourierConnectionsOptions : BaseOptions + public class PutCourierConnectionsByIdOptions : BaseOptions { - public PostCourierConnectionsOptions() + public PutCourierConnectionsByIdOptions() { } - public PostCourierConnectionsRequest PostCourierConnectionsRequest { get; set; } + public PutCourierConnectionsByIdRequest PutCourierConnectionsByIdRequest { get; set; } override public string GetBody() { string body = null; - if ( PostCourierConnectionsRequest != null) + if ( PutCourierConnectionsByIdRequest != null) { - body = BaseResourceService.ToJson(PostCourierConnectionsRequest); + body = BaseResourceService.ToJson(PutCourierConnectionsByIdRequest); } return body; } @@ -89,9 +95,9 @@ override public string GetBody() /// /// Description /// - public class GetCourierConnectionsByIdOptions : BaseOptions + public class DeleteCourierConnectionsByIdOptions : BaseOptions { - public GetCourierConnectionsByIdOptions() + public DeleteCourierConnectionsByIdOptions() { } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionService.cs index 5642ef1..189d117 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionService.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/CourierConnection/CourierConnectionService.cs @@ -16,41 +16,49 @@ public CourierConnectionService(IHttpClient httpClient) this.HttpClient = httpClient; } - public CourierConnection PutCourierConnectionsById(string id, PutCourierConnectionsByIdOptions? options = null) + public GetCourierConnectionsResponse GetCourierConnections( GetCourierConnectionsOptions? options = null) { - string path = $"/tracking/2025-07/courier-connections/{id}"; - if (string.IsNullOrEmpty(id)) - { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); - } + string path = $"/tracking/2025-07/courier-connections"; Request request = new Request( - HttpMethod.Patch, + HttpMethod.Get, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + GetCourierConnectionsResponseData responseData = ProcessData(response); + + GetCourierConnectionsResponse result = new GetCourierConnectionsResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public CourierConnection DeleteCourierConnectionsById(string id, DeleteCourierConnectionsByIdOptions? options = null) + public PostCourierConnectionsResponse PostCourierConnections( PostCourierConnectionsOptions? options = null) { - string path = $"/tracking/2025-07/courier-connections/{id}"; - if (string.IsNullOrEmpty(id)) - { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); - } + string path = $"/tracking/2025-07/courier-connections"; Request request = new Request( - HttpMethod.Delete, + HttpMethod.Post, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + CourierConnection responseData = ProcessData(response); + + PostCourierConnectionsResponse result = new PostCourierConnectionsResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public GetCourierConnectionsResponse GetCourierConnections( GetCourierConnectionsOptions? options = null) + public GetCourierConnectionsByIdResponse GetCourierConnectionsById(string id, GetCourierConnectionsByIdOptions? options = null) { - string path = $"/tracking/2025-07/courier-connections"; + string path = $"/tracking/2025-07/courier-connections/{id}"; + if (string.IsNullOrEmpty(id)) + { + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); + } Request request = new Request( HttpMethod.Get, path, @@ -58,35 +66,57 @@ public GetCourierConnectionsResponse GetCourierConnections( GetCourierConnection ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + CourierConnection responseData = ProcessData(response); + + GetCourierConnectionsByIdResponse result = new GetCourierConnectionsByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public CourierConnection PostCourierConnections( PostCourierConnectionsOptions? options = null) + public PutCourierConnectionsByIdResponse PutCourierConnectionsById(string id, PutCourierConnectionsByIdOptions? options = null) { - string path = $"/tracking/2025-07/courier-connections"; + string path = $"/tracking/2025-07/courier-connections/{id}"; + if (string.IsNullOrEmpty(id)) + { + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); + } Request request = new Request( - HttpMethod.Post, + HttpMethod.Patch, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + CourierConnection responseData = ProcessData(response); + + PutCourierConnectionsByIdResponse result = new PutCourierConnectionsByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public CourierConnection GetCourierConnectionsById(string id, GetCourierConnectionsByIdOptions? options = null) + public DeleteCourierConnectionsByIdResponse DeleteCourierConnectionsById(string id, DeleteCourierConnectionsByIdOptions? options = null) { string path = $"/tracking/2025-07/courier-connections/{id}"; if (string.IsNullOrEmpty(id)) { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); } Request request = new Request( - HttpMethod.Get, + HttpMethod.Delete, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + CourierConnection responseData = ProcessData(response); + + DeleteCourierConnectionsByIdResponse result = new DeleteCourierConnectionsByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } } } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs index ee962aa..49bc585 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateOption.cs @@ -17,7 +17,7 @@ public PredictOptions() } - public PredictRequest PredictRequest { get; set; } + public EstimatedDeliveryDateRequest PredictRequest { get; set; } override public string GetBody() { diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs index bcd06a7..636ae8e 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/EstimatedDeliveryDate/EstimatedDeliveryDateService.cs @@ -16,7 +16,7 @@ public EstimatedDeliveryDateService(IHttpClient httpClient) this.HttpClient = httpClient; } - public EstimatedDeliveryDateResponse Predict( PredictOptions? options = null) + public PredictResponse Predict( PredictOptions? options = null) { string path = $"/tracking/2025-07/estimated-delivery-date/predict"; Request request = new Request( @@ -26,7 +26,13 @@ public EstimatedDeliveryDateResponse Predict( PredictOptions? options = null) ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + EstimatedDeliveryDateResponse responseData = ProcessData(response); + + PredictResponse result = new PredictResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } public PredictBatchResponse PredictBatch( PredictBatchOptions? options = null) { @@ -38,7 +44,13 @@ public PredictBatchResponse PredictBatch( PredictBatchOptions? options = null) ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + PredictBatchResponseData responseData = ProcessData(response); + + PredictBatchResponse result = new PredictBatchResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } } } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs index 883124c..073ab3c 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingOption.cs @@ -10,33 +10,110 @@ namespace AfterShipTracking /// /// Description /// - public class RetrackTrackingByIdOptions : BaseOptions + public class GetTrackingsOptions : BaseOptions { - public RetrackTrackingByIdOptions() + public GetTrackingsOptions() { } + public string? Cursor { get; set; } + public int? Limit { get; set; } + public string? Keyword { get; set; } + public string? TrackingNumbers { get; set; } + public string? Slug { get; set; } + public int? TransitTime { get; set; } + public string? Origin { get; set; } + public string? Destination { get; set; } + public string? Tag { get; set; } + public string? CreatedAtMin { get; set; } + public string? CreatedAtMax { get; set; } + public string? UpdatedAtMin { get; set; } + public string? UpdatedAtMax { get; set; } + public string? Fields { get; set; } + public string? ReturnToSender { get; set; } + public string? CourierDestinationCountryRegion { get; set; } + public string? ShipmentTags { get; set; } + public string? OrderId { get; set; } + override public List> GetQueryParams() + { + var p = new List>(); + if (Cursor != null) { + p.Add(new KeyValuePair("cursor", Cursor)); + } + if (Limit != null) { + p.Add(new KeyValuePair("limit", Limit.ToString())); + } + if (Keyword != null) { + p.Add(new KeyValuePair("keyword", Keyword)); + } + if (TrackingNumbers != null) { + p.Add(new KeyValuePair("tracking_numbers", TrackingNumbers)); + } + if (Slug != null) { + p.Add(new KeyValuePair("slug", Slug)); + } + if (TransitTime != null) { + p.Add(new KeyValuePair("transit_time", TransitTime.ToString())); + } + if (Origin != null) { + p.Add(new KeyValuePair("origin", Origin)); + } + if (Destination != null) { + p.Add(new KeyValuePair("destination", Destination)); + } + if (Tag != null) { + p.Add(new KeyValuePair("tag", Tag)); + } + if (CreatedAtMin != null) { + p.Add(new KeyValuePair("created_at_min", CreatedAtMin)); + } + if (CreatedAtMax != null) { + p.Add(new KeyValuePair("created_at_max", CreatedAtMax)); + } + if (UpdatedAtMin != null) { + p.Add(new KeyValuePair("updated_at_min", UpdatedAtMin)); + } + if (UpdatedAtMax != null) { + p.Add(new KeyValuePair("updated_at_max", UpdatedAtMax)); + } + if (Fields != null) { + p.Add(new KeyValuePair("fields", Fields)); + } + if (ReturnToSender != null) { + p.Add(new KeyValuePair("return_to_sender", ReturnToSender)); + } + if (CourierDestinationCountryRegion != null) { + p.Add(new KeyValuePair("courier_destination_country_region", CourierDestinationCountryRegion)); + } + if (ShipmentTags != null) { + p.Add(new KeyValuePair("shipment_tags", ShipmentTags)); + } + if (OrderId != null) { + p.Add(new KeyValuePair("order_id", OrderId)); + } + return p; + } } /// /// Description /// - public class MarkTrackingCompletedByIdOptions : BaseOptions + public class CreateTrackingOptions : BaseOptions { - public MarkTrackingCompletedByIdOptions() + public CreateTrackingOptions() { } - public MarkTrackingCompletedByIdRequest MarkTrackingCompletedByIdRequest { get; set; } + public CreateTrackingRequest CreateTrackingRequest { get; set; } override public string GetBody() { string body = null; - if ( MarkTrackingCompletedByIdRequest != null) + if ( CreateTrackingRequest != null) { - body = BaseResourceService.ToJson(MarkTrackingCompletedByIdRequest); + body = BaseResourceService.ToJson(CreateTrackingRequest); } return body; } @@ -44,94 +121,46 @@ override public string GetBody() /// /// Description /// - public class GetTrackingsOptions : BaseOptions - { - public GetTrackingsOptions() - { - } - - public string Cursor { get; set; } - public string Limit { get; set; } - public string Keyword { get; set; } - public string TrackingNumbers { get; set; } - public string Slug { get; set; } - public string TransitTime { get; set; } - public string Origin { get; set; } - public string Destination { get; set; } - public string Tag { get; set; } - public string CreatedAtMin { get; set; } - public string CreatedAtMax { get; set; } - public string UpdatedAtMin { get; set; } - public string UpdatedAtMax { get; set; } - public string Fields { get; set; } - public string ReturnToSender { get; set; } - public string CourierDestinationCountryRegion { get; set; } - public string ShipmentTags { get; set; } - public string OrderId { get; set; } - - override public List> GetQueryParams() - { - var p = new List>(); - p.Add(new KeyValuePair("cursor", Cursor)); - p.Add(new KeyValuePair("limit", Limit)); - p.Add(new KeyValuePair("keyword", Keyword)); - p.Add(new KeyValuePair("tracking_numbers", TrackingNumbers)); - p.Add(new KeyValuePair("slug", Slug)); - p.Add(new KeyValuePair("transit_time", TransitTime)); - p.Add(new KeyValuePair("origin", Origin)); - p.Add(new KeyValuePair("destination", Destination)); - p.Add(new KeyValuePair("tag", Tag)); - p.Add(new KeyValuePair("created_at_min", CreatedAtMin)); - p.Add(new KeyValuePair("created_at_max", CreatedAtMax)); - p.Add(new KeyValuePair("updated_at_min", UpdatedAtMin)); - p.Add(new KeyValuePair("updated_at_max", UpdatedAtMax)); - p.Add(new KeyValuePair("fields", Fields)); - p.Add(new KeyValuePair("return_to_sender", ReturnToSender)); - p.Add(new KeyValuePair("courier_destination_country_region", CourierDestinationCountryRegion)); - p.Add(new KeyValuePair("shipment_tags", ShipmentTags)); - p.Add(new KeyValuePair("order_id", OrderId)); - return p; - } - } - /// - /// Description - /// public class GetTrackingByIdOptions : BaseOptions { public GetTrackingByIdOptions() { } - public string Fields { get; set; } - public string Lang { get; set; } + public string? Fields { get; set; } + public string? Lang { get; set; } override public List> GetQueryParams() { var p = new List>(); - p.Add(new KeyValuePair("fields", Fields)); - p.Add(new KeyValuePair("lang", Lang)); + if (Fields != null) { + p.Add(new KeyValuePair("fields", Fields)); + } + if (Lang != null) { + p.Add(new KeyValuePair("lang", Lang)); + } return p; } } /// /// Description /// - public class CreateTrackingOptions : BaseOptions + public class UpdateTrackingByIdOptions : BaseOptions { - public CreateTrackingOptions() + public UpdateTrackingByIdOptions() { } - public CreateTrackingRequest CreateTrackingRequest { get; set; } + public UpdateTrackingByIdRequest UpdateTrackingByIdRequest { get; set; } override public string GetBody() { string body = null; - if ( CreateTrackingRequest != null) + if ( UpdateTrackingByIdRequest != null) { - body = BaseResourceService.ToJson(CreateTrackingRequest); + body = BaseResourceService.ToJson(UpdateTrackingByIdRequest); } return body; } @@ -150,22 +179,33 @@ public DeleteTrackingByIdOptions() /// /// Description /// - public class UpdateTrackingByIdOptions : BaseOptions + public class RetrackTrackingByIdOptions : BaseOptions { - public UpdateTrackingByIdOptions() + public RetrackTrackingByIdOptions() { } - public UpdateTrackingByIdRequest UpdateTrackingByIdRequest { get; set; } + } + /// + /// Description + /// + public class MarkTrackingCompletedByIdOptions : BaseOptions + { + public MarkTrackingCompletedByIdOptions() + { + } + + + public MarkTrackingCompletedByIdRequest MarkTrackingCompletedByIdRequest { get; set; } override public string GetBody() { string body = null; - if ( UpdateTrackingByIdRequest != null) + if ( MarkTrackingCompletedByIdRequest != null) { - body = BaseResourceService.ToJson(UpdateTrackingByIdRequest); + body = BaseResourceService.ToJson(MarkTrackingCompletedByIdRequest); } return body; } diff --git a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs index 76a6de7..b0dd9c2 100644 --- a/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs +++ b/src/AfterShipTracking/AfterShipTracking/RestAPI/Tracking/TrackingService.cs @@ -16,29 +16,27 @@ public TrackingService(IHttpClient httpClient) this.HttpClient = httpClient; } - public Tracking RetrackTrackingById(string id, RetrackTrackingByIdOptions? options = null) + public GetTrackingsResponse GetTrackings( GetTrackingsOptions? options = null) { - string path = $"/tracking/2025-07/trackings/{id}/retrack"; - if (string.IsNullOrEmpty(id)) - { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); - } + string path = $"/tracking/2025-07/trackings"; Request request = new Request( - HttpMethod.Post, + HttpMethod.Get, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + GetTrackingsResponseData responseData = ProcessData(response); + + GetTrackingsResponse result = new GetTrackingsResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public Tracking MarkTrackingCompletedById(string id, MarkTrackingCompletedByIdOptions? options = null) + public CreateTrackingResponse CreateTracking( CreateTrackingOptions? options = null) { - string path = $"/tracking/2025-07/trackings/{id}/mark-as-completed"; - if (string.IsNullOrEmpty(id)) - { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); - } + string path = $"/tracking/2025-07/trackings"; Request request = new Request( HttpMethod.Post, path, @@ -46,11 +44,21 @@ public Tracking MarkTrackingCompletedById(string id, MarkTrackingCompletedByIdO ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + CreateTrackingResponse result = new CreateTrackingResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public GetTrackingsResponse GetTrackings( GetTrackingsOptions? options = null) + public GetTrackingByIdResponse GetTrackingById(string id, GetTrackingByIdOptions? options = null) { - string path = $"/tracking/2025-07/trackings"; + string path = $"/tracking/2025-07/trackings/{id}"; + if (string.IsNullOrEmpty(id)) + { + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); + } Request request = new Request( HttpMethod.Get, path, @@ -58,67 +66,101 @@ public GetTrackingsResponse GetTrackings( GetTrackingsOptions? options = null) ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + GetTrackingByIdResponse result = new GetTrackingByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public Tracking GetTrackingById(string id, GetTrackingByIdOptions? options = null) + public UpdateTrackingByIdResponse UpdateTrackingById(string id, UpdateTrackingByIdOptions? options = null) { string path = $"/tracking/2025-07/trackings/{id}"; if (string.IsNullOrEmpty(id)) { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); } Request request = new Request( - HttpMethod.Get, + HttpMethod.Put, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + UpdateTrackingByIdResponse result = new UpdateTrackingByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public Tracking CreateTracking( CreateTrackingOptions? options = null) + public DeleteTrackingByIdResponse DeleteTrackingById(string id, DeleteTrackingByIdOptions? options = null) { - string path = $"/tracking/2025-07/trackings"; + string path = $"/tracking/2025-07/trackings/{id}"; + if (string.IsNullOrEmpty(id)) + { + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); + } Request request = new Request( - HttpMethod.Post, + HttpMethod.Delete, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + DeleteTrackingByIdResponse result = new DeleteTrackingByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public Tracking DeleteTrackingById(string id, DeleteTrackingByIdOptions? options = null) + public RetrackTrackingByIdResponse RetrackTrackingById(string id, RetrackTrackingByIdOptions? options = null) { - string path = $"/tracking/2025-07/trackings/{id}"; + string path = $"/tracking/2025-07/trackings/{id}/retrack"; if (string.IsNullOrEmpty(id)) { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); } Request request = new Request( - HttpMethod.Delete, + HttpMethod.Post, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + RetrackTrackingByIdResponse result = new RetrackTrackingByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } - public Tracking UpdateTrackingById(string id, UpdateTrackingByIdOptions? options = null) + public MarkTrackingCompletedByIdResponse MarkTrackingCompletedById(string id, MarkTrackingCompletedByIdOptions? options = null) { - string path = $"/tracking/2025-07/trackings/{id}"; + string path = $"/tracking/2025-07/trackings/{id}/mark-as-completed"; if (string.IsNullOrEmpty(id)) { - throw ErrorCode.GenSDKError(ErrorCode.REQUEST_ERROR,"request error"+": `id` is invalid"); + throw ErrorCode.GenSDKError(ErrorCode.BAD_REQUEST, "request error"+": `id` is invalid"); } Request request = new Request( - HttpMethod.Put, + HttpMethod.Post, path, options ); var response = this.HttpClient.MakeRequest(request); - return ProcessData(response); + Tracking responseData = ProcessData(response); + + MarkTrackingCompletedByIdResponse result = new MarkTrackingCompletedByIdResponse(); + result.ResponseHeader = response.Headers; + result.Data = responseData; + + return result; } } }