easypost 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d64abe11f1d5f8e57a32b4f421e36a5e09560bbf40ecd089d17dfe4d7ca666d
4
- data.tar.gz: bd74b6576f7be7b710c75d3995313145a00d363b87328a22cdc392ec79a1f117
3
+ metadata.gz: f953ec3c340b1b0db32a879914a9f9b6df21e5725def849674660a137cda3901
4
+ data.tar.gz: 22a71045b9b4fad02225c816661e71d40cb77a26fa0987d8e31e2b43072d6fea
5
5
  SHA512:
6
- metadata.gz: fa064855f8c823989c16826785dba35b9ea50e5a67fd807c5e6092647452b0b9a030e49164be9daad347a816aaeb1b621079fcf23290db11f7954ef0ecc79435
7
- data.tar.gz: 8093c8bb9daacf509f0e8ba7ccd3bcd41c0fe34241e677fcfdca0d1dafc3d1c292151beaeafb83236c1cfdfeec61829380dbceea0a270ea33524c81d1975058d
6
+ metadata.gz: 1c63d058c576a6548837a665d211c22be93502eec9c1780251d17d6f50162380e08e6cb6e28c3148397465975f43e2efa8960573dc11694f9fc682dc95bc629a
7
+ data.tar.gz: f621157312c8613ca0f11d59964ae4d97ee2c43467403c1b9130b3e4740dafe5566156210808e388bb2937773de8b313382e61ed7e675692233861661b1033bf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v7.1.0 (2025-06-18)
4
+
5
+ - Adds the following functions
6
+ - `shipment.create_and_buy_luma`
7
+ - `shipment.buy_luma`
8
+ - `luma.get_promise`
9
+
3
10
  ## v7.0.1 (2025-05-27)
4
11
 
5
12
  - Corrects the endpoint used for creating/updating UPS accounts
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.1
1
+ 7.1.0
@@ -48,6 +48,7 @@ class EasyPost::Client
48
48
  EasyPost::Services::EndShipper,
49
49
  EasyPost::Services::Event,
50
50
  EasyPost::Services::Insurance,
51
+ EasyPost::Services::Luma,
51
52
  EasyPost::Services::Order,
52
53
  EasyPost::Services::Parcel,
53
54
  EasyPost::Services::Pickup,
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EasyPost::Services::Luma < EasyPost::Services::Service
4
+ # Get service recommendations from Luma that meet the criteria of your ruleset.
5
+ def get_promise(params = {})
6
+ url = 'luma/promise'
7
+ wrapped_params = { shipment: params }
8
+ response = @client.make_request(:post, url, wrapped_params)
9
+
10
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response).luma_info
11
+ end
12
+ end
@@ -113,8 +113,8 @@ class EasyPost::Services::Shipment < EasyPost::Services::Service
113
113
  # Retrieves the estimated delivery date of each Rate via SmartRate.
114
114
  def retrieve_estimated_delivery_date(id, planned_ship_date)
115
115
  url = "shipments/#{id}/smartrate/delivery_date"
116
- params = { planned_ship_date: planned_ship_date }
117
- response = @client.make_request(:get, url, params)
116
+ wrapped_params = { planned_ship_date: planned_ship_date }
117
+ response = @client.make_request(:get, url, wrapped_params)
118
118
 
119
119
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS).rates
120
120
  end
@@ -122,9 +122,26 @@ class EasyPost::Services::Shipment < EasyPost::Services::Service
122
122
  # Retrieve a recommended ship date for an existing Shipment via the Precision Shipping API, based on a specific desired delivery date.
123
123
  def recommend_ship_date(id, desired_delivery_date)
124
124
  url = "shipments/#{id}/smartrate/precision_shipping"
125
- params = { desired_delivery_date: desired_delivery_date }
126
- response = @client.make_request(:get, url, params)
125
+ wrapped_params = { desired_delivery_date: desired_delivery_date }
126
+ response = @client.make_request(:get, url, wrapped_params)
127
127
 
128
128
  EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS).rates
129
129
  end
130
+
131
+ # Create and buy a Luma Shipment in one call.
132
+ def create_and_buy_luma(params = {})
133
+ url = 'shipments/luma'
134
+ wrapped_params = { shipment: params }
135
+ response = @client.make_request(:post, url, wrapped_params)
136
+
137
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
138
+ end
139
+
140
+ # Buy a Shipment with Luma.
141
+ def buy_luma(id, params = {})
142
+ url = "shipments/#{id}/luma"
143
+ response = @client.make_request(:post, url, params)
144
+
145
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
146
+ end
130
147
  end
@@ -20,6 +20,7 @@ require_relative 'services/customs_item'
20
20
  require_relative 'services/end_shipper'
21
21
  require_relative 'services/event'
22
22
  require_relative 'services/insurance'
23
+ require_relative 'services/luma'
23
24
  require_relative 'services/order'
24
25
  require_relative 'services/parcel'
25
26
  require_relative 'services/pickup'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - EasyPost Developers
@@ -341,6 +341,7 @@ files:
341
341
  - lib/easypost/services/end_shipper.rb
342
342
  - lib/easypost/services/event.rb
343
343
  - lib/easypost/services/insurance.rb
344
+ - lib/easypost/services/luma.rb
344
345
  - lib/easypost/services/order.rb
345
346
  - lib/easypost/services/parcel.rb
346
347
  - lib/easypost/services/pickup.rb