dear-inventory-ruby 0.2.2 → 0.2.5

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.
@@ -543,7 +543,7 @@ module DearInventoryRuby
543
543
  # @param webhook [Webhook] a webhook object with properties to create
544
544
  # @param [Hash] opts the optional parameters
545
545
  # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
546
- # @return [Webhooks]
546
+ # @return [Webhook]
547
547
  def create_webhook(webhook, opts = {})
548
548
  data, _status_code, _headers = create_webhook_with_http_info(webhook, opts)
549
549
  data
@@ -553,7 +553,7 @@ module DearInventoryRuby
553
553
  # @param webhook [Webhook] a webhook object with properties to create
554
554
  # @param [Hash] opts the optional parameters
555
555
  # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
556
- # @return [Array<(Webhooks, Integer, Hash)>] Webhooks data, response status code and response headers
556
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
557
557
  def create_webhook_with_http_info(webhook, opts = {})
558
558
  if @api_client.config.debugging
559
559
  @api_client.config.logger.debug 'Calling API: InventoryApi.create_webhook ...'
@@ -583,7 +583,7 @@ module DearInventoryRuby
583
583
  post_body = opts[:body] || @api_client.object_to_http_body(webhook)
584
584
 
585
585
  # return_type
586
- return_type = opts[:return_type] || 'Webhooks'
586
+ return_type = opts[:return_type] || 'Webhook'
587
587
 
588
588
  # auth_names
589
589
  auth_names = opts[:auth_names] || ['accountID', 'appKey']
@@ -1222,6 +1222,72 @@ module DearInventoryRuby
1222
1222
  return data, status_code, headers
1223
1223
  end
1224
1224
 
1225
+ # Allows you to retrieve the Sale
1226
+ # @param [Hash] opts the optional parameters
1227
+ # @option opts [String] :id Default is nil
1228
+ # @option opts [Boolean] :combine_additional_charges Show additional charges in &#39;Lines&#39; array (default to false)
1229
+ # @option opts [Boolean] :hide_inventory_movements Hide inventory movements (Default &#x3D; false) (default to false)
1230
+ # @option opts [Boolean] :include_transactions Show related transactions (Default &#x3D; false) (default to false)
1231
+ # @return [Sale]
1232
+ def get_sale(opts = {})
1233
+ data, _status_code, _headers = get_sale_with_http_info(opts)
1234
+ data
1235
+ end
1236
+
1237
+ # Allows you to retrieve the Sale
1238
+ # @param [Hash] opts the optional parameters
1239
+ # @option opts [String] :id Default is nil
1240
+ # @option opts [Boolean] :combine_additional_charges Show additional charges in &#39;Lines&#39; array
1241
+ # @option opts [Boolean] :hide_inventory_movements Hide inventory movements (Default &#x3D; false)
1242
+ # @option opts [Boolean] :include_transactions Show related transactions (Default &#x3D; false)
1243
+ # @return [Array<(Sale, Integer, Hash)>] Sale data, response status code and response headers
1244
+ def get_sale_with_http_info(opts = {})
1245
+ if @api_client.config.debugging
1246
+ @api_client.config.logger.debug 'Calling API: InventoryApi.get_sale ...'
1247
+ end
1248
+ # resource path
1249
+ local_var_path = '/sale'
1250
+
1251
+ # query parameters
1252
+ query_params = opts[:query_params] || {}
1253
+ query_params[:'ID'] = opts[:'id'] if !opts[:'id'].nil?
1254
+ query_params[:'CombineAdditionalCharges'] = opts[:'combine_additional_charges'] if !opts[:'combine_additional_charges'].nil?
1255
+ query_params[:'HideInventoryMovements'] = opts[:'hide_inventory_movements'] if !opts[:'hide_inventory_movements'].nil?
1256
+ query_params[:'IncludeTransactions'] = opts[:'include_transactions'] if !opts[:'include_transactions'].nil?
1257
+
1258
+ # header parameters
1259
+ header_params = opts[:header_params] || {}
1260
+ # HTTP header 'Accept' (if needed)
1261
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1262
+
1263
+ # form parameters
1264
+ form_params = opts[:form_params] || {}
1265
+
1266
+ # http body (model)
1267
+ post_body = opts[:body]
1268
+
1269
+ # return_type
1270
+ return_type = opts[:return_type] || 'Sale'
1271
+
1272
+ # auth_names
1273
+ auth_names = opts[:auth_names] || ['accountID', 'appKey']
1274
+
1275
+ new_options = opts.merge(
1276
+ :header_params => header_params,
1277
+ :query_params => query_params,
1278
+ :form_params => form_params,
1279
+ :body => post_body,
1280
+ :auth_names => auth_names,
1281
+ :return_type => return_type
1282
+ )
1283
+
1284
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1285
+ if @api_client.config.debugging
1286
+ @api_client.config.logger.debug "API called: InventoryApi#get_sale\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1287
+ end
1288
+ return data, status_code, headers
1289
+ end
1290
+
1225
1291
  # Allows you to retrieve the sale invoices
