patch_ruby 1.14.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Gemfile.lock +3 -2
  4. data/README.md +11 -12
  5. data/lib/patch_ruby/api/estimates_api.rb +1 -1
  6. data/lib/patch_ruby/api/orders_api.rb +1 -1
  7. data/lib/patch_ruby/api/projects_api.rb +1 -1
  8. data/lib/patch_ruby/api/technology_types_api.rb +84 -0
  9. data/lib/patch_ruby/api_client.rb +2 -2
  10. data/lib/patch_ruby/api_error.rb +1 -1
  11. data/lib/patch_ruby/configuration.rb +4 -4
  12. data/lib/patch_ruby/models/allocation.rb +1 -1
  13. data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +1 -1
  14. data/lib/patch_ruby/models/create_ethereum_estimate_request.rb +1 -1
  15. data/lib/patch_ruby/models/create_flight_estimate_request.rb +1 -1
  16. data/lib/patch_ruby/models/create_mass_estimate_request.rb +6 -6
  17. data/lib/patch_ruby/models/create_order_request.rb +6 -6
  18. data/lib/patch_ruby/models/create_shipping_estimate_request.rb +1 -1
  19. data/lib/patch_ruby/models/create_success_response.rb +1 -1
  20. data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +1 -1
  21. data/lib/patch_ruby/models/error_response.rb +1 -1
  22. data/lib/patch_ruby/models/estimate.rb +1 -1
  23. data/lib/patch_ruby/models/estimate_list_response.rb +1 -1
  24. data/lib/patch_ruby/models/estimate_response.rb +1 -1
  25. data/lib/patch_ruby/models/{create_preference_request.rb → highlight.rb} +47 -16
  26. data/lib/patch_ruby/models/meta_index_object.rb +1 -1
  27. data/lib/patch_ruby/models/order.rb +7 -7
  28. data/lib/patch_ruby/models/order_list_response.rb +1 -1
  29. data/lib/patch_ruby/models/order_response.rb +1 -1
  30. data/lib/patch_ruby/models/parent_technology_type.rb +2 -1
  31. data/lib/patch_ruby/models/photo.rb +1 -1
  32. data/lib/patch_ruby/models/project.rb +44 -25
  33. data/lib/patch_ruby/models/project_list_response.rb +1 -1
  34. data/lib/patch_ruby/models/project_response.rb +1 -1
  35. data/lib/patch_ruby/models/sdg.rb +1 -1
  36. data/lib/patch_ruby/models/standard.rb +1 -1
  37. data/lib/patch_ruby/models/technology_type.rb +13 -2
  38. data/lib/patch_ruby/models/{preference_response.rb → technology_type_list_response.rb} +10 -8
  39. data/lib/patch_ruby/version.rb +2 -2
  40. data/lib/patch_ruby.rb +4 -6
  41. data/patch_ruby.gemspec +1 -1
  42. data/spec/api/technology_types_api_spec.rb +46 -0
  43. data/spec/api_client_spec.rb +1 -1
  44. data/spec/configuration_spec.rb +1 -1
  45. data/spec/integration/orders_spec.rb +1 -3
  46. data/spec/integration/projects/technology_types_spec.rb +14 -0
  47. data/spec/integration/projects_spec.rb +2 -1
  48. data/spec/models/project_spec.rb +1 -1
  49. data/spec/spec_helper.rb +1 -1
  50. metadata +30 -47
  51. data/lib/patch_ruby/models/preference.rb +0 -264
  52. data/lib/patch_ruby/models/preference_list_response.rb +0 -273
  53. data/spec/api/preferences_api_spec.rb +0 -82
  54. data/spec/factories/create_preference_requests.rb +0 -5
  55. data/spec/factories/preference_list_responses.rb +0 -8
  56. data/spec/factories/preference_responses.rb +0 -7
  57. data/spec/factories/preferences.rb +0 -7
  58. data/spec/integration/preferences_spec.rb +0 -32
  59. data/spec/models/create_preference_request_spec.rb +0 -47
  60. data/spec/models/preference_list_response_spec.rb +0 -64
  61. data/spec/models/preference_response_spec.rb +0 -58
  62. data/spec/models/preference_spec.rb +0 -58
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -30,7 +30,7 @@ module Patch
30
30
  # The current state of the order.
31
31
  attr_accessor :state
32
32
 
33
- # The current state of the allocated carbon offsets of the order.
33
+ # DEPRECATED. Indicates if the order has been fully allocated to projects.
34
34
  attr_accessor :allocation_state
