patch_ruby 1.24.0 → 1.24.1

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: 1a119c788c7b08df5347be280324d01a7f9acf576ef7f727833c32433a53b6ff
4
- data.tar.gz: fb0aac7b2909a12485a97e476ae0e7f3b17a54186b2262f2b8eb1cb8ae1e447c
3
+ metadata.gz: 8151d33b8621b00c4852c6cfa7f26231d222259da797ce9d88ae2555af7b335d
4
+ data.tar.gz: a5e3a388d5c6c3bf39d705f140eabb0f2704404b5d10062fc6abe2f2ef20e6a7
5
5
  SHA512:
6
- metadata.gz: f8185665815ed84680fab0b395845260fd41c2ef86cb288137e106cfef865fda41dce66b259f0773c5464127959cb1ea62ccbf7fd5af162b4dee82a30a97a11a
7
- data.tar.gz: e4afa1e0675073437b34cf4928e909f40958664c6b7646d887bd6b75137510efc25254e79fcdd040755c35147ba680656b1416beaa37a8746b09caafd23775bb
6
+ metadata.gz: c32a8e2fb7bd6960a9adbf29a99628a2f9d5b0ee7f022c50ea0adb744d0a8767d73f33949198a40c3591f00cb3df08d02769e163e9d350443b08d8ccad739696
7
+ data.tar.gz: ca74e3e739f5edca1f4c3afaa0e63849d19e23822955440299be82bf05a07f7ee5d3135d22b99289dbbb903e41c037158a1cb7b7bf46e5e13324f89b21ee7dfb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- patch_ruby (1.24.0)
4
+ patch_ruby (1.24.1)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -47,7 +47,7 @@ module Patch
47
47
  end
48
48
 
49
49
  # Creates a GLEC air shipping estimate given freight mass and logistics
50
- # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
50
+ # Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
51
51
  # @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
52
52
  # @param [Hash] opts the optional parameters
53
53
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -116,7 +116,7 @@ module Patch
116
116
  end
117
117
 
118
118
  # Create a bitcoin estimate given a timestamp and transaction value
119
- # Creates a bitcoin estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
119
+ # Creates a bitcoin estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
120
120
  # @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
121
121
  # @param [Hash] opts the optional parameters
122
122
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -185,7 +185,7 @@ module Patch
185
185
  end
186
186
 
187
187
  # Create an ethereum estimate
188
- # Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
188
+ # Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
189
189
  # @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
190
190
  # @param [Hash] opts the optional parameters
191
191
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -254,7 +254,7 @@ module Patch
254
254
  end
255
255
 
256
256
  # Create a flight estimate given the distance traveled in meters
257
- # Creates a flight estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
257
+ # Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
258
258
  # @param create_flight_estimate_request [CreateFlightEstimateRequest]
259
259
  # @param [Hash] opts the optional parameters
260
260
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -323,7 +323,7 @@ module Patch
323
323
  end
324
324
 
325
325
  # Create a hotel estimate.
326
- # Creates a hotel estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters.
326
+ # Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
327
327
  # @param create_hotel_estimate_request [CreateHotelEstimateRequest]
328
328
  # @param [Hash] opts the optional parameters
329
329
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -392,7 +392,7 @@ module Patch
392
392
  end
393
393
 
394
394
  # Create an estimate based on mass of CO2
395
- # 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.
395
+ # Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate.
396
396
  # @param create_mass_estimate_request [CreateMassEstimateRequest]
397
397
  # @param [Hash] opts the optional parameters
398
398
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -461,7 +461,7 @@ module Patch
461
461
  end
462
462
 
463
463
  # Creates a GLEC rail shipping estimate given freight mass and logistics
464
- # Creates a GLEC rail shipping estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
464
+ # Creates a GLEC rail shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
465
465
  # @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
466
466
  # @param [Hash] opts the optional parameters
467
467
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -530,7 +530,7 @@ module Patch
530
530
  end
531
531
 
532
532
  # Creates a GLEC road shipping estimate given freight mass and logistics
533
- # Creates a GLEC road shipping estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
533
+ # Creates a GLEC road shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
534
534
  # @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
535
535
  # @param [Hash] opts the optional parameters
536
536
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -599,7 +599,7 @@ module Patch
599
599
  end
600
600
 
601
601
  # Creates a GLEC sea shipping estimate given freight mass and logistics
