easypost 6.3.0 → 6.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5c061be62ecbd985d48cc8d63c9ee9818cdb4f8da07140f308551f9f2404d8b
4
- data.tar.gz: 77edf8e77aadc515bb909267f2fbeb780eef7eaf677d4dd862f917a114af39b9
3
+ metadata.gz: 643a95f0b48e9abedc30e67d868ec3538d8d896b9c385734966805c83e72bd90
4
+ data.tar.gz: a532de25388ea110f152e77205bea2104228e83e7279dc66d0b500238d5b8416
5
5
  SHA512:
6
- metadata.gz: 6367c6955313221a4e063dfb477153f7c906b8db94fb398608b4c017eed750db036f96300bd8f1f2c804b33660803d2f02fd3ba07ce08647d6b0d3255f8ef12f
7
- data.tar.gz: 31f99fd5e0a377c5e56c155e6ab262c80d42db6d9850daeadaca96c54b561ded5a7d63c47404701a62f564b62e03aaa6c21125b7b895f0673567a77d020c76db
6
+ metadata.gz: 94b9cf67261d5c9bba01183812bef018d0b4918cc5f3593befdff2884095816299585bf33d86ee0de14015814c53ddd2911b9de85692c9c73421e1133cd57605
7
+ data.tar.gz: ba8c81ed037de3ccad7441eba06111eefb7430e69ac36169dd3409efa7965a092b18bc114d3767610dcb15453a6bfeed584073f35a986214b96f5eab4c6e2dcb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v6.4.0 (2024-07-24)
4
+
5
+ - Adds new `Claim` service for filing claims on EasyPost shipments and insurances
6
+
3
7
  ## v6.3.0 (2024-07-12)
4
8
 
5
9
  - Adds new `shipment.recommend_ship_date`, `smartrate.recommend_ship_date`, and `smartrate.estimate_delivery_date` functions
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.3.0
1
+ 6.4.0
@@ -42,6 +42,7 @@ class EasyPost::Client
42
42
  EasyPost::Services::CarrierAccount,
43
43
  EasyPost::Services::CarrierMetadata,
44
44
  EasyPost::Services::CarrierType,
45
+ EasyPost::Services::Claim,
45
46
  EasyPost::Services::CustomsInfo,
46
47
  EasyPost::Services::CustomsItem,
47
48
  EasyPost::Services::EndShipper,
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The Claim object has all the details for the filed claims
4
+ class EasyPost::Models::Claim < EasyPost::Models::EasyPostObject
5
+ end
@@ -10,6 +10,7 @@ require_relative 'models/batch'
10
10
  require_relative 'models/brand'
11
11
  require_relative 'models/carrier_account'
12
12
  require_relative 'models/carrier_type'
13
+ require_relative 'models/claim'
13
14
  require_relative 'models/customs_info'
14
15
  require_relative 'models/customs_item'
15
16
  require_relative 'models/end_shipper'
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EasyPost::Services::Claim < EasyPost::Services::Service
4
+ MODEL_CLASS = EasyPost::Models::Claim
5
+
6
+ # Create an Claim object
7
+ def create(params = {})
8
+ response = @client.make_request(:post, 'claims', params)
9
+
10
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
11
+ end
12
+
13
+ # Retrieve an Claim object
14
+ def retrieve(id)
15
+ response = @client.make_request(:get, "claims/#{id}", nil)
16
+
17
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
18
+ end
19
+
20
+ # Retrieve all Claim objects
21
+ def all(params = {})
22
+ filters = { key: 'claims' }
23
+
24
+ get_all_helper('claims', MODEL_CLASS, params, filters)
25
+ end
26
+
27
+ # Get the next page of claims.
28
+ def get_next_page(collection, page_size = nil)
29
+ raise EasyPost::Errors::EndOfPaginationError.new unless more_pages?(collection)
30
+
31
+ params = { before_id: collection.claims.last.id }
32
+ params[:page_size] = page_size unless page_size.nil?
33
+
34
+ all(params)
35
+ end
36
+
37
+ # Cancel a filed claim
38
+ def cancel(id)
39
+ response = @client.make_request(:post, "claims/#{id}/cancel", nil)
40
+
41
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
42
+ end
43
+ end
@@ -14,6 +14,7 @@ require_relative 'services/billing'
14
14
  require_relative 'services/carrier_account'
15
15
  require_relative 'services/carrier_metadata'
16
16
  require_relative 'services/carrier_type'
17
+ require_relative 'services/claim'
17
18
  require_relative 'services/customs_info'
18
19
  require_relative 'services/customs_item'
19
20
  require_relative 'services/end_shipper'
@@ -11,6 +11,7 @@ module EasyPost::InternalUtilities::StaticMapper
11
11
  'brd' => EasyPost::Models::Brand,
12
12
  'ca' => EasyPost::Models::CarrierAccount,
13
13
  'card' => EasyPost::Models::PaymentMethod,
14
+ 'clm' => EasyPost::Models::Claim,
14
15
  'cstinfo' => EasyPost::Models::CustomsInfo,
15
16
  'cstitem' => EasyPost::Models::CustomsItem,
16
17
  'es' => EasyPost::Models::EndShipper,
@@ -43,6 +44,7 @@ module EasyPost::InternalUtilities::StaticMapper
43
44
  'Batch' => EasyPost::Models::Batch,
44
45
  'Brand' => EasyPost::Models::Brand,
45
46
  'CarrierAccount' => EasyPost::Models::CarrierAccount,
47
+ 'Claim' => EasyPost::Models::Claim,
46
48
  'CreditCard' => EasyPost::Models::PaymentMethod,
47
49
  'CustomsInfo' => EasyPost::Models::CustomsInfo,
48
50
  'CustomsItem' => EasyPost::Models::CustomsItem,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.0
4
+ version: 6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - EasyPost Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-12 00:00:00.000000000 Z
11
+ date: 2024-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman
@@ -262,6 +262,7 @@ files:
262
262
  - lib/easypost/models/brand.rb
263
263
  - lib/easypost/models/carrier_account.rb
264
264
  - lib/easypost/models/carrier_type.rb
265
+ - lib/easypost/models/claim.rb
265
266
  - lib/easypost/models/customs_info.rb
266
267
  - lib/easypost/models/customs_item.rb
267
268
  - lib/easypost/models/end_shipper.rb
@@ -296,6 +297,7 @@ files:
296
297
  - lib/easypost/services/carrier_account.rb
297
298
  - lib/easypost/services/carrier_metadata.rb
298
299
  - lib/easypost/services/carrier_type.rb
300
+ - lib/easypost/services/claim.rb
299
301
  - lib/easypost/services/customs_info.rb
300
302
  - lib/easypost/services/customs_item.rb
301
303
  - lib/easypost/services/end_shipper.rb
@@ -339,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
341
  - !ruby/object:Gem::Version
340
342
  version: '0'
341
343
  requirements: []
342
- rubygems_version: 3.5.14
344
+ rubygems_version: 3.3.3
343
345
  signing_key:
344
346
  specification_version: 4
345
347
  summary: EasyPost Ruby Client Library