35
35
 
36
36
  # The total price in cents USD of the carbon offsets purchased through this order.
@@ -203,8 +203,8 @@ module Patch
203
203
  invalid_properties.push('invalid value for "mass_g", mass_g cannot be nil.')
204
204
  end
205
205
 
206
- if @mass_g > 2000000000
207
- invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 2000000000.')
206
+ if @mass_g > 100000000000
207
+ invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 100000000000.')
208
208
  end
209
209
 
210
210
  if @mass_g < 0
@@ -239,7 +239,7 @@ module Patch
239
239
  def valid?
240
240
  return false if @id.nil?
241
241
  return false if @mass_g.nil?
242
- return false if @mass_g > 2000000000
242
+ return false if @mass_g > 100000000000
243
243
  return false if @mass_g < 0
244
244
  return false if @production.nil?
245
245
  return false if @state.nil?
@@ -260,8 +260,8 @@ module Patch
260
260
  fail ArgumentError, 'mass_g cannot be nil'
261
261
  end
262
262
 
263
- if mass_g > 2000000000
264
- fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
263
+ if mass_g > 100000000000
264
+ fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 100000000000.'
265
265
  end
266
266
 
267
267
  if mass_g < 0
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Patch
17
+ # An object containing the parent technology type's name and slug.
17
18
  class ParentTechnologyType
18
19
  # Unique identifier for this type of technology.
19
20
  attr_accessor :slug
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -27,10 +27,10 @@ module Patch
27
27
  # The description of the project.
28
28
  attr_accessor :description
29
29
 
30
- # The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Renewables, Soil.
30
+ # Deprecated. Favor the technology_type field instead.
31
31
  attr_accessor :type
32
32
 
33
- # The mechanism of the project. removal or avoidance.
33
+ # The mechanism of the project. Either removal or avoidance.
34
34
  attr_accessor :mechanism
35
35
 
36
36
  # The country of origin of the project.
@@ -57,16 +57,22 @@ module Patch
57
57
  # The remaining mass in grams available for purchase for this project.
58
58
  attr_accessor :remaining_mass_g
59
59
 
60
- # An object returning the Standard associated with this project.
60
+ # The name of the project verifier, when applicable. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project.
61
+ attr_accessor :verifier
62
+
63
+ # An object returning the Standard associated with this project, when applicable. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents.
61
64
  attr_accessor :standard
62
65
 
63
66
  # An array returning the UN Sustainable Development Goals associated with this project.
64
67
  attr_accessor :sdgs
65
68
 
69
+ # A short description of the project.
70
+ attr_accessor :tagline
71
+
66
72
  attr_accessor :technology_type
67
73
 
68
- # A short description of the project
69
- attr_accessor :tagline
74
+ # An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project.
75
+ attr_accessor :highlights
70
76
 
71
77
  class EnumAttributeValidator
72
78
  attr_reader :datatype
@@ -107,10 +113,12 @@ module Patch
107
113
  :'photos' => :'photos',
108
114
  :'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd',
109
115
  :'remaining_mass_g' => :'remaining_mass_g',
116
+ :'verifier' => :'verifier',
110
117
  :'standard' => :'standard',
111
118
  :'sdgs' => :'sdgs',
119
+ :'tagline' => :'tagline',
112
120
  :'technology_type' => :'technology_type',
113
- :'tagline' => :'tagline'
121
+ :'highlights' => :'highlights'
114
122
  }
115
123
  end
116
124
 
@@ -136,10 +144,12 @@ module Patch
136
144
  :'photos' => :'Array<Photo>',
137
145
  :'average_price_per_tonne_cents_usd' => :'Integer',
138
146
  :'remaining_mass_g' => :'Integer',
147
+ :'verifier' => :'String',
139
148
  :'standard' => :'Standard',
140
149
  :'sdgs' => :'Array<Sdg>',
150
+ :'tagline' => :'String',
141
151
  :'technology_type' => :'TechnologyType',
142
- :'tagline' => :'String'
152
+ :'highlights' => :'Array<Highlight>'
143
153
  }
144
154
  end
145
155
 
@@ -152,7 +162,6 @@ module Patch
152
162
  :'photos',
153
163
  :'standard',
154
164
  :'sdgs',
155
- :'tagline'
156
165
  ])
157
166
  end
158
167
 
@@ -241,6 +250,10 @@ module Patch
241
250
  self.remaining_mass_g = attributes[:'remaining_mass_g']
242
251
  end
243
252
 