602
- # Creates a GLEC sea shipping estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
602
+ # Creates a GLEC sea shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
603
603
  # @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
604
604
  # @param [Hash] opts the optional parameters
605
605
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -668,7 +668,7 @@ module Patch
668
668
  end
669
669
 
670
670
  # Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
671
- # Creates a shipping estimate for the amount of CO2 to be compensated. An order in the &#x60;draft&#x60; state may be created based on the parameters.
671
+ # Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
672
672
  # @param create_shipping_estimate_request [CreateShippingEstimateRequest]
673
673
  # @param [Hash] opts the optional parameters
674
674
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -737,7 +737,7 @@ module Patch
737
737
  end
738
738
 
739
739
  # Create a vehicle estimate given the distance traveled in meters and the type of vehicle
740
- # Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the &#x60;draft&#x60; state may be created based on the parameters, linked to the estimate.
740
+ # Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate.
741
741
  # @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
742
742
  # @param [Hash] opts the optional parameters
743
743
  # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
@@ -28,18 +28,19 @@ module Patch
28
28
  @api_client = api_client
29
29
  end
30
30
  # Cancel an order
31
- # Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` or `placed` state can be cancelled.
32
- # @param id [String]
31
+ # Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` or `placed` state can be cancelled.
32
+ # @param id [String]
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [OrderResponse]
35
35
  def cancel_order(id, opts = {})
36
+
36
37
  data, _status_code, _headers = cancel_order_with_http_info(id, opts)
37
38
  data
38
39
  end
39
40
 
40
41
  # Cancel an order
41
- # Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the &#x60;draft&#x60; or &#x60;placed&#x60; state can be cancelled.
42
- # @param id [String]
42
+ # Cancelling an order removes the associated offset allocation from an order. You will not be charged for cancelled orders. Only orders in the `draft` or `placed` state can be cancelled.
43
+ # @param id [String]
43
44
  # @param [Hash] opts the optional parameters
44
45
  # @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
45
46
  def cancel_order_with_http_info(id, opts = {})
@@ -91,19 +92,19 @@ module Patch
91
92
  end
92
93
 
93
94
  # Creates an order
94
- # Creates an order in the `placed` or `draft` state.
95
- # @param create_order_request [CreateOrderRequest]
95
+ # Creates an order in the `placed` or `draft` state.
96
+ # @param create_order_request [CreateOrderRequest]
96
97
  # @param [Hash] opts the optional parameters
97
98
  # @return [OrderResponse]
98
99
  def create_order(create_order_request = {}, opts = {})
99
- _create_order_request = Patch::CreateOrderRequest.new(create_order_request)
100
+ _create_order_request = Patch::CreateOrderRequest.new(create_order_request)
100
101
  data, _status_code, _headers = create_order_with_http_info(_create_order_request, opts)
101
102
  data
102
103
  end
103
104
 
104
105
  # Creates an order
105
- # Creates an order in the &#x60;placed&#x60; or &#x60;draft&#x60; state.
106
- # @param create_order_request [CreateOrderRequest]
106
+ # Creates an order in the `placed` or `draft` state.
107
+ # @param create_order_request [CreateOrderRequest]
107
108
  # @param [Hash] opts the optional parameters
108
109
  # @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
109
110
  def create_order_with_http_info(create_order_request, opts = {})
@@ -160,23 +161,22 @@ module Patch
160
161
  end
161
162
 
162
163
  # Place an order
163
- # Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
164
- # @param id [String]
164
+ # Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
165
+ # @param id [String]
165
166
  # @param [Hash] opts the optional parameters
166
- # @option opts [PlaceOrderRequest] :place_order_request
167
+ # @option opts [PlaceOrderRequest] :place_order_request
167
168
  # @return [OrderResponse]
168
- def place_order(order_id, opts = {})
169
- place_order_request = Patch::PlaceOrderRequest.new(opts)
170
- opts[:place_order_request] = place_order_request
171
- data, _status_code, _headers = place_order_with_http_info(order_id, opts)
169
+ def place_order(id, opts = {})
170
+
171
+ data, _status_code, _headers = place_order_with_http_info(id, opts)
172
172
  data
173
173
  end
174
174
 
175
175
  # Place an order
