patch_ruby 1.10.2 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/patch_ruby/api_client.rb +1 -1
- data/lib/patch_ruby/models/create_flight_estimate_request.rb +58 -16
- data/lib/patch_ruby/version.rb +1 -1
- data/spec/integration/estimates_spec.rb +15 -0
- 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: 2b5dcbbc1ba86e420035b8e08b081f364968a5386427da541a69e4b9879f93c5
|
4
|
+
data.tar.gz: bf2ee708f760cc1d9e06bcf0a762f31a36048a298ac0ef50c4dd5a4755f28a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 960484aefeea40e249267beab92f89ca4ee784ba023ec98217a49b4d89b6cc419f51ff3968e273c3b7584a0867e50d6ecc91e68e7b6623d6aa8e4b4cee7b1481
|
7
|
+
data.tar.gz: 4f1c8621a5dc19d793796ec27d876fc748aa7409c050d354e3c384e4a0c3fcc16ae02bbd5accd8c4eaf20229e0a3b8841e41040076f2c3877a2ede3ca5b95b96
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [1.11.0] - 2021-09-07
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Adds support for airports, aircracts, cabin class and passenger count in flight estimates
|
13
|
+
|
8
14
|
## [1.10.2] - 2021-09-01
|
9
15
|
|
10
16
|
### Fixed
|
data/Gemfile.lock
CHANGED
@@ -31,7 +31,7 @@ module Patch
|
|
31
31
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
32
|
def initialize(config = Configuration.default)
|
33
33
|
@config = config
|
34
|
-
@user_agent = "patch-ruby/1.
|
34
|
+
@user_agent = "patch-ruby/1.11.0"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
@@ -17,6 +17,16 @@ module Patch
|
|
17
17
|
class CreateFlightEstimateRequest
|
18
18
|
attr_accessor :distance_m
|
19
19
|
|
20
|
+
attr_accessor :origin_airport
|
21
|
+
|
22
|
+
attr_accessor :destination_airport
|
23
|
+
|
24
|
+
attr_accessor :aircraft_code
|
25
|
+
|
26
|
+
attr_accessor :cabin_class
|
27
|
+
|
28
|
+
attr_accessor :passenger_count
|
29
|
+
|
20
30
|
attr_accessor :project_id
|
21
31
|
|
22
32
|
attr_accessor :create_order
|
@@ -25,6 +35,11 @@ module Patch
|
|
25
35
|
def self.attribute_map
|
26
36
|
{
|
27
37
|
:'distance_m' => :'distance_m',
|
38
|
+
:'origin_airport' => :'origin_airport',
|
39
|
+
:'destination_airport' => :'destination_airport',
|
40
|
+
:'aircraft_code' => :'aircraft_code',
|
41
|
+
:'cabin_class' => :'cabin_class',
|
42
|
+
:'passenger_count' => :'passenger_count',
|
28
43
|
:'project_id' => :'project_id',
|
29
44
|
:'create_order' => :'create_order'
|
30
45
|
}
|
@@ -39,6 +54,11 @@ module Patch
|
|
39
54
|
def self.openapi_types
|
40
55
|
{
|
41
56
|
:'distance_m' => :'Integer',
|
57
|
+
:'origin_airport' => :'String',
|
58
|
+
:'destination_airport' => :'String',
|
59
|
+
:'aircraft_code' => :'String',
|
60
|
+
:'cabin_class' => :'String',
|
61
|
+
:'passenger_count' => :'Integer',
|
42
62
|
:'project_id' => :'String',
|
43
63
|
:'create_order' => :'Boolean'
|
44
64
|
}
|
@@ -47,6 +67,12 @@ module Patch
|
|
47
67
|
# List of attributes with nullable: true
|
48
68
|
def self.openapi_nullable
|
49
69
|
Set.new([
|
70
|
+
:'distance_m',
|
71
|
+
:'origin_airport',
|
72
|
+
:'destination_airport',
|
73
|
+
:'aircraft_code',
|
74
|
+
:'cabin_class',
|
75
|
+
:'passenger_count',
|
50
76
|
:'project_id',
|
51
77
|
:'create_order'
|
52
78
|
])
|
@@ -83,6 +109,26 @@ module Patch
|
|
83
109
|
self.distance_m = attributes[:'distance_m']
|
84
110
|
end
|
85
111
|
|
112
|
+
if attributes.key?(:'origin_airport')
|
113
|
+
self.origin_airport = attributes[:'origin_airport']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'destination_airport')
|
117
|
+
self.destination_airport = attributes[:'destination_airport']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'aircraft_code')
|
121
|
+
self.aircraft_code = attributes[:'aircraft_code']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'cabin_class')
|
125
|
+
self.cabin_class = attributes[:'cabin_class']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'passenger_count')
|
129
|
+
self.passenger_count = attributes[:'passenger_count']
|
130
|
+
end
|
131
|
+
|
86
132
|
if attributes.key?(:'project_id')
|
87
133
|
self.project_id = attributes[:'project_id']
|
88
134
|
end
|
@@ -96,15 +142,11 @@ module Patch
|
|
96
142
|
# @return Array for valid properties with the reasons
|
97
143
|
def list_invalid_properties
|
98
144
|
invalid_properties = Array.new
|
99
|
-
if
|
100
|
-
invalid_properties.push('invalid value for "distance_m", distance_m cannot be nil.')
|
101
|
-
end
|
102
|
-
|
103
|
-
if @distance_m > 400000000
|
145
|
+
if !@distance_m.nil? && @distance_m > 400000000
|
104
146
|
invalid_properties.push('invalid value for "distance_m", must be smaller than or equal to 400000000.')
|
105
147
|
end
|
106
148
|
|
107
|
-
if @distance_m < 0
|
149
|
+
if !@distance_m.nil? && @distance_m < 0
|
108
150
|
invalid_properties.push('invalid value for "distance_m", must be greater than or equal to 0.')
|
109
151
|
end
|
110
152
|
|
@@ -114,24 +156,19 @@ module Patch
|
|
114
156
|
# Check to see if the all the properties in the model are valid
|
115
157
|
# @return true if the model is valid
|
116
158
|
def valid?
|
117
|
-
return false if
|
118
|
-
return false if @distance_m
|
119
|
-
return false if @distance_m < 0
|
159
|
+
return false if !@distance_m.nil? && @distance_m > 400000000
|
160
|
+
return false if !@distance_m.nil? && @distance_m < 0
|
120
161
|
true
|
121
162
|
end
|
122
163
|
|
123
164
|
# Custom attribute writer method with validation
|
124
165
|
# @param [Object] distance_m Value to be assigned
|
125
166
|
def distance_m=(distance_m)
|
126
|
-
if distance_m.nil?
|
127
|
-
fail ArgumentError, 'distance_m cannot be nil'
|
128
|
-
end
|
129
|
-
|
130
|
-
if distance_m > 400000000
|
167
|
+
if !distance_m.nil? && distance_m > 400000000
|
131
168
|
fail ArgumentError, 'invalid value for "distance_m", must be smaller than or equal to 400000000.'
|
132
169
|
end
|
133
170
|
|
134
|
-
if distance_m < 0
|
171
|
+
if !distance_m.nil? && distance_m < 0
|
135
172
|
fail ArgumentError, 'invalid value for "distance_m", must be greater than or equal to 0.'
|
136
173
|
end
|
137
174
|
|
@@ -144,6 +181,11 @@ module Patch
|
|
144
181
|
return true if self.equal?(o)
|
145
182
|
self.class == o.class &&
|
146
183
|
distance_m == o.distance_m &&
|
184
|
+
origin_airport == o.origin_airport &&
|
185
|
+
destination_airport == o.destination_airport &&
|
186
|
+
aircraft_code == o.aircraft_code &&
|
187
|
+
cabin_class == o.cabin_class &&
|
188
|
+
passenger_count == o.passenger_count &&
|
147
189
|
project_id == o.project_id &&
|
148
190
|
create_order == o.create_order
|
149
191
|
end
|
@@ -157,7 +199,7 @@ module Patch
|
|
157
199
|
# Calculates hash code according to all attributes.
|
158
200
|
# @return [Integer] Hash code
|
159
201
|
def hash
|
160
|
-
[distance_m, project_id, create_order].hash
|
202
|
+
[distance_m, origin_airport, destination_airport, aircraft_code, cabin_class, passenger_count, project_id, create_order].hash
|
161
203
|
end
|
162
204
|
|
163
205
|
# Builds the object from hash
|
data/lib/patch_ruby/version.rb
CHANGED
@@ -30,6 +30,21 @@ RSpec.describe 'Estimates Integration' do
|
|
30
30
|
expect(flight_estimate.data.mass_g).to eq 1_000_622
|
31
31
|
end
|
32
32
|
|
33
|
+
it 'supports creating flight estimates with origin and destination' do
|
34
|
+
flight_estimate = Patch::Estimate.create_flight_estimate(
|
35
|
+
origin_airport: "SFO",
|
36
|
+
destination_airport: "LAX"
|
37
|
+
)
|
38
|
+
|
39
|
+
flight_estimate_longer = Patch::Estimate.create_flight_estimate(
|
40
|
+
origin_airport: "SFO",
|
41
|
+
destination_airport: "JFK"
|
42
|
+
)
|
43
|
+
|
44
|
+
expect(flight_estimate.data.type).to eq 'flight'
|
45
|
+
expect(flight_estimate_longer.data.mass_g).to be > 2 * flight_estimate.data.mass_g
|
46
|
+
end
|
47
|
+
|
33
48
|
it 'supports creating vehicle estimates' do
|
34
49
|
distance_m = 10_000
|
35
50
|
make = "Toyota"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patch_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patch Technology
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|