hubrise_client 2.0.15 → 2.0.17

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: b05c00e55ba2498337eacf6f67d8d8e4c56a48d41c7bdb280dd475219efff7c6
4
- data.tar.gz: '079dc44ad7cd1728fbf50fe5c8a6226d78615a8738a01655fe23e9ba8f5af056'
3
+ metadata.gz: 1dfc2a2d18316bd5b60e5df2084ae4fb1bf753a76f69b8dc197e0b60c64de08a
4
+ data.tar.gz: 8af067d571dea28763f8a0c6d121acf30d88c1495f73f938ac592ce9f686520a
5
5
  SHA512:
6
- metadata.gz: 25477048e5358e52ed29bc5a32294dbfad3c9a703388bb8a5fa698c64fcc3a236596d0c1e70fe7f7c22217322ab6ce52881c35ade25b062599229d5828ef5a8c
7
- data.tar.gz: 1e51ad7068e667ed17640456e80d6ecf3802bb7d1904ac6d0860f2f33a1a0939ef9654c81bbd4f5eb6f1f1808e8ceb98e38ab9f19d6a2977d8079303b3d92596
6
+ metadata.gz: 429560249ef931c0dedfcf503cd9f952171514a089741ed06a8748d48005cd59507213e43a725fb5dcaa8a5e2bb209492375217b75b41a1af5f72b4a584df7d3
7
+ data.tar.gz: eecbcf1b062a8fa97f1b067013f4bf0a0b3e4f0963759958feea01c1f57e31a40bd82f22197dc5e10a32dce8c90c0cd7034ab2b89ece2208f5dff9bb3f861736
data/README.md CHANGED
@@ -115,7 +115,7 @@ bundle exec rspec
115
115
  3. Tag the repository:
116
116
 
117
117
  ```bash
118
- VERSION=2.0.9
118
+ VERSION=2.0.16
119
119
  git add lib/hubrise_client/version.rb
120
120
  git commit -m "Version $VERSION"
121
121
  git tag v$VERSION
data/V1_ENDPOINTS.md CHANGED
@@ -119,6 +119,38 @@ client = HubriseClient::V1.new(CLIENT_ID, CLIENT_SECRET, client_attrs)
119
119
  # [PATCH] /locations/locationIdX/orders/orderIdX/delivery with { headers: { "Content-Type": "application/json" }, body: "{\"status\":\"delivered\" }" }
120
120
  ```
121
121
 
122
+ ### GET_DELIVERY_QUOTES
123
+
124
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
125
+ ```ruby
126
+ client.get_delivery_quotes("locationIdX", "orderIdX")
127
+ # [GET] /locations/locationIdX/orders/orderIdX/delivery_quotes with { headers: { "X-Access-Token": "accessTokenX" }}
128
+ ```
129
+
130
+ ### GET_DELIVERY_QUOTE
131
+
132
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
133
+ ```ruby
134
+ client.get_delivery_quote("locationIdX", "orderIdX", "quoteIdX")
135
+ # [GET] /locations/locationIdX/orders/orderIdX/delivery_quotes/quoteIdX with { headers: { "X-Access-Token": "accessTokenX" }}
136
+ ```
137
+
138
+ ### CREATE_DELIVERY_QUOTE
139
+
140
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
141
+ ```ruby
142
+ client.create_delivery_quote("locationIdX", "orderIdX", { carrier: "UPS" })
143
+ # [POST] /locations/locationIdX/orders/orderIdX/delivery_quotes with { headers: { "Content-Type": "application/json" }, body: "{\"carrier\":\"UPS\" }" }
144
+ ```
145
+
146
+ ### ACCEPT_DELIVERY_QUOTE
147
+
148
+ - Initialized with `client_attrs = { access_token: "accessTokenX" }`
149
+ ```ruby
150
+ client.accept_delivery_quote("locationIdX", "orderIdX", "quoteIdX")
151
+ # [POST] /locations/locationIdX/orders/orderIdX/delivery_quotes/quoteIdX/accept with { headers: { "X-Access-Token": "accessTokenX" }}
152
+ ```
153
+
122
154
  ### GET_CALLBACK
123
155
 
124
156
  - Initialized with `client_attrs = { access_token: "accessTokenX" }`