176
- # Placing an order confirms an order&#39;s allocation of offsets. Only orders that are in the &#x60;draft&#x60; state can be placed
177
- # @param id [String]
176
+ # Placing an order confirms an order's allocation of offsets. Only orders that are in the `draft` state can be placed
177
+ # @param id [String]
178
178
  # @param [Hash] opts the optional parameters
179
- # @option opts [PlaceOrderRequest] :place_order_request
179
+ # @option opts [PlaceOrderRequest] :place_order_request
180
180
  # @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
181
181
  def place_order_with_http_info(id, opts = {})
182
182
  if @api_client.config.debugging
@@ -206,7 +206,7 @@ module Patch
206
206
  form_params = opts[:form_params] || {}
207
207
 
208
208
  # http body (model)
209
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'place_order_request'])
209
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts)
210
210
 
211
211
  # return_type
212
212
  return_type = opts[:debug_return_type] || 'OrderResponse'
@@ -232,18 +232,19 @@ module Patch
232
232
  end
233
233
 
234
234
  # Retrieves an order
235
- # Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
236
- # @param id [String]
235
+ # Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
236
+ # @param id [String]
237
237
  # @param [Hash] opts the optional parameters
238
238
  # @return [OrderResponse]
239
239
  def retrieve_order(id, opts = {})
240
+
240
241
  data, _status_code, _headers = retrieve_order_with_http_info(id, opts)
241
242
  data
242
243
  end
243
244
 
244
245
  # Retrieves an order
245
- # Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
246
- # @param id [String]
246
+ # Retrieves a given order and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
247
+ # @param id [String]
247
248
  # @param [Hash] opts the optional parameters
248
249
  # @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
249
250
  def retrieve_order_with_http_info(id, opts = {})
@@ -295,25 +296,26 @@ module Patch
295
296
  end
296
297
 
297
298
  # Retrieves a list of orders
298
- # Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
299
+ # Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
299
300
  # @param [Hash] opts the optional parameters
300
- # @option opts [Integer] :page
301
- # @option opts [String] :metadata
302
- # @option opts [String] :metadata_example1
303
- # @option opts [String] :metadata_example2
301
+ # @option opts [Integer] :page
302
+ # @option opts [String] :metadata
303
+ # @option opts [String] :metadata_example1
304
+ # @option opts [String] :metadata_example2
304
305
  # @return [OrderListResponse]
305
306
  def retrieve_orders(opts = {})
307
+
306
308
  data, _status_code, _headers = retrieve_orders_with_http_info(opts)
307
309
  data
308
310
  end
309
311
 
310
312
  # Retrieves a list of orders
311
- # Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
313
+ # Retrieves a list of orders and its allocation offsets or negative emissions. You can only retrieve orders associated with the organization you are querying for.
312
314
  # @param [Hash] opts the optional parameters
313
- # @option opts [Integer] :page
314
- # @option opts [String] :metadata
315
- # @option opts [String] :metadata_example1
316
- # @option opts [String] :metadata_example2
315
+ # @option opts [Integer] :page
316
+ # @option opts [String] :metadata
317
+ # @option opts [String] :metadata_example1
318
+ # @option opts [String] :metadata_example2
317
319
  # @return [Array<(OrderListResponse, Integer, Hash)>] OrderListResponse data, response status code and response headers
318
320
  def retrieve_orders_with_http_info(opts = {})
319
321
  if @api_client.config.debugging
@@ -37,7 +37,7 @@ module Patch
37
37
  end
38
38
 
39
39
  # Retrieves a project
40
- # Retrieves a project available on Patch&#39;s platform.
40
+ # Retrieves a project available on Patch's platform.
41
41
  # @param id [String]
42
42
  # @param [Hash] opts the optional parameters
43
43
  # @option opts [String] :accept_language
@@ -107,7 +107,7 @@ module Patch
107
107
  end
108
108
 
109
109
  # Retrieves a list of projects
110
- # Retrieves a list of projects available for purchase on Patch&#39;s platform.
110
+ # Retrieves a list of projects available for purchase on Patch's platform.
111
111
  # @param [Hash] opts the optional parameters
112
112
  # @option opts [Integer] :page
113
113
  # @option opts [String] :country
@@ -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.24.0"
34
+ @user_agent = "patch-ruby/1.24.1"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -94,7 +94,7 @@ module Patch
94
94
  :'currency' => :'String',