253
+ if attributes.key?(:'verifier')
254
+ self.verifier = attributes[:'verifier']
255
+ end
256
+
244
257
  if attributes.key?(:'standard')
245
258
  self.standard = attributes[:'standard']
246
259
  end
@@ -251,12 +264,18 @@ module Patch
251
264
  end
252
265
  end
253
266
 
267
+ if attributes.key?(:'tagline')
268
+ self.tagline = attributes[:'tagline']
269
+ end
270
+
254
271
  if attributes.key?(:'technology_type')
255
272
  self.technology_type = attributes[:'technology_type']
256
273
  end
257
274
 
258
- if attributes.key?(:'tagline')
259
- self.tagline = attributes[:'tagline']
275
+ if attributes.key?(:'highlights')
276
+ if (value = attributes[:'highlights']).is_a?(Array)
277
+ self.highlights = value
278
+ end
260
279
  end
261
280
  end
262
281
 
@@ -296,6 +315,14 @@ module Patch
296
315
  invalid_properties.push('invalid value for "remaining_mass_g", remaining_mass_g cannot be nil.')
297
316
  end
298
317
 
318
+ if @technology_type.nil?
319
+ invalid_properties.push('invalid value for "technology_type", technology_type cannot be nil.')
320
+ end
321
+
322
+ if @highlights.nil?
323
+ invalid_properties.push('invalid value for "highlights", highlights cannot be nil.')
324
+ end
325
+
299
326
  invalid_properties
300
327
  end
301
328
 
@@ -306,27 +333,17 @@ module Patch
306
333
  return false if @production.nil?
307
334
  return false if @name.nil?
308
335
  return false if @description.nil?
309
- type_validator = EnumAttributeValidator.new('String', ["biomass", "dac", "forestry", "mineralization", "ocean", "renewables", "soil"])
310
- return false unless type_validator.valid?(@type)
311
336
  mechanism_validator = EnumAttributeValidator.new('String', ["removal", "avoidance"])
312
337
  return false unless mechanism_validator.valid?(@mechanism)
313
338
  return false if @country.nil?
314
339
  return false if @developer.nil?
315
340
  return false if @average_price_per_tonne_cents_usd.nil?
316
341
  return false if @remaining_mass_g.nil?
342
+ return false if @technology_type.nil?
343
+ return false if @highlights.nil?
317
344
  true
318
345
  end
319
346
 
320
- # Custom attribute writer method checking allowed values (enum).
321
- # @param [Object] type Object to be assigned
322
- def type=(type)
323
- validator = EnumAttributeValidator.new('String', ["biomass", "dac", "forestry", "mineralization", "ocean", "renewables", "soil"])
324
- unless validator.valid?(type)
325
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
326
- end
327
- @type = type
328
- end
329
-
330
347
  # Custom attribute writer method checking allowed values (enum).
331
348
  # @param [Object] mechanism Object to be assigned
332
349
  def mechanism=(mechanism)
@@ -356,10 +373,12 @@ module Patch
356
373
  photos == o.photos &&
357
374
  average_price_per_tonne_cents_usd == o.average_price_per_tonne_cents_usd &&
358
375
  remaining_mass_g == o.remaining_mass_g &&
376
+ verifier == o.verifier &&
359
377
  standard == o.standard &&
360
378
  sdgs == o.sdgs &&
379
+ tagline == o.tagline &&
361
380
  technology_type == o.technology_type &&
362
- tagline == o.tagline
381
+ highlights == o.highlights
363
382
  end
364
383
 
365
384
  # @see the `==` method
@@ -371,7 +390,7 @@ module Patch
371
390
  # Calculates hash code according to all attributes.
372
391
  # @return [Integer] Hash code
373
392
  def hash
374
- [id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs, technology_type, tagline].hash
393
+ [id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, verifier, standard, sdgs, tagline, technology_type, highlights].hash
375
394
  end
376
395
 
377
396
  # Builds the object from hash
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -14,11 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Patch
17
+ # An object containing the technology type's name, slug and parent_technology_type.
17
18
  class TechnologyType
18
19
  # Unique identifier for this type of technology.
19
20
  attr_accessor :slug
20
21
 
21
- # Name of this technology type.
22
+ # Display name of this technology type.
22
23
  attr_accessor :name
23
24
 
24
25
  attr_accessor :parent_technology_type
@@ -96,12 +97,22 @@ module Patch
96
97
  # @return Array for valid properties with the reasons
97
98
  def list_invalid_properties
98
99
  invalid_properties = Array.new
