patch_ruby 2.5.0 → 2.6.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +18 -25
  5. data/README.md +0 -52
  6. data/lib/patch_ruby/api_client.rb +1 -1
  7. data/lib/patch_ruby/version.rb +1 -1
  8. data/lib/patch_ruby.rb +0 -10
  9. data/spec/api/orders_api_spec.rb +0 -1
  10. data/spec/integration/orders_spec.rb +0 -25
  11. data/spec/integration/projects_spec.rb +1 -1
  12. metadata +15 -45
  13. data/lib/patch_ruby/api/estimates_api.rb +0 -612
  14. data/lib/patch_ruby/models/create_air_shipping_estimate_request.rb +0 -374
  15. data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +0 -271
  16. data/lib/patch_ruby/models/create_mass_estimate_request.rb +0 -282
  17. data/lib/patch_ruby/models/create_rail_shipping_estimate_request.rb +0 -404
  18. data/lib/patch_ruby/models/create_road_shipping_estimate_request.rb +0 -517
  19. data/lib/patch_ruby/models/create_sea_shipping_estimate_request.rb +0 -461
  20. data/lib/patch_ruby/models/estimate.rb +0 -288
  21. data/lib/patch_ruby/models/estimate_list_response.rb +0 -273
  22. data/lib/patch_ruby/models/estimate_response.rb +0 -257
  23. data/spec/api/estimates_api_spec.rb +0 -70
  24. data/spec/factories/create_mass_estimate_requests.rb +0 -6
  25. data/spec/factories/estimate_list_responses.rb +0 -8
  26. data/spec/factories/estimate_responses.rb +0 -7
  27. data/spec/factories/estimates.rb +0 -8
  28. data/spec/integration/estimates_spec.rb +0 -218
  29. data/spec/models/create_mass_estimate_request_spec.rb +0 -46
  30. data/spec/models/estimate_list_response_spec.rb +0 -64
  31. data/spec/models/estimate_response_spec.rb +0 -58
  32. data/spec/models/estimate_spec.rb +0 -65
