Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate v4 to master #349

Merged
merged 23 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b85d4a1
Thread-safe rearchitecture (#309)
nwithan8 Sep 7, 2022
ada5bee
- Change style guide to compress dictionary/list initializers (#322)
nwithan8 Sep 8, 2022
ea2dd5a
Fix naming scheme, property nullabilities (#321)
nwithan8 Sep 13, 2022
16292e7
chore: ports end_shipper_id option to v4
Justintime50 Sep 14, 2022
372b629
Merge pull request #325 from EasyPost/end_shipper_id_option_v4
Justintime50 Sep 14, 2022
b94292b
Use fixture submodule for unit tests (#310)
nwithan8 Sep 15, 2022
b90d50b
Improvements to error handling (#323)
nwithan8 Sep 16, 2022
6e3a086
Update README for rewrite (#328)
nwithan8 Sep 17, 2022
6153026
Port missing features (#327)
nwithan8 Sep 19, 2022
1e90265
- Add support for Partner/White Label (#330)
nwithan8 Sep 20, 2022
80cff45
Use dotnet-format rather than broken dotnet format (#339)
nwithan8 Sep 23, 2022
b0e4377
v4 Upgrade Guide (#337)
nwithan8 Sep 23, 2022
cda8d1c
Add LaserShipV2 datetime parameters (#336)
nwithan8 Sep 23, 2022
5a26505
- Make constructors for all models internal to prevent end-users from…
nwithan8 Sep 26, 2022
9e70e1c
Improve setup scripts, documentation (#333)
nwithan8 Sep 26, 2022
8f46005
chore: prepares v4.0.0-rc1 for release
Justintime50 Sep 26, 2022
344143a
Merge pull request #342 from EasyPost/v4.0.0-rc1
Justintime50 Sep 26, 2022
165db98
fix: AssemblyVersion must be numerical only
Justintime50 Sep 26, 2022
bd6571b
Merge pull request #343 from EasyPost/fix_assembly_version
Justintime50 Sep 26, 2022
d8a3d42
Change EasyPost logo for NuGet (#344)
nwithan8 Sep 26, 2022
095af59
- Fix nullability warning for CreateStripeToken function in .NET 5.0 …
nwithan8 Sep 29, 2022
1a60b66
- Call out namespace changes in CHANGELOG.md and UPGRADE_GUIDE.md (#346)
nwithan8 Sep 30, 2022
5cdcde2
Merge branch 'master' into v4
Justintime50 Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 9 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ dotnet_naming_rule.camel_case_for_private_internal_fields_rule.severity = sugges
dotnet_naming_rule.camel_case_for_private_internal_fields_rule.style = lower_camel_case_style_1
dotnet_naming_rule.camel_case_for_private_internal_fields_rule.symbols = camel_case_for_private_internal_fields_symbols
dotnet_naming_rule.constants_rule.import_to_resharper = as_predefined
dotnet_naming_rule.constants_rule.severity = suggestion
dotnet_naming_rule.constants_rule.severity = warning
dotnet_naming_rule.constants_rule.style = upper_camel_case_style
dotnet_naming_rule.constants_rule.symbols = constants_symbols
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.import_to_resharper = True
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.resharper_description = constant_fields_should_be_pascal_case
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.resharper_guid = 5fc5b41a-b7a6-477d-9e78-cd35bb64828d
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.severity = warning
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.style = upper_camel_case_style
dotnet_naming_rule.constant_fields_should_be_pascal_case_rule.symbols = constant_fields_should_be_pascal_case_symbols
dotnet_naming_rule.method_rule.import_to_resharper = as_predefined
Expand Down Expand Up @@ -96,27 +96,27 @@ dotnet_naming_rule.public_fields_instance_override_rule_1.severity = suggestion
dotnet_naming_rule.public_fields_instance_override_rule_1.style = lower_camel_case_style_1
dotnet_naming_rule.public_fields_instance_override_rule_1.symbols = public_fields_instance_override_symbols_1
dotnet_naming_rule.public_fields_instance_override_rule_2.import_to_resharper = False
dotnet_naming_rule.public_fields_instance_override_rule_2.severity = suggestion
dotnet_naming_rule.public_fields_instance_override_rule_2.severity = warning
dotnet_naming_rule.public_fields_instance_override_rule_2.style = upper_camel_case_style
dotnet_naming_rule.public_fields_instance_override_rule_2.symbols = public_fields_instance_override_symbols_2
dotnet_naming_rule.public_fields_instance_rule.import_to_resharper = True
dotnet_naming_rule.public_fields_instance_rule.resharper_description = PublicFieldsInstance
dotnet_naming_rule.public_fields_instance_rule.resharper_guid = 2a9a0bae-89b4-4df6-a105-19c5f8e2e0dd
dotnet_naming_rule.public_fields_instance_rule.severity = suggestion
dotnet_naming_rule.public_fields_instance_rule.severity = warning
dotnet_naming_rule.public_fields_instance_rule.style = upper_camel_case_style
dotnet_naming_rule.public_fields_instance_rule.symbols = public_fields_instance_symbols
dotnet_naming_rule.public_fields_instance_rule_1.import_to_resharper = True
dotnet_naming_rule.public_fields_instance_rule_1.resharper_description = PublicFieldsInstance
dotnet_naming_rule.public_fields_instance_rule_1.resharper_guid = 805de0e3-9674-4c38-a95c-271ec44bc5df
dotnet_naming_rule.public_fields_instance_rule_1.severity = suggestion
dotnet_naming_rule.public_fields_instance_rule_1.severity = warning
dotnet_naming_rule.public_fields_instance_rule_1.style = upper_camel_case_style
dotnet_naming_rule.public_fields_instance_rule_1.symbols = public_fields_instance_symbols_1
dotnet_naming_rule.public_fields_rule.import_to_resharper = as_predefined
dotnet_naming_rule.public_fields_rule.severity = suggestion
dotnet_naming_rule.public_fields_rule.severity = warning
dotnet_naming_rule.public_fields_rule.style = upper_camel_case_style
dotnet_naming_rule.public_fields_rule.symbols = public_fields_symbols
dotnet_naming_rule.public_fields_static_override_rule.import_to_resharper = False
dotnet_naming_rule.public_fields_static_override_rule.severity = suggestion
dotnet_naming_rule.public_fields_static_override_rule.severity = warning
dotnet_naming_rule.public_fields_static_override_rule.style = upper_camel_case_style
dotnet_naming_rule.public_fields_static_override_rule.symbols = public_fields_static_override_symbols
dotnet_naming_rule.public_fields_static_rule.import_to_resharper = True
Expand Down Expand Up @@ -313,7 +313,7 @@ resharper_method_or_operator_body = block_body
resharper_place_accessorholder_attribute_on_same_line = false
resharper_place_expr_accessor_on_single_line = true
resharper_place_expr_property_on_single_line = true
resharper_place_simple_initializer_on_single_line = false
resharper_place_simple_initializer_on_single_line = true
resharper_prefer_explicit_discard_declaration = true
resharper_resx_insert_final_newline = false
resharper_shaderlab_insert_final_newline = false
Expand Down Expand Up @@ -377,7 +377,7 @@ dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ matrix.lang }}-${{ hashFiles('**/packages.lock.json') }}
key: ${{ runner.os }}-nuget-${{ matrix.framework }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# Restore required NuGet packages
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples"]
path = examples
url = https://github.com/EasyPost/examples
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# CHANGELOG

## v4.0.0-rc1 (2022-09-26)

### Breaking Changes & New Features

- Library is now thread-safe
- Initialize a `Client` object with an API key
- Static methods (i.e. `create`, `retrieve`, retrieve `all` of 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()`)
- All properties are now title-cased rather than snake-cased to match standard .NET naming conventions
- e.g. `myShipment.id` is now `myShipment.Id`, `myAddress.federal_tax_id` is now `myAddress.FederalTaxId`, `myTrackerCollection.has_more` is now `myTrackerCollection.HasMore`
- Some properties have been renamed to avoid naming conflicts:
- `Rate.rate` is now `Rate.Price`
- `Message.message` is now `Message.Text`
- 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 `ApiError` or inherited-type exception
- API exception types can be retrieved by HTTP status code via the `EasyPost.Exceptions.Constants` class (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.Constants` class (i.e. for log parsing)
- Source code files have been organized
- Most EasyPost-related objects (i.e. `Shipment`, `Address`, `Tracker`, etc.) are now in the `EasyPost.Model.API` namespace
- Dependencies updated to latest versions, including `RestSharp` v108

### Misc

- Under the hood improvements:
- Underlying `Request`-`Client`-`ClientConfiguration` relationship 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)

## v3.6.1 (2022-09-22)

- Adds missing `dropoff_max_datetime` and `pickup_max_datetime` Shipment options
Expand Down
17 changes: 13 additions & 4 deletions EasyPost.Tests.FSharp/EasyPost.Tests.FSharp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0"/>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8"/>
<PackageReference Include="MSTest.TestFramework" Version="2.2.8"/>
<PackageReference Include="SecurityCodeScan.VS2019" Version="[5.0.0, 6.0.0)">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="[17.3.0, 18.0.0)"/>
<PackageReference Include="coverlet.collector" Version="[3.1.2, 4.0.0)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library" Version="[2.0.3, 3.0.0)"/>
<PackageReference Include="xunit" Version="[2.4.2, 3.0.0)"/>
<PackageReference Include="xunit.runner.visualstudio" Version="[2.4.5, 3.0.0)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SecurityCodeScan.VS2019" Version="[5.6.6, 6.0.0)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FSharp.Core" Version="[6.0.5, 7.0.0)"/>
</ItemGroup>

</Project>
9 changes: 4 additions & 5 deletions EasyPost.Tests.FSharp/FSharpCompileTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
namespace EasyPost.Tests.FSharp

open EasyPost
open Microsoft.VisualStudio.TestTools.UnitTesting
open Xunit

[<TestClass>]
type FSharpCompileTest() =
[<TestMethod>]
[<Fact>]
member this.TestCompile() =
let address = new Address()
let client = new Client("fake_api_key")
// The assert doesn't really do anything, but as long as this test can run, then the code is compiling correctly.
Assert.IsNotNull(address)
Assert.NotNull(client)
Loading