95
95
  :'amount' => :'Integer',
96
96
  :'unit' => :'String',
97
- :'issued_to' => :'V1OrdersIssuedTo'
97
+ :'issued_to' => :'OrderIssuedTo'
98
98
  }
99
99
  end
100
100
 
@@ -111,7 +111,6 @@ module Patch
111
111
  :'currency',
112
112
  :'amount',
113
113
  :'unit',
114
- :'issued_to'
115
114
  ])
116
115
  end
117
116
 
@@ -66,6 +66,7 @@ module Patch
66
66
  # An array containing the inventory allocated for this order. Inventory is grouped by project, vintage year, and price.
67
67
  attr_accessor :inventory
68
68
 
69
+ # An object containing the name & email of the party the inventory will be issued to.
69
70
  attr_accessor :issued_to
70
71
 
71
72
  class EnumAttributeValidator
@@ -139,7 +140,7 @@ module Patch
139
140
  :'registry_url' => :'String',
140
141
  :'metadata' => :'Object',
141
142
  :'inventory' => :'Array<OrderInventory>',
142
- :'issued_to' => :'IssuedTo'
143
+ :'issued_to' => :'OrderIssuedTo'
143
144
  }
144
145
  end
145
146
 
@@ -251,6 +252,9 @@ module Patch
251
252
  end
252
253
 
253
254
  if attributes.key?(:'issued_to')
255
+ if (value = attributes[:'issued_to']).is_a?(Hash)
256
+ self.issued_to = value
257
+ end
254
258
  self.issued_to = attributes[:'issued_to']
255
259
  end
256
260
  end
@@ -15,11 +15,11 @@ require 'time'
15
15
 
16
16
  module Patch
17
17
  # An object containing the name & email of the party the inventory will be issued to.
18
- class IssuedTo
19
- # Name provided for the issuee
18
+ class OrderIssuedTo
19
+ # The name of the issuee
20
20
  attr_accessor :name
21
21
 
22
- # Email address provided for the issuee
22
+ # The email address of the issuee
23
23
  attr_accessor :email
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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::IssuedTosApi::OPERATIONS') && Patch::IssuedTosApi::OPERATIONS.include?(message)
60
- Patch::IssuedTosApi.new.send(message, *args)
59
+ if Object.const_defined?('Patch::OrderIssuedTosApi::OPERATIONS') && Patch::OrderIssuedTosApi::OPERATIONS.include?(message)
60
+ Patch::OrderIssuedTosApi.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::IssuedTo` initialize method"
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::OrderIssuedTo` 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::IssuedTo`. 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::OrderIssuedTo`. 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
  }
@@ -32,14 +32,13 @@ module Patch
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'issued_to' => :'V1OrdersIssuedTo'
35
+ :'issued_to' => :'OrderIssuedTo'
36
36
  }
37
37
  end
38
38
 
39
39
  # List of attributes with nullable: true
40
40
  def self.openapi_nullable
41
41
  Set.new([
42
- :'issued_to'
43
42
  ])
44
43
  end
45
44
 
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.3.1
11
11
  =end
12
12
 
13
13
  module Patch
14
- VERSION = '1.24.0'
14
+ VERSION = '1.24.1'
15
15
  end
data/lib/patch_ruby.rb CHANGED
@@ -37,11 +37,11 @@ require 'patch_ruby/models/estimate_list_response'
37
37
  require 'patch_ruby/models/estimate_response'
38
38
  require 'patch_ruby/models/highlight'
39
39
  require 'patch_ruby/models/inventory'
40
- require 'patch_ruby/models/issued_to'
41
40
  require 'patch_ruby/models/meta_index_object'
42
41
  require 'patch_ruby/models/order'
43
42
  require 'patch_ruby/models/order_inventory'
44
43
  require 'patch_ruby/models/order_inventory_project'
44
+ require 'patch_ruby/models/order_issued_to'
45
45
  require 'patch_ruby/models/order_list_response'
46
46
  require 'patch_ruby/models/order_response'
47
47
  require 'patch_ruby/models/parent_technology_type'
@@ -54,7 +54,6 @@ require 'patch_ruby/models/sdg'
54
54
  require 'patch_ruby/models/standard'
55
55
  require 'patch_ruby/models/technology_type'
56
56
  require 'patch_ruby/models/technology_type_list_response'
