nextbillionai 0.1.0.pre.alpha.4 → 0.1.0.pre.alpha.6
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 +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +9 -9
- data/lib/nextbillionai/internal/transport/base_client.rb +1 -1
- data/lib/nextbillionai/models/optimization/vehicle.rb +3 -26
- data/lib/nextbillionai/version.rb +1 -1
- data/rbi/nextbillionai/internal/transport/base_client.rbi +1 -1
- data/rbi/nextbillionai/models/optimization/vehicle.rbi +4 -45
- data/sig/nextbillionai/internal/transport/base_client.rbs +1 -1
- data/sig/nextbillionai/models/optimization/vehicle.rbs +4 -20
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c3677bef149eeb968ed267893dd6c90856e29872b494e84fad2a0e0c65662d1
|
|
4
|
+
data.tar.gz: a3a95fc6a17cfa18f409f690db20f8819ad4e0da9c2544cda63eb94f904fde6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 779cd496eead9d234acbbac7729c6fbeeb396adccd8df488d52efea8d579023b2ddff48689d097042df464a08d4ab81bfb4771162486ff87a70bcd066dfa3009
|
|
7
|
+
data.tar.gz: 8bea5f1219ca643cb6c622766f9c63f89ae081622c8a02ca7c683e9a56f6be2c6ee460505ce65c5a135ea750bd08605acd4c34548ec8c34c6a4be1a9e1e5f7a7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.6 (2025-08-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* **api:** dedupe location types ([3c8eebd](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/commit/3c8eebdbcd82ec1a65feba70b870239693852364))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.5 (2025-08-01)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** manual updates ([00200c4](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/commit/00200c44462ccfa224ea09c654136dbb57a008de))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* List<List> problem in java by naming dto.Event ([809a0a1](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/commit/809a0a1feda028b874e0b1220f33bb4593688aa2))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Chores
|
|
26
|
+
|
|
27
|
+
* **internal:** increase visibility of internal helper method ([e238599](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/commit/e23859972996f44b782c91856e9b3d6576310838))
|
|
28
|
+
|
|
3
29
|
## 0.1.0-alpha.4 (2025-07-30)
|
|
4
30
|
|
|
5
31
|
Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/nextbillion-ai/nextbillion-sdk-ruby/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "nextbillionai", "~> 0.1.0.pre.alpha.
|
|
20
|
+
gem "nextbillionai", "~> 0.1.0.pre.alpha.6"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -34,7 +34,7 @@ nextbillion_sdk = Nextbillionai::Client.new(
|
|
|
34
34
|
|
|
35
35
|
response = nextbillion_sdk.directions.compute_route(
|
|
36
36
|
destination: "1.335368,103.785517",
|
|
37
|
-
origin: "1.312164,103.
|
|
37
|
+
origin: "1.312164,103.841063"
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
puts(response.msg)
|
|
@@ -48,7 +48,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
|
|
|
48
48
|
begin
|
|
49
49
|
direction = nextbillion_sdk.directions.compute_route(
|
|
50
50
|
destination: "1.335368,103.785517",
|
|
51
|
-
origin: "1.312164,103.
|
|
51
|
+
origin: "1.312164,103.841063"
|
|
52
52
|
)
|
|
53
53
|
rescue Nextbillionai::Errors::APIConnectionError => e
|
|
54
54
|
puts("The server could not be reached")
|
|
@@ -94,7 +94,7 @@ nextbillion_sdk = Nextbillionai::Client.new(
|
|
|
94
94
|
# Or, configure per-request:
|
|
95
95
|
nextbillion_sdk.directions.compute_route(
|
|
96
96
|
destination: "1.335368,103.785517",
|
|
97
|
-
origin: "1.312164,103.
|
|
97
|
+
origin: "1.312164,103.841063",
|
|
98
98
|
request_options: {max_retries: 5}
|
|
99
99
|
)
|
|
100
100
|
```
|
|
@@ -112,7 +112,7 @@ nextbillion_sdk = Nextbillionai::Client.new(
|
|
|
112
112
|
# Or, configure per-request:
|
|
113
113
|
nextbillion_sdk.directions.compute_route(
|
|
114
114
|
destination: "1.335368,103.785517",
|
|
115
|
-
origin: "1.312164,103.
|
|
115
|
+
origin: "1.312164,103.841063",
|
|
116
116
|
request_options: {timeout: 5}
|
|
117
117
|
)
|
|
118
118
|
```
|
|
@@ -147,7 +147,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
|
|
|
147
147
|
response =
|
|
148
148
|
nextbillion_sdk.directions.compute_route(
|
|
149
149
|
destination: "1.335368,103.785517",
|
|
150
|
-
origin: "1.312164,103.
|
|
150
|
+
origin: "1.312164,103.841063",
|
|
151
151
|
request_options: {
|
|
152
152
|
extra_query: {my_query_parameter: value},
|
|
153
153
|
extra_body: {my_body_parameter: value},
|
|
@@ -195,7 +195,7 @@ You can provide typesafe request parameters like so:
|
|
|
195
195
|
```ruby
|
|
196
196
|
nextbillion_sdk.directions.compute_route(
|
|
197
197
|
destination: "1.335368,103.785517",
|
|
198
|
-
origin: "1.312164,103.
|
|
198
|
+
origin: "1.312164,103.841063"
|
|
199
199
|
)
|
|
200
200
|
```
|
|
201
201
|
|
|
@@ -205,13 +205,13 @@ Or, equivalently:
|
|
|
205
205
|
# Hashes work, but are not typesafe:
|
|
206
206
|
nextbillion_sdk.directions.compute_route(
|
|
207
207
|
destination: "1.335368,103.785517",
|
|
208
|
-
origin: "1.312164,103.
|
|
208
|
+
origin: "1.312164,103.841063"
|
|
209
209
|
)
|
|
210
210
|
|
|
211
211
|
# You can also splat a full Params class:
|
|
212
212
|
params = Nextbillionai::DirectionComputeRouteParams.new(
|
|
213
213
|
destination: "1.335368,103.785517",
|
|
214
|
-
origin: "1.312164,103.
|
|
214
|
+
origin: "1.312164,103.841063"
|
|
215
215
|
)
|
|
216
216
|
nextbillion_sdk.directions.compute_route(**params)
|
|
217
217
|
```
|
|
@@ -368,7 +368,7 @@ module Nextbillionai
|
|
|
368
368
|
#
|
|
369
369
|
# @raise [Nextbillionai::Errors::APIError]
|
|
370
370
|
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
|
|
371
|
-
|
|
371
|
+
def send_request(request, redirect_count:, retry_count:, send_retry_header:)
|
|
372
372
|
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
|
|
373
373
|
input = {
|
|
374
374
|
**request.except(:timeout),
|
|
@@ -14,8 +14,8 @@ module Nextbillionai
|
|
|
14
14
|
# Specify the location coordinates where the vehicle is currently located. This
|
|
15
15
|
# input is mandatory for each vehicle.
|
|
16
16
|
#
|
|
17
|
-
# @return [Nextbillionai::Models::Optimization::
|
|
18
|
-
required :location, -> { Nextbillionai::Optimization::
|
|
17
|
+
# @return [Nextbillionai::Models::Optimization::Location]
|
|
18
|
+
required :location, -> { Nextbillionai::Optimization::Location }
|
|
19
19
|
|
|
20
20
|
# @!attribute attributes
|
|
21
21
|
# Specify custom attributes for the vehicle. Each attribute should be created as a
|
|
@@ -56,36 +56,13 @@ module Nextbillionai
|
|
|
56
56
|
#
|
|
57
57
|
# @param id [String] Specify a unique ID for the vehicle.
|
|
58
58
|
#
|
|
59
|
-
# @param location [Nextbillionai::Models::Optimization::
|
|
59
|
+
# @param location [Nextbillionai::Models::Optimization::Location] Specify the location coordinates where the vehicle is currently located. This in
|
|
60
60
|
#
|
|
61
61
|
# @param attributes [Object] Specify custom attributes for the vehicle. Each attribute should be created as a
|
|
62
62
|
#
|
|
63
63
|
# @param priority [Integer] Specify the priority for this vehicle. A higher value indicates a higher priorit
|
|
64
64
|
#
|
|
65
65
|
# @param remaining_waypoints [Array<Nextbillionai::Models::Optimization::Location>] An array of objects to collect the location coordinates of the stops remaining o
|
|
66
|
-
|
|
67
|
-
# @see Nextbillionai::Models::Optimization::Vehicle#location
|
|
68
|
-
class Location < Nextbillionai::Internal::Type::BaseModel
|
|
69
|
-
# @!attribute lat
|
|
70
|
-
# Latitude of the vehicle's current location.
|
|
71
|
-
#
|
|
72
|
-
# @return [Float, nil]
|
|
73
|
-
optional :lat, Float
|
|
74
|
-
|
|
75
|
-
# @!attribute lng
|
|
76
|
-
# Longitude of the vehicle's current location.
|
|
77
|
-
#
|
|
78
|
-
# @return [Float, nil]
|
|
79
|
-
optional :lng, Float
|
|
80
|
-
|
|
81
|
-
# @!method initialize(lat: nil, lng: nil)
|
|
82
|
-
# Specify the location coordinates where the vehicle is currently located. This
|
|
83
|
-
# input is mandatory for each vehicle.
|
|
84
|
-
#
|
|
85
|
-
# @param lat [Float] Latitude of the vehicle's current location.
|
|
86
|
-
#
|
|
87
|
-
# @param lng [Float] Longitude of the vehicle's current location.
|
|
88
|
-
end
|
|
89
66
|
end
|
|
90
67
|
end
|
|
91
68
|
end
|
|
@@ -18,13 +18,11 @@ module Nextbillionai
|
|
|
18
18
|
|
|
19
19
|
# Specify the location coordinates where the vehicle is currently located. This
|
|
20
20
|
# input is mandatory for each vehicle.
|
|
21
|
-
sig { returns(Nextbillionai::Optimization::
|
|
21
|
+
sig { returns(Nextbillionai::Optimization::Location) }
|
|
22
22
|
attr_reader :location
|
|
23
23
|
|
|
24
24
|
sig do
|
|
25
|
-
params(
|
|
26
|
-
location: Nextbillionai::Optimization::Vehicle::Location::OrHash
|
|
27
|
-
).void
|
|
25
|
+
params(location: Nextbillionai::Optimization::Location::OrHash).void
|
|
28
26
|
end
|
|
29
27
|
attr_writer :location
|
|
30
28
|
|
|
@@ -73,7 +71,7 @@ module Nextbillionai
|
|
|
73
71
|
sig do
|
|
74
72
|
params(
|
|
75
73
|
id: String,
|
|
76
|
-
location: Nextbillionai::Optimization::
|
|
74
|
+
location: Nextbillionai::Optimization::Location::OrHash,
|
|
77
75
|
attributes: T.anything,
|
|
78
76
|
priority: Integer,
|
|
79
77
|
remaining_waypoints:
|
|
@@ -113,7 +111,7 @@ module Nextbillionai
|
|
|
113
111
|
override.returns(
|
|
114
112
|
{
|
|
115
113
|
id: String,
|
|
116
|
-
location: Nextbillionai::Optimization::
|
|
114
|
+
location: Nextbillionai::Optimization::Location,
|
|
117
115
|
attributes: T.anything,
|
|
118
116
|
priority: Integer,
|
|
119
117
|
remaining_waypoints:
|
|
@@ -123,45 +121,6 @@ module Nextbillionai
|
|
|
123
121
|
end
|
|
124
122
|
def to_hash
|
|
125
123
|
end
|
|
126
|
-
|
|
127
|
-
class Location < Nextbillionai::Internal::Type::BaseModel
|
|
128
|
-
OrHash =
|
|
129
|
-
T.type_alias do
|
|
130
|
-
T.any(
|
|
131
|
-
Nextbillionai::Optimization::Vehicle::Location,
|
|
132
|
-
Nextbillionai::Internal::AnyHash
|
|
133
|
-
)
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
# Latitude of the vehicle's current location.
|
|
137
|
-
sig { returns(T.nilable(Float)) }
|
|
138
|
-
attr_reader :lat
|
|
139
|
-
|
|
140
|
-
sig { params(lat: Float).void }
|
|
141
|
-
attr_writer :lat
|
|
142
|
-
|
|
143
|
-
# Longitude of the vehicle's current location.
|
|
144
|
-
sig { returns(T.nilable(Float)) }
|
|
145
|
-
attr_reader :lng
|
|
146
|
-
|
|
147
|
-
sig { params(lng: Float).void }
|
|
148
|
-
attr_writer :lng
|
|
149
|
-
|
|
150
|
-
# Specify the location coordinates where the vehicle is currently located. This
|
|
151
|
-
# input is mandatory for each vehicle.
|
|
152
|
-
sig { params(lat: Float, lng: Float).returns(T.attached_class) }
|
|
153
|
-
def self.new(
|
|
154
|
-
# Latitude of the vehicle's current location.
|
|
155
|
-
lat: nil,
|
|
156
|
-
# Longitude of the vehicle's current location.
|
|
157
|
-
lng: nil
|
|
158
|
-
)
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
sig { override.returns({ lat: Float, lng: Float }) }
|
|
162
|
-
def to_hash
|
|
163
|
-
end
|
|
164
|
-
end
|
|
165
124
|
end
|
|
166
125
|
end
|
|
167
126
|
end
|
|
@@ -4,7 +4,7 @@ module Nextbillionai
|
|
|
4
4
|
type vehicle =
|
|
5
5
|
{
|
|
6
6
|
id: String,
|
|
7
|
-
location: Nextbillionai::Optimization::
|
|
7
|
+
location: Nextbillionai::Optimization::Location,
|
|
8
8
|
attributes: top,
|
|
9
9
|
priority: Integer,
|
|
10
10
|
remaining_waypoints: ::Array[Nextbillionai::Optimization::Location]
|
|
@@ -13,7 +13,7 @@ module Nextbillionai
|
|
|
13
13
|
class Vehicle < Nextbillionai::Internal::Type::BaseModel
|
|
14
14
|
attr_accessor id: String
|
|
15
15
|
|
|
16
|
-
attr_accessor location: Nextbillionai::Optimization::
|
|
16
|
+
attr_accessor location: Nextbillionai::Optimization::Location
|
|
17
17
|
|
|
18
18
|
attr_reader attributes: top?
|
|
19
19
|
|
|
@@ -31,7 +31,7 @@ module Nextbillionai
|
|
|
31
31
|
|
|
32
32
|
def initialize: (
|
|
33
33
|
id: String,
|
|
34
|
-
location: Nextbillionai::Optimization::
|
|
34
|
+
location: Nextbillionai::Optimization::Location,
|
|
35
35
|
?attributes: top,
|
|
36
36
|
?priority: Integer,
|
|
37
37
|
?remaining_waypoints: ::Array[Nextbillionai::Optimization::Location]
|
|
@@ -39,27 +39,11 @@ module Nextbillionai
|
|
|
39
39
|
|
|
40
40
|
def to_hash: -> {
|
|
41
41
|
id: String,
|
|
42
|
-
location: Nextbillionai::Optimization::
|
|
42
|
+
location: Nextbillionai::Optimization::Location,
|
|
43
43
|
attributes: top,
|
|
44
44
|
priority: Integer,
|
|
45
45
|
remaining_waypoints: ::Array[Nextbillionai::Optimization::Location]
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
type location = { lat: Float, lng: Float }
|
|
49
|
-
|
|
50
|
-
class Location < Nextbillionai::Internal::Type::BaseModel
|
|
51
|
-
attr_reader lat: Float?
|
|
52
|
-
|
|
53
|
-
def lat=: (Float) -> Float
|
|
54
|
-
|
|
55
|
-
attr_reader lng: Float?
|
|
56
|
-
|
|
57
|
-
def lng=: (Float) -> Float
|
|
58
|
-
|
|
59
|
-
def initialize: (?lat: Float, ?lng: Float) -> void
|
|
60
|
-
|
|
61
|
-
def to_hash: -> { lat: Float, lng: Float }
|
|
62
|
-
end
|
|
63
47
|
end
|
|
64
48
|
end
|
|
65
49
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nextbillionai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0.pre.alpha.
|
|
4
|
+
version: 0.1.0.pre.alpha.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nextbillion SDK
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|