@@ -38,8 +38,8 @@ module HubriseClient
38
38
 
39
39
  def build_authorization_url(redirect_uri, scope, params = {})
40
40
  params = params.merge(
41
- redirect_uri: redirect_uri,
42
- scope: scope,
41
+ redirect_uri:,
42
+ scope:,
43
43
  client_id: @app_id
44
44
  )
45
45
 
@@ -83,9 +83,9 @@ module HubriseClient
83
83
  raise(HubriseAccessTokenMissing) if @access_token.nil?
84
84
 
85
85
  api_request(
86
- "#{@api_host}:#{@api_port}/#{version}", path, method, data: data,
87
- json: json,
88
- headers: headers,
86
+ "#{@api_host}:#{@api_port}/#{version}", path, method, data:,
87
+ json:,
88
+ headers:,
89
89
  access_token: @access_token,
90
90
  callback: @request_callback
91
91
  ).perform
@@ -94,9 +94,9 @@ module HubriseClient
94
94
  def api_request(hostname, path, method, attrs = {})
95
95
  Request.from_h(
96
96
  {
97
- hostname: hostname,
98
- path: path,
99
- method: method,
97
+ hostname:,
98
+ path:,
99
+ method:,
100
100
  use_https: @use_https,
101
101
  logger: @verbous && @logger,
102
102
  json: true,
@@ -83,6 +83,25 @@ module HubriseClient
83
83
  call_api("/locations/#{location_id}/orders/#{order_id}/delivery", :patch, data: params)
84
84
  end
85
85
 
86
+ # --------------------
87
+ # Delivery quotes
88
+ # --------------------
89
+ def get_delivery_quotes(location_id, order_id)
90
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes")
91
+ end
92
+
93
+ def get_delivery_quote(location_id, order_id, quote_id)
94
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes/#{quote_id}")
95
+ end
96
+
97
+ def create_delivery_quote(location_id, order_id, params)
98
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes", :post, data: params)
99
+ end
100
+
101
+ def accept_delivery_quote(location_id, order_id, quote_id)
102
+ call_api("/locations/#{location_id}/orders/#{order_id}/delivery_quotes/#{quote_id}/accept", :post)
103
+ end
104
+
86
105
  # --------------------
87
106
  # Callback, events
88
107
  # --------------------
@@ -180,7 +199,7 @@ module HubriseClient
180
199
  def create_image(data, mime_type, catalog_id = nil, options = {})
181
200
  path = "/catalogs/#{catalog_id_fallback(catalog_id)}/images"
182
201
  path += "?private_ref=#{CGI.escape(options[:private_ref])}" if options[:private_ref]
183
- call_api(path, :post, data: data, headers: { "Content-Type" => mime_type }, json: false)
202
+ call_api(path, :post, data:, headers: { "Content-Type" => mime_type }, json: false)
184
203
  end
185
204
 
186
205
  def get_images(catalog_id = nil)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module HubriseClient
3
- VERSION = "2.0.15"
3
+ VERSION = "2.0.17"
4
4
  end
metadata CHANGED
@@ -1,18 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubrise_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.15
4
+ version: 2.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Monnier
8
8
  - Nick Save
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2025-06-12 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description:
15
- email:
16
13
  executables: []
17
14
  extensions: []
18
15
  extra_rdoc_files: []
@@ -31,7 +28,6 @@ homepage: https://github.com/HubRise/ruby-client
31
28
  licenses:
32
29
  - MIT
33
30
  metadata: {}
34
- post_install_message:
35
31
  rdoc_options: []
36
32
  require_paths:
37
33
  - lib
@@ -39,15 +35,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
35
  requirements:
40
36
  - - ">="
41
37
  - !ruby/object:Gem::Version
42
- version: 2.7.7
38
+ version: 3.1.4
43
39
  required_rubygems_version: !ruby/object:Gem::Requirement
44
40
  requirements:
45
41
  - - ">="
46
42
  - !ruby/object:Gem::Version
47
43
  version: '0'
48
44
  requirements: []
49
- rubygems_version: 3.4.20
50
- signing_key:
45
+ rubygems_version: 3.6.7
51
46
  specification_version: 4
52
47
  summary: HubRise Ruby client
53
48
  test_files: []