1226
1292
  # @param [Hash] opts the optional parameters
1227
1293
  # @option opts [String] :sale_id Unique DEAR Sale ID
@@ -1285,6 +1351,111 @@ module DearInventoryRuby
1285
1351
  return data, status_code, headers
1286
1352
  end
1287
1353
 
1354
+ # Allows you to retrieve the Sales based on conditions
1355
+ # @param [Hash] opts the optional parameters
1356
+ # @option opts [String] :page Default is 1 (default to '1')
1357
+ # @option opts [String] :limit Default is 100 (default to '100')
1358
+ # @option opts [String] :search Only return sales with search value contained in one of these fields: OrderNumber, Status, Customer, invoiceNumber, CustomerReference, CreditNoteNumber
1359
+ # @option opts [DateTime] :created_since Only return sales created after specified date. Date must follow ISO 8601 format.
1360
+ # @option opts [DateTime] :updated_since Only return sales changed after specified date. Date must follow ISO 8601 format.
1361
+ # @option opts [DateTime] :ship_by Only return sales with Ship By date on or before specified date, with not authorised Shipment. Date must follow ISO 8601 format.
1362
+ # @option opts [String] :quote_status Only return sales with specified quote status
1363
+ # @option opts [String] :order_status Only return sales with specified order status
1364
+ # @option opts [String] :combined_pick_status Only return sales with specified CombinedPickingStatus
1365
+ # @option opts [String] :combined_pack_status Only return sales with specified CombinedPackingStatus
1366
+ # @option opts [String] :combined_shipping_status Only return sales with specified CombinedShippingStatus
1367
+ # @option opts [String] :combined_invoice_status Only return sales with specified CombinedInvoiceStatus
1368
+ # @option opts [String] :credit_note_status Only return sales with specified credit note status
1369
+ # @option opts [String] :external_id Only return sales with specified External ID
1370
+ # @option opts [String] :status Default is nil
1371
+ # @option opts [Boolean] :ready_for_shipping Only return sales with &#39;Authorised&#39; pack and not &#39;Authorised&#39; shipping
1372
+ # @option opts [String] :order_location_id Only return sales with specified Order Location ID
1373
+ # @return [SaleList]
1374
+ def get_sale_list(opts = {})
1375
+ data, _status_code, _headers = get_sale_list_with_http_info(opts)
1376
+ data
1377
+ end
1378
+
1379
+ # Allows you to retrieve the Sales based on conditions
1380
+ # @param [Hash] opts the optional parameters
1381
+ # @option opts [String] :page Default is 1
1382
+ # @option opts [String] :limit Default is 100
1383
+ # @option opts [String] :search Only return sales with search value contained in one of these fields: OrderNumber, Status, Customer, invoiceNumber, CustomerReference, CreditNoteNumber
1384
+ # @option opts [DateTime] :created_since Only return sales created after specified date. Date must follow ISO 8601 format.
1385
+ # @option opts [DateTime] :updated_since Only return sales changed after specified date. Date must follow ISO 8601 format.
1386
+ # @option opts [DateTime] :ship_by Only return sales with Ship By date on or before specified date, with not authorised Shipment. Date must follow ISO 8601 format.
1387
+ # @option opts [String] :quote_status Only return sales with specified quote status
1388
+ # @option opts [String] :order_status Only return sales with specified order status
1389
+ # @option opts [String] :combined_pick_status Only return sales with specified CombinedPickingStatus
1390
+ # @option opts [String] :combined_pack_status Only return sales with specified CombinedPackingStatus
1391
+ # @option opts [String] :combined_shipping_status Only return sales with specified CombinedShippingStatus
1392
+ # @option opts [String] :combined_invoice_status Only return sales with specified CombinedInvoiceStatus
1393
+ # @option opts [String] :credit_note_status Only return sales with specified credit note status
1394
+ # @option opts [String] :external_id Only return sales with specified External ID
1395
+ # @option opts [String] :status Default is nil
1396
+ # @option opts [Boolean] :ready_for_shipping Only return sales with &#39;Authorised&#39; pack and not &#39;Authorised&#39; shipping
1397
+ # @option opts [String] :order_location_id Only return sales with specified Order Location ID
1398
+ # @return [Array<(SaleList, Integer, Hash)>] SaleList data, response status code and response headers
1399
+ def get_sale_list_with_http_info(opts = {})
1400
+ if @api_client.config.debugging
1401
+ @api_client.config.logger.debug 'Calling API: InventoryApi.get_sale_list ...'
1402
+ end
1403
+ # resource path
1404
+ local_var_path = '/saleList'
1405
+
1406
+ # query parameters
1407
+ query_params = opts[:query_params] || {}
1408
+ query_params[:'Page'] = opts[:'page'] if !opts[:'page'].nil?
1409
+ query_params[:'Limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1410
+ query_params[:'Search'] = opts[:'search'] if !opts[:'search'].nil?
1411
+ query_params[:'CreatedSince'] = opts[:'created_since'] if !opts[:'created_since'].nil?
1412
+ query_params[:'UpdatedSince'] = opts[:'updated_since'] if !opts[:'updated_since'].nil?
1413
+ query_params[:'ShipBy'] = opts[:'ship_by'] if !opts[:'ship_by'].nil?
1414
+ query_params[:'QuoteStatus'] = opts[:'quote_status'] if !opts[:'quote_status'].nil?
1415
+ query_params[:'OrderStatus'] = opts[:'order_status'] if !opts[:'order_status'].nil?
1416
+ query_params[:'CombinedPickStatus'] = opts[:'combined_pick_status'] if !opts[:'combined_pick_status'].nil?
1417
+ query_params[:'CombinedPackStatus'] = opts[:'combined_pack_status'] if !opts[:'combined_pack_status'].nil?
1418
+ query_params[:'CombinedShippingStatus'] = opts[:'combined_shipping_status'] if !opts[:'combined_shipping_status'].nil?
1419
+ query_params[:'CombinedInvoiceStatus'] = opts[:'combined_invoice_status'] if !opts[:'combined_invoice_status'].nil?
1420
+ query_params[:'CreditNoteStatus'] = opts[:'credit_note_status'] if !opts[:'credit_note_status'].nil?
1421
+ query_params[:'ExternalID'] = opts[:'external_id'] if !opts[:'external_id'].nil?
1422
+ query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil?
1423
+ query_params[:'ReadyForShipping'] = opts[:'ready_for_shipping'] if !opts[:'ready_for_shipping'].nil?
1424
+ query_params[:'OrderLocationID'] = opts[:'order_location_id'] if !opts[:'order_location_id'].nil?
1425
+
1426
+ # header parameters
1427
+ header_params = opts[:header_params] || {}
1428
+ # HTTP header 'Accept' (if needed)
1429
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1430
+
1431
+ # form parameters
1432
+ form_params = opts[:form_params] || {}
1433
+
1434
+ # http body (model)
1435
+ post_body = opts[:body]
1436
+
1437
+ # return_type
1438
+ return_type = opts[:return_type] || 'SaleList'
1439
+
1440
+ # auth_names
1441
+ auth_names = opts[:auth_names] || ['accountID', 'appKey']
1442
+
1443
+ new_options = opts.merge(
1444
+ :header_params => header_params,
1445
+ :query_params => query_params,
1446
+ :form_params => form_params,
1447
+ :body => post_body,
1448
+ :auth_names => auth_names,
1449
+ :return_type => return_type
1450
+ )
1451
+
1452
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1453
+ if @api_client.config.debugging
1454
+ @api_client.config.logger.debug "API called: InventoryApi#get_sale_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1455
+ end
1456
+ return data, status_code, headers
1457
+ end
1458
+
1288
1459
  # Allows you to retrieve the Sale Order
1289
1460
  # @param [Hash] opts the optional parameters
1290
1461
  # @option opts [String] :sale_id Unique DEAR Sale ID
@@ -1929,7 +2100,7 @@ module DearInventoryRuby
1929
2100
  # @param webhook [Webhook] a webhook object with properties to update
1930
2101
  # @param [Hash] opts the optional parameters
1931
2102
  # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (default to false)
1932
- # @return [Webhooks]
2103
+ # @return [Webhook]
1933
2104
  def update_webhook(webhook, opts = {})
1934
2105
  data, _status_code, _headers = update_webhook_with_http_info(webhook, opts)
1935
2106
  data
@@ -1939,7 +2110,7 @@ module DearInventoryRuby
1939
2110
  # @param webhook [Webhook] a webhook object with properties to update
1940
2111
  # @param [Hash] opts the optional parameters
1941
2112
  # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors
1942
- # @return [Array<(Webhooks, Integer, Hash)>] Webhooks data, response status code and response headers
2113
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
1943
2114
  def update_webhook_with_http_info(webhook, opts = {})
1944
2115
  if @api_client.config.debugging
1945
2116
  @api_client.config.logger.debug 'Calling API: InventoryApi.update_webhook ...'
@@ -1969,7 +2140,7 @@ module DearInventoryRuby
1969
2140
  post_body = opts[:body] || @api_client.object_to_http_body(webhook)
1970
2141
 
1971
2142
  # return_type
1972
- return_type = opts[:return_type] || 'Webhooks'
2143
+ return_type = opts[:return_type] || 'Webhook'
1973
2144
 
1974
2145
  # auth_names
1975
2146
  auth_names = opts[:auth_names] || ['accountID', 'appKey']
@@ -0,0 +1,37 @@
1
+ =begin
2
+ #DEAR Inventory API
3
+
4
+ #This specifing endpoints for DEAR Inventory API
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: nnhansg@gmail.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DearInventoryRuby
16
+ class AuthorizationType
17
+ BASICAUTH = "basicauth".freeze
18
+ BEARERAUTH = "bearerauth".freeze
19
+ NOAUTH = "noauth".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = AuthorizationType.constants.select { |c| AuthorizationType::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #AuthorizationType" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end