57
- require 'patch_ruby/models/v1_orders_issued_to'
58
57
 
59
58
  # APIs
60
59
  require 'patch_ruby/api/estimates_api'
@@ -31,7 +31,7 @@ describe 'CreateOrderRequest' do
31
31
  let(:instance) { @instance }
32
32
  let(:instance_hash) { { project_id: @instance.project_id, mass_g: @instance.mass_g, total_price_cents_usd: @instance.total_price_cents_usd, metadata: @instance.metadata } }
33
33
  let(:nullable_properties) do
34
- Set.new(%i[mass_g total_price_cents_usd project_id metadata state vintage_year total_price currency amount unit issued_to])
34
+ Set.new(%i[mass_g total_price_cents_usd project_id metadata state vintage_year total_price currency amount unit])
35
35
  end
36
36
  end
37
37
 
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.24.0
4
+ version: 1.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patch Technology
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-28 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -120,11 +120,11 @@ files:
120
120
  - lib/patch_ruby/models/estimate_response.rb
121
121
  - lib/patch_ruby/models/highlight.rb
122
122
  - lib/patch_ruby/models/inventory.rb
123
- - lib/patch_ruby/models/issued_to.rb
124
123
  - lib/patch_ruby/models/meta_index_object.rb
125
124
  - lib/patch_ruby/models/order.rb
126
125
  - lib/patch_ruby/models/order_inventory.rb
127
126
  - lib/patch_ruby/models/order_inventory_project.rb
127
+ - lib/patch_ruby/models/order_issued_to.rb
128
128
  - lib/patch_ruby/models/order_list_response.rb
129
129
  - lib/patch_ruby/models/order_response.rb
130
130
  - lib/patch_ruby/models/parent_technology_type.rb
@@ -137,7 +137,6 @@ files:
137
137
  - lib/patch_ruby/models/standard.rb
138
138
  - lib/patch_ruby/models/technology_type.rb
139
139
  - lib/patch_ruby/models/technology_type_list_response.rb
140
- - lib/patch_ruby/models/v1_orders_issued_to.rb
141
140
  - lib/patch_ruby/version.rb
142
141
  - patch_ruby.gemspec
143
142
  - spec/api/estimates_api_spec.rb