100
+ if @slug.nil?
101
+ invalid_properties.push('invalid value for "slug", slug cannot be nil.')
102
+ end
103
+
104
+ if @name.nil?
105
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
106
+ end
107
+
99
108
  invalid_properties
100
109
  end
101
110
 
102
111
  # Check to see if the all the properties in the model are valid
103
112
  # @return true if the model is valid
104
113
  def valid?
114
+ return false if @slug.nil?
115
+ return false if @name.nil?
105
116
  true
106
117
  end
107
118
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Patch
17
- class PreferenceResponse
17
+ class TechnologyTypeListResponse
18
18
  attr_accessor :success
19
19
 
20
20
  attr_accessor :error
@@ -40,7 +40,7 @@ module Patch
40
40
  {
41
41
  :'success' => :'Boolean',
42
42
  :'error' => :'Object',
43
- :'data' => :'Preference'
43
+ :'data' => :'Array<TechnologyType>'
44
44
  }
45
45
  end
46
46
 
@@ -56,8 +56,8 @@ module Patch
56
56
  # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
57
57
  # Eg. Order.create_order delegates to OrdersApi.new.create_order
58
58
  def self.method_missing(message, *args, &block)
59
- if Object.const_defined?('Patch::PreferenceResponsesApi::OPERATIONS') && Patch::PreferenceResponsesApi::OPERATIONS.include?(message)
60
- Patch::PreferenceResponsesApi.new.send(message, *args)
59
+ if Object.const_defined?('Patch::TechnologyTypeListResponsesApi::OPERATIONS') && Patch::TechnologyTypeListResponsesApi::OPERATIONS.include?(message)
60
+ Patch::TechnologyTypeListResponsesApi.new.send(message, *args)
61
61
  else
62
62
  super
63
63
  end
@@ -67,13 +67,13 @@ module Patch
67
67
  # @param [Hash] attributes Model attributes in the form of hash
68
68
  def initialize(attributes = {})
69
69
  if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::PreferenceResponse` initialize method"
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::TechnologyTypeListResponse` initialize method"
71
71
  end
72
72
 
73
73
  # check to see if the attribute exists and convert string to symbol for hash key
74
74
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
75
  if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::PreferenceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::TechnologyTypeListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
77
  end
78
78
  h[k.to_sym] = v
79
79
  }
@@ -87,7 +87,9 @@ module Patch
87
87
  end
88
88
 
89
89
  if attributes.key?(:'data')
90
- self.data = attributes[:'data']
90
+ if (value = attributes[:'data']).is_a?(Array)
91
+ self.data = value
92
+ end
91
93
  end
92
94
  end
93
95
 
@@ -4,12 +4,12 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
11
11
  =end
12
12
 
13
13
  module Patch
14
- VERSION = '1.14.0'
14
+ VERSION = '1.16.0'
15
15
  end
data/lib/patch_ruby.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -23,7 +23,6 @@ require 'patch_ruby/models/create_ethereum_estimate_request'
23
23
  require 'patch_ruby/models/create_flight_estimate_request'
24
24
  require 'patch_ruby/models/create_mass_estimate_request'
25
25
  require 'patch_ruby/models/create_order_request'
26
- require 'patch_ruby/models/create_preference_request'
27
26
  require 'patch_ruby/models/create_shipping_estimate_request'
28
27
  require 'patch_ruby/models/create_success_response'
29
28
  require 'patch_ruby/models/create_vehicle_estimate_request'
@@ -31,27 +30,26 @@ require 'patch_ruby/models/error_response'
31
30
  require 'patch_ruby/models/estimate'
32
31
  require 'patch_ruby/models/estimate_list_response'
33
32
  require 'patch_ruby/models/estimate_response'
33
+ require 'patch_ruby/models/highlight'
34
34
  require 'patch_ruby/models/meta_index_object'
35
35
  require 'patch_ruby/models/order'
36
36
  require 'patch_ruby/models/order_list_response'
37
37
  require 'patch_ruby/models/order_response'
38
38
  require 'patch_ruby/models/parent_technology_type'
39
39
  require 'patch_ruby/models/photo'
40
- require 'patch_ruby/models/preference'
41
- require 'patch_ruby/models/preference_list_response'
42
- require 'patch_ruby/models/preference_response'
43
40
  require 'patch_ruby/models/project'
44
41
  require 'patch_ruby/models/project_list_response'
45
42
  require 'patch_ruby/models/project_response'
46
43
  require 'patch_ruby/models/sdg'
47
44
  require 'patch_ruby/models/standard'