@@ -1,257 +0,0 @@
1
- =begin
2
- #Patch API V2
3
-
4
- #The core API used to integrate with Patch's service
5
-
6
- The version of the OpenAPI document: 2
7
- Contact: engineering@usepatch.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Patch
17
- class EstimateResponse
18
- attr_accessor :success
19
-
20
- attr_accessor :error
21
-
22
- attr_accessor :data
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'success' => :'success',
28
- :'error' => :'error',
29
- :'data' => :'data'
30
- }
31
- end
32
-
33
- # Returns all the JSON keys this model knows about
34
- def self.acceptable_attributes
35
- attribute_map.values
36
- end
37
-
38
- # Attribute type mapping.
39
- def self.openapi_types
40
- {
41
- :'success' => :'Boolean',
42
- :'error' => :'Object',
43
- :'data' => :'Estimate'
44
- }
45
- end
46
-
47
- # List of attributes with nullable: true
48
- def self.openapi_nullable
49
- Set.new([
50
- :'error',
51
- ])
52
- end
53
-
54
-
55
- # Allows models with corresponding API classes to delegate API operations to those API classes
56
- # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
57
- # Eg. Order.create_order delegates to OrdersApi.new.create_order
58
- def self.method_missing(message, *args, &block)
59
- if Object.const_defined?('Patch::EstimateResponsesApi::OPERATIONS') && Patch::EstimateResponsesApi::OPERATIONS.include?(message)
60
- Patch::EstimateResponsesApi.new.send(message, *args)
61
- else
62
- super
63
- end
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::EstimateResponse` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- attributes = attributes.each_with_object({}) { |(k, v), h|
75
- if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::EstimateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
- end
78
- h[k.to_sym] = v
79
- }
80
-
81
- if attributes.key?(:'success')
82
- self.success = attributes[:'success']
83
- end
84
-
85
- if attributes.key?(:'error')
86
- self.error = attributes[:'error']
87
- end
88
-
89
- if attributes.key?(:'data')
90
- self.data = attributes[:'data']
91
- end
92
- end
93
-
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- invalid_properties = Array.new
98
- if @success.nil?
99
- invalid_properties.push('invalid value for "success", success cannot be nil.')
100
- end
101
-
102
- if @data.nil?
103
- invalid_properties.push('invalid value for "data", data cannot be nil.')
104
- end
105
-
106
- invalid_properties
107
- end
108
-
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- return false if @success.nil?
113
- return false if @data.nil?
114
- true
115
- end
116
-
117
- # Checks equality by comparing each attribute.
118
- # @param [Object] Object to be compared
119
- def ==(o)
120
- return true if self.equal?(o)
121
- self.class == o.class &&
122
- success == o.success &&
123
- error == o.error &&
124
- data == o.data
125
- end
126
-
127
- # @see the `==` method
128
- # @param [Object] Object to be compared
129
- def eql?(o)
130
- self == o
131
- end
132
-
133
- # Calculates hash code according to all attributes.
134
- # @return [Integer] Hash code
135
- def hash
136
- [success, error, data].hash
137
- end
138
-
139
- # Builds the object from hash
140
- # @param [Hash] attributes Model attributes in the form of hash
141
- # @return [Object] Returns the model itself
142
- def self.build_from_hash(attributes)
143
- new.build_from_hash(attributes)
144
- end
145
-
146
- # Builds the object from hash
147
- # @param [Hash] attributes Model attributes in the form of hash
148
- # @return [Object] Returns the model itself
149
- def build_from_hash(attributes)
150
- return nil unless attributes.is_a?(Hash)
151
- self.class.openapi_types.each_pair do |key, type|
152
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
- self.send("#{key}=", nil)
154
- elsif type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the attribute
156
- # is documented as an array but the input is not
157
- if attributes[self.class.attribute_map[key]].is_a?(Array)
158
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
- end
160
- elsif !attributes[self.class.attribute_map[key]].nil?
161
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
- end
163
- end
164
-
165
- self
166
- end
167
-
168
- # Deserializes the data based on type
169
- # @param string type Data type
170
- # @param string value Value to be deserialized
171
- # @return [Object] Deserialized data
172
- def _deserialize(type, value)
173
- case type.to_sym
174
- when :Time
175
- Time.parse(value)
176
- when :Date
177
- Date.parse(value)
178
- when :String
179
- value.to_s
180
- when :Integer
181
- value.to_i
182
- when :Float
183
- value.to_f
184
- when :Boolean
185
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
- true
187
- else
188
- false
189
- end
190
- when :Object
191
- # generic object (usually a Hash), return directly
192
- value
193
- when /\AArray<(?<inner_type>.+)>\z/
194
- inner_type = Regexp.last_match[:inner_type]
195
- value.map { |v| _deserialize(inner_type, v) }
196
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
- k_type = Regexp.last_match[:k_type]
198
- v_type = Regexp.last_match[:v_type]
199
- {}.tap do |hash|
200
- value.each do |k, v|
201
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
- end
203
- end
204
- else # model
205
- # models (e.g. Pet) or oneOf
206
- klass = Patch.const_get(type)
207
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
- end
209
- end
210
-
211
- # Returns the string representation of the object
212
- # @return [String] String presentation of the object
213
- def to_s
214
- to_hash.to_s
215
- end
216
-
217
- # to_body is an alias to to_hash (backward compatibility)
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_body
220
- to_hash
221
- end
222
-
223
- # Returns the object in the form of hash
224
- # @return [Hash] Returns the object in the form of hash
225
- def to_hash
226
- hash = {}
227
- self.class.attribute_map.each_pair do |attr, param|
228
- value = self.send(attr)
229
- if value.nil?
230
- is_nullable = self.class.openapi_nullable.include?(attr)
231
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
- end
233
-
234
- hash[param] = _to_hash(value)
235
- end
236
- hash
237
- end
238
-
239
- # Outputs non-array value in the form of hash
240
- # For object, use to_hash. Otherwise, just return the value
241
- # @param [Object] value Any valid value
242
- # @return [Hash] Returns the value in the form of hash
243
- def _to_hash(value)
244
- if value.is_a?(Array)
245
- value.compact.map { |v| _to_hash(v) }
246
- elsif value.is_a?(Hash)
247
- {}.tap do |hash|
248
- value.each { |k, v| hash[k] = _to_hash(v) }
249
- end
250
- elsif value.respond_to? :to_hash
251
- value.to_hash
252
- else
253
- value
254
- end
255
- end
256
- end
257
- end
@@ -1,70 +0,0 @@
1
- =begin
2
- #Patch API V1
3
-
4
- #The core API used to integrate with Patch's service
5
-
6
- The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
-
16
- # Unit tests for Patch::EstimatesApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'EstimatesApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Patch::EstimatesApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of EstimatesApi' do
30
- it 'should create an instance of EstimatesApi' do
31
- expect(@api_instance).to be_instance_of(Patch::EstimatesApi)
32
- end
33
- end
34
-
35
- # unit tests for create_mass_estimate
36
- # Create an estimate based on mass of CO2
37
- # Creates an estimate for the mass of CO2 to be compensated. An order in the &#x60;draft&#x60; state will also be created, linked to the estimate.
38
- # @param create_mass_estimate_request
39
- # @param [Hash] opts the optional parameters
40
- # @return [EstimateResponse]
41
- describe 'create_mass_estimate test' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
45
- end
46
-
47
- # unit tests for retrieve_estimate
48
- # Retrieves an estimate
49
- # Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
50
- # @param id
51
- # @param [Hash] opts the optional parameters
52
- # @return [EstimateResponse]
53
- describe 'retrieve_estimate test' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
57
- end
58
-
59
- # unit tests for retrieve_estimates
60
- # Retrieves a list of estimates
61
- # Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for.
62
- # @param [Hash] opts the optional parameters
63
- # @option opts [Integer] :page
64
- # @return [EstimateListResponse]
65
- describe 'retrieve_estimates test' do
66
- it 'should work' do
67
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
- end
69
- end
70
- end
@@ -1,6 +0,0 @@
1
- FactoryBot.define do
2
- factory :create_mass_estimate_request, class: Patch::CreateMassEstimateRequest do
3
- sequence(:project_id) { |n| n }
4
- mass_g { 100 }
5
- end
6
- end
@@ -1,8 +0,0 @@
1
- FactoryBot.define do
2
- factory :estimate_list_response, class: Patch::EstimateListResponse do
3
- success { true }
4
- error { {} }
5
- data { {} }
6
- meta { {} }
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :estimate_response, class: Patch::EstimateResponse do
3
- success { true }
4
- error { {} }
5
- data { {} }
6
- end
7
- end
@@ -1,8 +0,0 @@
1
- FactoryBot.define do
2
- factory :estimate, class: Patch::Estimate do
3
- sequence(:id) { |n| n }
4
- association :order
5
- production { false }
6
- type { "mass" }
7
- end
8
- end
@@ -1,218 +0,0 @@
1
- RSpec.describe 'Estimates Integration' do
2
- it 'supports create, retrieve and list' do
3
- create_estimate_response = Patch::Estimate.create_mass_estimate(mass_g: 100)
4
- estimate_id = create_estimate_response.data.id
5
-
6
- retrieve_estimate_response = Patch::Estimate.retrieve_estimate(estimate_id)
7
- expect(retrieve_estimate_response.data.id).to eq estimate_id
8
-
9
- page_limit = 1
10
- next_page = 1
11
- estimates = []
12
-
13
- while !next_page.nil? && next_page <= page_limit
14
- retrieve_estimates_response = Patch::Estimate.retrieve_estimates(page: next_page)
15
- next_page = retrieve_estimates_response.meta.next_page
16
- estimates += retrieve_estimates_response.data
17
- end
18
-
19
- expect(estimates.length).not_to be_zero
20
- end
21
-
22
- it 'supports creating bitcoin estimates with partial information' do
23
- bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate()
24
-
25
- expect(bitcoin_estimate.data.type).to eq 'bitcoin'
26
- expect(bitcoin_estimate.data.mass_g).to be >= 2_000
27
- end
28
-
29
- it 'supports creating bitcoin estimates with a transaction amount' do
30
- bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate(
31
- transaction_value_btc_sats: 10_000
32
- )
33
-
34
- bitcoin_estimate_2 = Patch::Estimate.create_bitcoin_estimate(
35
- transaction_value_btc_sats: 100_000
36
- )
37
-
38
- expect(bitcoin_estimate.data.type).to eq 'bitcoin'
39
- expect(bitcoin_estimate.data.mass_g).to be < bitcoin_estimate_2.data.mass_g
40
- end
41
-
42
- it 'supports creating bitcoin estimates with a timestamp' do
43
- bitcoin_estimate_1 = Patch::Estimate.create_bitcoin_estimate(
44
- timestamp: '2021-06-01T20:31:18.403Z'
45
- )
46
-
47
- bitcoin_estimate_2 = Patch::Estimate.create_bitcoin_estimate(
48
- timestamp: '2021-07-01T20:31:18.403Z'
49
- )
50
-
51
- expect(bitcoin_estimate_1.data.type).to eq 'bitcoin'
52
- expect(bitcoin_estimate_1.data.mass_g).to be > bitcoin_estimate_2.data.mass_g # Bitcoin was emitting less in July 2021 than in June
53
- end
54
-
55
- it 'supports creating bitcoin estimates with a average_daily_balance_btc_sats' do
56
- bitcoin_estimate_1 = Patch::Estimate.create_bitcoin_estimate(
57
- average_daily_balance_btc_sats: 1000000
58
- )
59
-
60
- bitcoin_estimate_2 = Patch::Estimate.create_bitcoin_estimate(
61
- average_daily_balance_btc_sats: 10000000
62
- )
63
-
64
- expect(bitcoin_estimate_1.data.type).to eq 'bitcoin'
65
- expect(bitcoin_estimate_1.data.mass_g).to be < bitcoin_estimate_2.data.mass_g
66
- end
67
-
68
- context "when creating an air shipping estimate" do
69
- it "supports creating an estimate using airports" do
70
- air_shipping_estimate = Patch::Estimate.create_air_shipping_estimate(
71
- aircraft_type: "cargo",
72
- create_order: false,
73
- destination_airport: "JFK",
74
- freight_mass_g: 31_300,
75
- origin_airport: "SFO"
76
- )
77
- expect(air_shipping_estimate.data.type).to eq('shipping_air')
78
- expect(air_shipping_estimate.data.mass_g).to be > 0
79
- end
80
-
81
- it "supports creating an estimate with an order" do
82
- air_shipping_estimate = Patch::Estimate.create_air_shipping_estimate(
83
- aircraft_type: "cargo",
84
- create_order: true,
85
- destination_airport: "JFK",
86
- freight_mass_g: 19_140,
87
- origin_airport: "SFO"
88
- )
89
- expect(air_shipping_estimate.data.type).to eq('shipping_air')
90
- expect(air_shipping_estimate.data.mass_g).to be > 0
91
- expect(air_shipping_estimate.data.order.amount).to be > 0
92
- end
93
- end
94
-
95
- context "when creating a rail shipping estimate" do
96
- it "supports creating an estimate using locodes" do
97
- rail_shipping_estimate = Patch::Estimate.create_rail_shipping_estimate(
98
- create_order: false,
99
- destination_locode: "USSEA",
100
- emissions_scope: "wtw",
101
- freight_mass_g: 419_060,
102
- fuel_type: "diesel",
103
- origin_locode: "USSD2"
104
- )
105
- expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
106
- expect(rail_shipping_estimate.data.mass_g).to be > 0
107
- end
108
-
109
- it "supports creating an estimate using postal codes" do
110
- rail_shipping_estimate = Patch::Estimate.create_rail_shipping_estimate(
111
- create_order: false,
112
- destination_country_code: "US",
113
- destination_postal_code: "97209",
114
- emissions_scope: "wtw",
115
- freight_mass_g: 226_000,
116
- fuel_type: "diesel",
117
- origin_country_code: "US",
118
- origin_postal_code: "90210"
119
- )
120
- expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
121
- expect(rail_shipping_estimate.data.mass_g).to be > 0
122
- end
123
-
124
- it "supports creating an estimate with an order" do
125
- rail_shipping_estimate = Patch::Estimate.create_rail_shipping_estimate(
126
- create_order: true,
127
- destination_locode: "USSEA",
128
- freight_mass_g: 359_000,
129
- origin_locode: "USSD2"
130
- )
131
- expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
132
- expect(rail_shipping_estimate.data.mass_g).to be > 0
133
- expect(rail_shipping_estimate.data.order.amount).to be > 0
134
- end
135
- end
136
-
137
- context "when creating a road shipping estimate" do
138
- it "supports creating an estimate using locodes" do
139
- road_shipping_estimate = Patch::Estimate.create_road_shipping_estimate(
140
- create_order: false,
141
- container_size_code: "20GP",
142
- destination_locode: "USSEA",
143
- emissions_scope: "wtw",
144
- freight_mass_g: 124_870,
145
- origin_locode: "USSD2"
146
- )
147
- expect(road_shipping_estimate.data.type).to eq('shipping_road')
148
- expect(road_shipping_estimate.data.mass_g).to be > 0
149
- end
150
-
151
- it "supports creating an estimate using postal codes" do
152
- road_shipping_estimate = Patch::Estimate.create_road_shipping_estimate(
153
- create_order: false,
154
- destination_country_code: "US",
155
- destination_postal_code: "97209",
156
- emissions_scope: "wtw",
157
- freight_mass_g: 226_000,
158
- origin_country_code: "US",
159
- origin_postal_code: "90210"
160
- )
161
- expect(road_shipping_estimate.data.type).to eq('shipping_road')
162
- expect(road_shipping_estimate.data.mass_g).to be > 0
163
- end
164
-
165
- it "supports creating an estimate with an order" do
166
- road_shipping_estimate = Patch::Estimate.create_road_shipping_estimate(
167
- create_order: true,
168
- destination_locode: "USSEA",
169
- freight_mass_g: 359_000,
170
- origin_locode: "USSD2"
171
- )
172
- expect(road_shipping_estimate.data.type).to eq('shipping_road')
173
- expect(road_shipping_estimate.data.mass_g).to be > 0
174
- expect(road_shipping_estimate.data.order.amount).to be > 0
175
- end
176
- end
177
-
178
- context "when creating a sea shipping estimate" do
179
- it "supports creating an estimate using locodes" do
180
- sea_shipping_estimate = Patch::Estimate.create_sea_shipping_estimate(
181
- create_order: false,
182
- container_size_code: "20GP",
183
- destination_locode: "HKHKG",
184
- emissions_scope: "wtw",
185
- freight_mass_g: 124_870,
186
- origin_locode: "FRMRS"
187
- )
188
- expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
189
- expect(sea_shipping_estimate.data.mass_g).to be > 0
190
- end
191
-
192
- it "supports creating an estimate using postal codes" do
193
- sea_shipping_estimate = Patch::Estimate.create_sea_shipping_estimate(
194
- create_order: false,
195
- destination_country_code: "US",
196
- destination_postal_code: "97209",
197
- emissions_scope: "wtw",
198
- freight_mass_g: 226_000,
199
- origin_country_code: "US",
200
- origin_postal_code: "90210"
201
- )
202
- expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
203
- expect(sea_shipping_estimate.data.mass_g).to be > 0
204
- end
205
-
206
- it "supports creating an estimate with an order" do
207
- sea_shipping_estimate = Patch::Estimate.create_sea_shipping_estimate(
208
- create_order: true,
209
- destination_locode: "USSEA",
210
- freight_mass_g: 359_000,
211
- origin_locode: "USSD2"
212
- )
213
- expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
214
- expect(sea_shipping_estimate.data.mass_g).to be > 0
215
- expect(sea_shipping_estimate.data.order.amount).to be > 0
216
- end
217
- end
218
- end
@@ -1,46 +0,0 @@
1
- =begin
2
- #Patch API V1
3
-
4
- #The core API used to integrate with Patch's service
5
-
6
- The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Patch::CreateMassEstimateRequest
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe 'CreateMassEstimateRequest' do
21
- before do
22
- # run before each test
23
- @instance = build(:create_mass_estimate_request)
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
29
-
30
- it_behaves_like "a generated class" do
31
- let(:instance) { @instance }
32
- let(:instance_hash) { { project_id: @instance.project_id, mass_g: @instance.mass_g, create_order: @instance.create_order } }
33
- let(:nullable_properties) { Set.new([:create_order]) }
34
- end
35
-
36
- describe 'test an instance of CreateMassEstimateRequest' do
37
- it 'should create an instance of CreateMassEstimateRequest' do
38
- expect(@instance).to be_instance_of(Patch::CreateMassEstimateRequest)
39
- end
40
- end
41
- describe 'test attribute "mass_g"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
45
- end
46
- end
@@ -1,64 +0,0 @@
1
- =begin
2
- #Patch API V1
3
-
4
- #The core API used to integrate with Patch's service
5
-
6
- The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
16
-
17
- # Unit tests for Patch::EstimateListResponse
18
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
- # Please update as you see appropriate
20
- describe 'EstimateListResponse' do
21
- before do
22
- # run before each test
23
- @instance = build(:estimate_list_response)
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
29
-
30
- it_behaves_like "a generated class" do
31
- let(:instance) { @instance }
32
- let(:instance_hash) { { success: @instance.success, error: @instance.error, data: @instance.data, meta: @instance.meta } }
33
- let(:nullable_properties) { Set.new([:error]) }
34
- end
35
-
36
- describe 'test an instance of EstimateListResponse' do
37
- it 'should create an instance of EstimateListResponse' do
38
- expect(@instance).to be_instance_of(Patch::EstimateListResponse)
39
- end
40
- end
41
- describe 'test attribute "success"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
45
- end
46
-
47
- describe 'test attribute "error"' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
51
- end
52
-
53
- describe 'test attribute "data"' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
57
- end
58
-
59
- describe 'test attribute "meta"' do
60
- it 'should work' do
61
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
- end
63
- end
64
- end