@@ -1,239 +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: 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 V1OrdersIssuedTo
18
- attr_accessor :email
19
-
20
- attr_accessor :name
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'email' => :'email',
26
- :'name' => :'name'
27
- }
28
- end
29
-
30
- # Returns all the JSON keys this model knows about
31
- def self.acceptable_attributes
32
- attribute_map.values
33
- end
34
-
35
- # Attribute type mapping.
36
- def self.openapi_types
37
- {
38
- :'email' => :'String',
39
- :'name' => :'String'
40
- }
41
- end
42
-
43
- # List of attributes with nullable: true
44
- def self.openapi_nullable
45
- Set.new([
46
- :'email',
47
- :'name'
48
- ])
49
- end
50
-
51
-
52
- # Allows models with corresponding API classes to delegate API operations to those API classes
53
- # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
54
- # Eg. Order.create_order delegates to OrdersApi.new.create_order
55
- def self.method_missing(message, *args, &block)
56
- if Object.const_defined?('Patch::V1OrdersIssuedTosApi::OPERATIONS') && Patch::V1OrdersIssuedTosApi::OPERATIONS.include?(message)
57
- Patch::V1OrdersIssuedTosApi.new.send(message, *args)
58
- else
59
- super
60
- end
61
- end
62
-
63
- # Initializes the object
64
- # @param [Hash] attributes Model attributes in the form of hash
65
- def initialize(attributes = {})
66
- if (!attributes.is_a?(Hash))
67
- fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::V1OrdersIssuedTo` initialize method"
68
- end
69
-
70
- # check to see if the attribute exists and convert string to symbol for hash key
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!self.class.attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::V1OrdersIssuedTo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'email')
79
- self.email = attributes[:'email']
80
- end
81
-
82
- if attributes.key?(:'name')
83
- self.name = attributes[:'name']
84
- end
85
- end
86
-
87
- # Show invalid properties with the reasons. Usually used together with valid?
88
- # @return Array for valid properties with the reasons
89
- def list_invalid_properties
90
- invalid_properties = Array.new
91
- invalid_properties
92
- end
93
-
94
- # Check to see if the all the properties in the model are valid
95
- # @return true if the model is valid
96
- def valid?
97
- true
98
- end
99
-
100
- # Checks equality by comparing each attribute.
101
- # @param [Object] Object to be compared
102
- def ==(o)
103
- return true if self.equal?(o)
104
- self.class == o.class &&
105
- email == o.email &&
106
- name == o.name
107
- end
108
-
109
- # @see the `==` method
110
- # @param [Object] Object to be compared
111
- def eql?(o)
112
- self == o
113
- end
114
-
115
- # Calculates hash code according to all attributes.
116
- # @return [Integer] Hash code
117
- def hash
118
- [email, name].hash
119
- end
120
-
121
- # Builds the object from hash
122
- # @param [Hash] attributes Model attributes in the form of hash
123
- # @return [Object] Returns the model itself
124
- def self.build_from_hash(attributes)
125
- new.build_from_hash(attributes)
126
- end
127
-
128
- # Builds the object from hash
129
- # @param [Hash] attributes Model attributes in the form of hash
130
- # @return [Object] Returns the model itself
131
- def build_from_hash(attributes)
132
- return nil unless attributes.is_a?(Hash)
133
- self.class.openapi_types.each_pair do |key, type|
134
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
135
- self.send("#{key}=", nil)
136
- elsif type =~ /\AArray<(.*)>/i
137
- # check to ensure the input is an array given that the attribute
138
- # is documented as an array but the input is not
139
- if attributes[self.class.attribute_map[key]].is_a?(Array)
140
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
- end
142
- elsif !attributes[self.class.attribute_map[key]].nil?
143
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
- end
145
- end
146
-
147
- self
148
- end
149
-
150
- # Deserializes the data based on type
151
- # @param string type Data type
152
- # @param string value Value to be deserialized
153
- # @return [Object] Deserialized data
154
- def _deserialize(type, value)
155
- case type.to_sym
156
- when :Time
157
- Time.parse(value)
158
- when :Date
159
- Date.parse(value)
160
- when :String
161
- value.to_s
162
- when :Integer
163
- value.to_i
164
- when :Float
165
- value.to_f
166
- when :Boolean
167
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
- true
169
- else
170
- false
171
- end
172
- when :Object
173
- # generic object (usually a Hash), return directly
174
- value
175
- when /\AArray<(?<inner_type>.+)>\z/
176
- inner_type = Regexp.last_match[:inner_type]
177
- value.map { |v| _deserialize(inner_type, v) }
178
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
- k_type = Regexp.last_match[:k_type]
180
- v_type = Regexp.last_match[:v_type]
181
- {}.tap do |hash|
182
- value.each do |k, v|
183
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
- end
185
- end
186
- else # model
187
- # models (e.g. Pet) or oneOf
188
- klass = Patch.const_get(type)
189
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
- end
191
- end
192
-
193
- # Returns the string representation of the object
194
- # @return [String] String presentation of the object
195
- def to_s
196
- to_hash.to_s
197
- end
198
-
199
- # to_body is an alias to to_hash (backward compatibility)
200
- # @return [Hash] Returns the object in the form of hash
201
- def to_body
202
- to_hash
203
- end
204
-
205
- # Returns the object in the form of hash
206
- # @return [Hash] Returns the object in the form of hash
207
- def to_hash
208
- hash = {}
209
- self.class.attribute_map.each_pair do |attr, param|
210
- value = self.send(attr)
211
- if value.nil?
212
- is_nullable = self.class.openapi_nullable.include?(attr)
213
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
- end
215
-
216
- hash[param] = _to_hash(value)
217
- end
218
- hash
219
- end
220
-
221
- # Outputs non-array value in the form of hash
222
- # For object, use to_hash. Otherwise, just return the value
223
- # @param [Object] value Any valid value
224
- # @return [Hash] Returns the value in the form of hash
225
- def _to_hash(value)
226
- if value.is_a?(Array)
227
- value.compact.map { |v| _to_hash(v) }
228
- elsif value.is_a?(Hash)
229
- {}.tap do |hash|
230
- value.each { |k, v| hash[k] = _to_hash(v) }
231
- end
232
- elsif value.respond_to? :to_hash
233
- value.to_hash
234
- else
235
- value
236
- end
237
- end
238
- end
239
- end