48
45
  require 'patch_ruby/models/technology_type'
46
+ require 'patch_ruby/models/technology_type_list_response'
49
47
 
50
48
  # APIs
51
49
  require 'patch_ruby/api/estimates_api'
52
50
  require 'patch_ruby/api/orders_api'
53
- require 'patch_ruby/api/preferences_api'
54
51
  require 'patch_ruby/api/projects_api'
52
+ require 'patch_ruby/api/technology_types_api'
55
53
 
56
54
  module Patch
57
55
  class << self
data/patch_ruby.gemspec CHANGED
@@ -6,7 +6,7 @@
6
6
  #The core API used to integrate with Patch's service
7
7
 
8
8
  The version of the OpenAPI document: v1
9
- Contact: developers@usepatch.com
9
+ Contact: engineering@usepatch.com
10
10
  Generated by: https://openapi-generator.tech
11
11
  OpenAPI Generator version: 5.2.1
12
12
 
@@ -0,0 +1,46 @@
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: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Patch::TechnologyTypesApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'TechnologyTypesApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = Patch::TechnologyTypesApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of TechnologyTypesApi' do
30
+ it 'should create an instance of TechnologyTypesApi' do
31
+ expect(@api_instance).to be_instance_of(Patch::TechnologyTypesApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for retrieve_technology_types
36
+ # Retrieves the list of technology_types
37
+ # Retrieves a list of all technology_types.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [TechnologyTypeListResponse]
40
+ describe 'retrieve_technology_types test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ end
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -30,8 +30,6 @@ RSpec.describe 'Orders Integration' do
30
30
  order_mass_g = 100_000
31
31
  tonne_per_gram = 1_000_000
32
32
 
33
- expected_price = (average_price_per_tonne_cents_usd.to_f / tonne_per_gram) * order_mass_g
34
-
35
33
  create_order_response = Patch::Order.create_order(mass_g: order_mass_g, project_id: project_id)
36
34
 
37
35
  order = create_order_response.data
@@ -39,7 +37,7 @@ RSpec.describe 'Orders Integration' do
39
37
  expect(order.id).not_to be_nil
40
38
  expect(order.created_at).to be_a_kind_of(Time)
41
39
  expect(order.mass_g).to eq(order_mass_g)
42
- expect(order.price_cents_usd).to be_between(expected_price - 2, expected_price + 2)
40
+ expect(order.price_cents_usd).to be_kind_of(Integer)
43
41
  expect(order.patch_fee_cents_usd).to be_kind_of(Integer)
44
42
  expect(order.registry_url).not_to be_empty
45
43
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe "Projects TechnologyTypes Integration" do
4
+ it "returns a list of technology types and their parent types" do
5
+ technology_types = Patch::TechnologyType.retrieve_technology_types()
6
+ expect(technology_types.data.count).to be_positive
7
+ expect(technology_types.data.first.slug).to be_a(String)
8
+ expect(technology_types.data.first.name).to be_a(String)
9
+
10
+ parent = technology_types.data.first.parent_technology_type
11
+ expect(parent.slug).to be_a(String)
12
+ expect(parent.name).to be_a(String)
13
+ end
14
+ end
@@ -49,7 +49,6 @@ RSpec.describe 'Projects Integration' do
49
49
  expect(project.average_price_per_tonne_cents_usd)
50
50
  .to be_an_instance_of(Integer)
51
51
  expect(project.remaining_mass_g).to be_an_instance_of(Integer)
52
- expect(project.state).to be_an_instance_of(String)
53
52
  expect(project.longitude).to be_an_instance_of(Float)
54
53
  expect(project.latitude).to be_an_instance_of(Float)
55
54
 
@@ -62,6 +61,8 @@ RSpec.describe 'Projects Integration' do
62
61
  expect(parent_type).to be_an_instance_of(Patch::ParentTechnologyType)
63
62
  expect(parent_type.name).to be_an_instance_of(String)
64
63
  expect(parent_type.slug).to be_an_instance_of(String)
64
+
65
+ expect(project.highlights).to be_an_instance_of(Array)
65
66
  end
66
67
  end
67
68
  end
@@ -51,7 +51,7 @@ describe 'Project' do
51
51
  }
52
52
  }
53
53
  let(:nullable_properties) do
54
- Set.new(%i[photos standard sdgs state latitude longitude tagline])
54
+ Set.new(%i[photos standard sdgs state latitude longitude])
55
55
  end
56
56
  end
57
57
 
data/spec/spec_helper.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10