Releases: EasyPost/easypost-csharp
Releases · EasyPost/easypost-csharp
v4.0.0-rc1
Breaking Changes & New Features
- Library is now thread-safe
- Initialize a
Clientobject with an API key - Static methods (i.e.
create,retrieve, retrieveallof a resource) exist in services, accessed via property of the client (e.g.myClient.Address.Create()) - Instance methods (i.e.
update,delete) accessed on instance of a resource (i.e.myShipment.Update())
- Initialize a
- All properties are now title-cased rather than snake-cased to match standard .NET naming conventions
- e.g.
myShipment.idis nowmyShipment.Id,myAddress.federal_tax_idis nowmyAddress.FederalTaxId,myTrackerCollection.has_moreis nowmyTrackerCollection.HasMore - Some properties have been renamed to avoid naming conflicts:
Rate.rateis nowRate.PriceMessage.messageis nowMessage.Text
- e.g.
- All properties are now nullable
- Almost all properties will be assigned a value during JSON deserialization. This is mostly to address compiler warnings
- Users can proceed with the assumption that any given property will not be null
- Consistent exception handling
- All exceptions inherit from
EasyPostError - API-related and HTTP-related exceptions will throw an
ApiErroror inherited-type exception - API exception types can be retrieved by HTTP status code via the
EasyPost.Exceptions.Constantsclass (i.e. to anticipate what error will be thrown for a 404, etc.) - Common exception messages and templates can be found in the
EasyPost.Exceptions.Constantsclass (i.e. for log parsing)
- All exceptions inherit from
- Dependencies updated to latest versions, including
RestSharpv108
Misc
- Under the hood improvements:
- Underlying
Request-Client-ClientConfigurationrelationship has been re-architected to allow for thread safety - Process of generating an API request has been standardized and simplified
- Improved accessibility levels of internal functions, to prevent accidental use by end users
- Files have been organized into a more logical structure
- Methods and properties have been organized (e.g. methods ordered by CRUD, properties ordered alphabetically)
- Underlying
v3.6.1
- Adds missing
dropoff_max_datetimeandpickup_max_datetimeShipment options
v3.6.0
- Adds
end_shipper_idshipment option - Adds support to pass an EndShipper ID when buying a shipment
- Add Partner White Label support:
- Create a referral customer
- Update a referral customer's email address
- List all referral customers
- Add a credit card to a referral customer's account
v3.5.0
- Adds
ValidateWebhookfunction - Adds
duty_paymentshipment option - Moves
EndShipperout of beta to the general namespace
v3.4.0
- Adds Carbon Offset support
- Adds the ability to create a shipment with carbon offset
- Adds the ability to buy a shipment with carbon offset
- Adds the ability to one-call-buy a shipment with carbon offset
- Adds the ability to re-rate a shipment with carbon offset
- Removes the unusable
carrierparam from theverifyfunction on an Address
v3.3.0
- Adds ability to generate shipment forms via
GenerateFormfunction
v3.2.0
- Adds
DeletePaymentMethod,FundWallet, andRetrievePaymentMethodsfunctions - Adds
billing_typeattribute in CarrierAccount and Rate classes - Adds support for webhook secrets
- Collect OS details in User-Agent header
- Update functions now use
patchinstead ofputunder the hood to better match the API behavior and documentation. Behavior of these functions should remain the same
v2.8.3
- Backport improved User-Agent to collect OS details.
- Built for .NET Framework 3.5, .NET Core 2.0 and .NET 3.0. Users on .NET Framework 4.X should be able to use the .NET Framework 3.5 version.
v3.1.0
- Adds the
EndShipperclass with the ability to create, retrieve, and update EndShipper objects - Requests will now fail fast with an error if an API key is not provided instead of making a live API call with no key.
v3.0.0
Upgrading major versions of this project? Refer to the Upgrade Guide.
Breaking Changes
- Dropped explicit support for .NET Framework, replaced with .NET Standard 2.0
- Upgrades RestSharp from v106 to v107
- Project was built with C# 8.0
- Project is now entirely asynchronous which will require the addition of async/await on function calls
- Renames methods from
List()toAll()to make our library consistent (previously we had methods calling the/allendpoint with both names) - Removes the unusable
Ratingclass - Removes
shipment.GetRates()method since the shipment object already has rates. If you need to get new rates for a shipment, please use theshipment.RegenerateRates()method. - Must use
verifyandverify_strictparameters to verify addresses during creation, per our API docs;verificationandstrict_verificationwill no longer work - Clarify XList vs XCollection distinction:
ReportList,ScanFormList,ShipmentListandTrackerListrenamed toReportCollection,ScanFormCollection,ShipmentCollectionandTrackerCollectionto match the other names throughout the project
- Functions previously called
Destroyare now calledDeletefor consistency (eg: deleting a carrier account)
Features
- Adds explicit support for .NET 5.0 & 6.0
- Adds F# & Visual Basic compatibility
- Adds
RetrieveMe()which retrieves the authenticated user without the need to pass an ID - Adds missing
billing_refanddropoff_typeShipment options - Adds comprehensive test suite for .NET/.NET Core
- Adds
declarationattribute toCustomsInfoclass - Adds missing
idproperty to theBrandclass - Adds option to pass in a custom
HttpClientto the Client constructor (.NET/.NET Core only) - Adds
CreateAndBuyfunction to the Batch class
Bug Fixes
- Fixes bug where
AddressCollectionwas storingBatchobjects rather thanAddressobjects - Fixes Address creation respecting
verifyandverify_strictparameters - Fixes a bug where Pickup error messages were not deserializing properly
closes #151 , #152, #190, #245
Full Changelog: v2.8.1...v3.0.0