coinbase-sdk 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/external_address.rb +3 -166
  3. data/lib/coinbase/address/wallet_address.rb +44 -0
  4. data/lib/coinbase/address.rb +128 -0
  5. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  6. data/lib/coinbase/client/api/assets_api.rb +3 -3
  7. data/lib/coinbase/client/api/contract_events_api.rb +121 -0
  8. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  9. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  10. data/lib/coinbase/client/api/stake_api.rb +242 -1
  11. data/lib/coinbase/client/api/trades_api.rb +1 -1
  12. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  13. data/lib/coinbase/client/api/users_api.rb +1 -1
  14. data/lib/coinbase/client/api/validators_api.rb +1 -1
  15. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  16. data/lib/coinbase/client/api/webhooks_api.rb +286 -0
  17. data/lib/coinbase/client/api_client.rb +1 -1
  18. data/lib/coinbase/client/api_error.rb +1 -1
  19. data/lib/coinbase/client/configuration.rb +11 -1
  20. data/lib/coinbase/client/models/address.rb +1 -1
  21. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  22. data/lib/coinbase/client/models/address_list.rb +1 -1
  23. data/lib/coinbase/client/models/asset.rb +1 -1
  24. data/lib/coinbase/client/models/balance.rb +1 -1
  25. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +239 -0
  26. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  27. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  28. data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
  29. data/lib/coinbase/client/models/contract_event.rb +336 -0
  30. data/lib/coinbase/client/models/contract_event_list.rb +259 -0
  31. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  32. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  33. data/lib/coinbase/client/models/create_staking_operation_request.rb +274 -0
  34. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  35. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  36. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  37. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  38. data/lib/coinbase/client/models/create_webhook_request.rb +282 -0
  39. data/lib/coinbase/client/models/error.rb +1 -1
  40. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  41. data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
  42. data/lib/coinbase/client/models/feature.rb +1 -1
  43. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  44. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  45. data/lib/coinbase/client/models/get_staking_context_request.rb +1 -1
  46. data/lib/coinbase/client/models/native_eth_staking_context.rb +1 -1
  47. data/lib/coinbase/client/models/partial_eth_staking_context.rb +1 -1
  48. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  49. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  50. data/lib/coinbase/client/models/server_signer.rb +1 -1
  51. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  52. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  53. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  54. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  55. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  56. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  57. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  58. data/lib/coinbase/client/models/staking_context.rb +1 -1
  59. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  60. data/lib/coinbase/client/models/staking_operation.rb +16 -6
  61. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  62. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  63. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  64. data/lib/coinbase/client/models/trade.rb +1 -1
  65. data/lib/coinbase/client/models/trade_list.rb +1 -1
  66. data/lib/coinbase/client/models/transaction.rb +1 -1
  67. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  68. data/lib/coinbase/client/models/transfer.rb +5 -93
  69. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  70. data/lib/coinbase/client/models/update_webhook_request.rb +289 -0
  71. data/lib/coinbase/client/models/user.rb +1 -1
  72. data/lib/coinbase/client/models/validator.rb +1 -1
  73. data/lib/coinbase/client/models/validator_details.rb +1 -1
  74. data/lib/coinbase/client/models/validator_list.rb +1 -1
  75. data/lib/coinbase/client/models/wallet.rb +1 -1
  76. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  77. data/lib/coinbase/client/models/webhook.rb +299 -0
  78. data/lib/coinbase/client/models/webhook_event_filter.rb +236 -0
  79. data/lib/coinbase/client/models/webhook_event_type.rb +41 -0
  80. data/lib/coinbase/client/models/webhook_list.rb +244 -0
  81. data/lib/coinbase/client/version.rb +1 -1
  82. data/lib/coinbase/client.rb +13 -1
  83. data/lib/coinbase/middleware.rb +12 -0
  84. data/lib/coinbase/staking_operation.rb +106 -5
  85. data/lib/coinbase/trade.rb +1 -1
  86. data/lib/coinbase/transfer.rb +4 -5
  87. data/lib/coinbase/wallet.rb +76 -0
  88. data/lib/coinbase.rb +2 -1
  89. metadata +28 -2
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -19,6 +19,92 @@ module Coinbase::Client
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Broadcast a staking operation
23
+ # Broadcast a staking operation.
24
+ # @param wallet_id [String] The ID of the wallet the address belongs to.
25
+ # @param address_id [String] The ID of the address the staking operation belongs to.
26
+ # @param staking_operation_id [String] The ID of the staking operation to broadcast.
27
+ # @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [StakingOperation]
30
+ def broadcast_staking_operation(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
31
+ data, _status_code, _headers = broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts)
32
+ data
33
+ end
34
+
35
+ # Broadcast a staking operation
36
+ # Broadcast a staking operation.
37
+ # @param wallet_id [String] The ID of the wallet the address belongs to.
38
+ # @param address_id [String] The ID of the address the staking operation belongs to.
39
+ # @param staking_operation_id [String] The ID of the staking operation to broadcast.
40
+ # @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
41
+ # @param [Hash] opts the optional parameters
42
+ # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
43
+ def broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: StakeApi.broadcast_staking_operation ...'
46
+ end
47
+ # verify the required parameter 'wallet_id' is set
48
+ if @api_client.config.client_side_validation && wallet_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.broadcast_staking_operation"
50
+ end
51
+ # verify the required parameter 'address_id' is set
52
+ if @api_client.config.client_side_validation && address_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.broadcast_staking_operation"
54
+ end
55
+ # verify the required parameter 'staking_operation_id' is set
56
+ if @api_client.config.client_side_validation && staking_operation_id.nil?
57
+ fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling StakeApi.broadcast_staking_operation"
58
+ end
59
+ # verify the required parameter 'broadcast_staking_operation_request' is set
60
+ if @api_client.config.client_side_validation && broadcast_staking_operation_request.nil?
61
+ fail ArgumentError, "Missing the required parameter 'broadcast_staking_operation_request' when calling StakeApi.broadcast_staking_operation"
62
+ end
63
+ # resource path
64
+ local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations/{staking_operation_id}/broadcast'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'staking_operation_id' + '}', CGI.escape(staking_operation_id.to_s))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
73
+ # HTTP header 'Content-Type'
74
+ content_type = @api_client.select_header_content_type(['application/json'])
75
+ if !content_type.nil?
76
+ header_params['Content-Type'] = content_type
77
+ end
78
+
79
+ # form parameters
80
+ form_params = opts[:form_params] || {}
81
+
82
+ # http body (model)
83
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(broadcast_staking_operation_request)
84
+
85
+ # return_type
86
+ return_type = opts[:debug_return_type] || 'StakingOperation'
87
+
88
+ # auth_names
89
+ auth_names = opts[:debug_auth_names] || []
90
+
91
+ new_options = opts.merge(
92
+ :operation => :"StakeApi.broadcast_staking_operation",
93
+ :header_params => header_params,
94
+ :query_params => query_params,
95
+ :form_params => form_params,
96
+ :body => post_body,
97
+ :auth_names => auth_names,
98
+ :return_type => return_type
99
+ )
100
+
101
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug "API called: StakeApi#broadcast_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ end
105
+ return data, status_code, headers
106
+ end
107
+
22
108
  # Build a new staking operation
23
109
  # Build a new staking operation
24
110
  # @param build_staking_operation_request [BuildStakingOperationRequest]
@@ -87,6 +173,86 @@ module Coinbase::Client
87
173
  return data, status_code, headers
88
174
  end
89
175
 
176
+ # Create a new staking operation for an address
177
+ # Create a new staking operation.
178
+ # @param wallet_id [String] The ID of the wallet the address belongs to.
179
+ # @param address_id [String] The ID of the address to create the staking operation for.
180
+ # @param create_staking_operation_request [CreateStakingOperationRequest]
181
+ # @param [Hash] opts the optional parameters
182
+ # @return [StakingOperation]
183
+ def create_staking_operation(wallet_id, address_id, create_staking_operation_request, opts = {})
184
+ data, _status_code, _headers = create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts)
185
+ data
186
+ end
187
+
188
+ # Create a new staking operation for an address
189
+ # Create a new staking operation.
190
+ # @param wallet_id [String] The ID of the wallet the address belongs to.
191
+ # @param address_id [String] The ID of the address to create the staking operation for.
192
+ # @param create_staking_operation_request [CreateStakingOperationRequest]
193
+ # @param [Hash] opts the optional parameters
194
+ # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
195
+ def create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts = {})
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug 'Calling API: StakeApi.create_staking_operation ...'
198
+ end
199
+ # verify the required parameter 'wallet_id' is set
200
+ if @api_client.config.client_side_validation && wallet_id.nil?
201
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.create_staking_operation"
202
+ end
203
+ # verify the required parameter 'address_id' is set
204
+ if @api_client.config.client_side_validation && address_id.nil?
205
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.create_staking_operation"
206
+ end
207
+ # verify the required parameter 'create_staking_operation_request' is set
208
+ if @api_client.config.client_side_validation && create_staking_operation_request.nil?
209
+ fail ArgumentError, "Missing the required parameter 'create_staking_operation_request' when calling StakeApi.create_staking_operation"
210
+ end
211
+ # resource path
212
+ local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
213
+
214
+ # query parameters
215
+ query_params = opts[:query_params] || {}
216
+
217
+ # header parameters
218
+ header_params = opts[:header_params] || {}
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
221
+ # HTTP header 'Content-Type'
222
+ content_type = @api_client.select_header_content_type(['application/json'])
223
+ if !content_type.nil?
224
+ header_params['Content-Type'] = content_type
225
+ end
226
+
227
+ # form parameters
228
+ form_params = opts[:form_params] || {}
229
+
230
+ # http body (model)
231
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_staking_operation_request)
232
+
233
+ # return_type
234
+ return_type = opts[:debug_return_type] || 'StakingOperation'
235
+
236
+ # auth_names
237
+ auth_names = opts[:debug_auth_names] || []
238
+
239
+ new_options = opts.merge(
240
+ :operation => :"StakeApi.create_staking_operation",
241
+ :header_params => header_params,
242
+ :query_params => query_params,
243
+ :form_params => form_params,
244
+ :body => post_body,
245
+ :auth_names => auth_names,
246
+ :return_type => return_type
247
+ )
248
+
249
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug "API called: StakeApi#create_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
252
+ end
253
+ return data, status_code, headers
254
+ end
255
+
90
256
  # Fetch staking rewards
91
257
  # Fetch staking rewards for a list of addresses
92
258
  # @param fetch_staking_rewards_request [FetchStakingRewardsRequest]
@@ -307,5 +473,80 @@ module Coinbase::Client
307
473
  end
308
474
  return data, status_code, headers
309
475
  end
476
+
477
+ # Get the latest state of a staking operation
478
+ # Get the latest state of a staking operation.
479
+ # @param wallet_id [String] The ID of the wallet the address belongs to
480
+ # @param address_id [String] The ID of the address to fetch the staking operation for.
481
+ # @param staking_operation_id [String] The ID of the staking operation.
482
+ # @param [Hash] opts the optional parameters
483
+ # @return [StakingOperation]
484
+ def get_staking_operation(wallet_id, address_id, staking_operation_id, opts = {})
485
+ data, _status_code, _headers = get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts)
486
+ data
487
+ end
488
+
489
+ # Get the latest state of a staking operation
490
+ # Get the latest state of a staking operation.
491
+ # @param wallet_id [String] The ID of the wallet the address belongs to
492
+ # @param address_id [String] The ID of the address to fetch the staking operation for.
493
+ # @param staking_operation_id [String] The ID of the staking operation.
494
+ # @param [Hash] opts the optional parameters
495
+ # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
496
+ def get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts = {})
497
+ if @api_client.config.debugging
498
+ @api_client.config.logger.debug 'Calling API: StakeApi.get_staking_operation ...'
499
+ end
500
+ # verify the required parameter 'wallet_id' is set
501
+ if @api_client.config.client_side_validation && wallet_id.nil?
502
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.get_staking_operation"
503
+ end
504
+ # verify the required parameter 'address_id' is set
505
+ if @api_client.config.client_side_validation && address_id.nil?
506
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.get_staking_operation"
507
+ end
508
+ # verify the required parameter 'staking_operation_id' is set
509
+ if @api_client.config.client_side_validation && staking_operation_id.nil?
510
+ fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling StakeApi.get_staking_operation"
511
+ end
512
+ # resource path
513
+ local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations/{staking_operation_id}'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'staking_operation_id' + '}', CGI.escape(staking_operation_id.to_s))
514
+
515
+ # query parameters
516
+ query_params = opts[:query_params] || {}
517
+
518
+ # header parameters
519
+ header_params = opts[:header_params] || {}
520
+ # HTTP header 'Accept' (if needed)
521
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
522
+
523
+ # form parameters
524
+ form_params = opts[:form_params] || {}
525
+
526
+ # http body (model)
527
+ post_body = opts[:debug_body]
528
+
529
+ # return_type
530
+ return_type = opts[:debug_return_type] || 'StakingOperation'
531
+
532
+ # auth_names
533
+ auth_names = opts[:debug_auth_names] || []
534
+
535
+ new_options = opts.merge(
536
+ :operation => :"StakeApi.get_staking_operation",
537
+ :header_params => header_params,
538
+ :query_params => query_params,
539
+ :form_params => form_params,
540
+ :body => post_body,
541
+ :auth_names => auth_names,
542
+ :return_type => return_type
543
+ )
544
+
545
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
546
+ if @api_client.config.debugging
547
+ @api_client.config.logger.debug "API called: StakeApi#get_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
548
+ end
549
+ return data, status_code, headers
550
+ end
310
551
  end
311
552
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,286 @@
1
+ =begin
2
+ #Coinbase Platform API
3
+
4
+ #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
+
6
+ The version of the OpenAPI document: 0.0.1-alpha
7
+ Contact: yuga.cohler@coinbase.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Coinbase::Client
16
+ class WebhooksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new webhook
23
+ # Create a new webhook
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [CreateWebhookRequest] :create_webhook_request
26
+ # @return [Webhook]
27
+ def create_webhook(opts = {})
28
+ data, _status_code, _headers = create_webhook_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Create a new webhook
33
+ # Create a new webhook
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [CreateWebhookRequest] :create_webhook_request
36
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
37
+ def create_webhook_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/v1/webhooks'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+ # HTTP header 'Content-Type'
52
+ content_type = @api_client.select_header_content_type(['application/json'])
53
+ if !content_type.nil?
54
+ header_params['Content-Type'] = content_type
55
+ end
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_webhook_request'])
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'Webhook'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || []
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"WebhooksApi.create_webhook",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: WebhooksApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Delete a webhook
87
+ # Delete a webhook
88
+ # @param webhook_id [String] The Webhook uuid that needs to be deleted
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [nil]
91
+ def delete_webhook(webhook_id, opts = {})
92
+ delete_webhook_with_http_info(webhook_id, opts)
93
+ nil
94
+ end
95
+
96
+ # Delete a webhook
97
+ # Delete a webhook
98
+ # @param webhook_id [String] The Webhook uuid that needs to be deleted
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def delete_webhook_with_http_info(webhook_id, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...'
104
+ end
105
+ # verify the required parameter 'webhook_id' is set
106
+ if @api_client.config.client_side_validation && webhook_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook"
108
+ end
109
+ # resource path
110
+ local_var_path = '/v1/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:debug_body]
125
+
126
+ # return_type
127
+ return_type = opts[:debug_return_type]
128
+
129
+ # auth_names
130
+ auth_names = opts[:debug_auth_names] || []
131
+
132
+ new_options = opts.merge(
133
+ :operation => :"WebhooksApi.delete_webhook",
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => return_type
140
+ )
141
+
142
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
143
+ if @api_client.config.debugging
144
+ @api_client.config.logger.debug "API called: WebhooksApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
145
+ end
146
+ return data, status_code, headers
147
+ end
148
+
149
+ # List webhooks
150
+ # List webhooks, optionally filtered by event type.
151
+ # @param [Hash] opts the optional parameters
152
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
153
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
154
+ # @return [WebhookList]
155
+ def list_webhooks(opts = {})
156
+ data, _status_code, _headers = list_webhooks_with_http_info(opts)
157
+ data
158
+ end
159
+
160
+ # List webhooks
161
+ # List webhooks, optionally filtered by event type.
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
164
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
165
+ # @return [Array<(WebhookList, Integer, Hash)>] WebhookList data, response status code and response headers
166
+ def list_webhooks_with_http_info(opts = {})
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhooks ...'
169
+ end
170
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
171
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling WebhooksApi.list_webhooks, the character length must be smaller than or equal to 5000.'
172
+ end
173
+
174
+ # resource path
175
+ local_var_path = '/v1/webhooks'
176
+
177
+ # query parameters
178
+ query_params = opts[:query_params] || {}
179
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
180
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:debug_body]
192
+
193
+ # return_type
194
+ return_type = opts[:debug_return_type] || 'WebhookList'
195
+
196
+ # auth_names
197
+ auth_names = opts[:debug_auth_names] || []
198
+
199
+ new_options = opts.merge(
200
+ :operation => :"WebhooksApi.list_webhooks",
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => return_type
207
+ )
208
+
209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: WebhooksApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # Update a webhook
217
+ # Update a webhook
218
+ # @param webhook_id [String] The Webhook id that needs to be updated
219
+ # @param [Hash] opts the optional parameters
220
+ # @option opts [UpdateWebhookRequest] :update_webhook_request
221
+ # @return [Webhook]
222
+ def update_webhook(webhook_id, opts = {})
223
+ data, _status_code, _headers = update_webhook_with_http_info(webhook_id, opts)
224
+ data
225
+ end
226
+
227
+ # Update a webhook
228
+ # Update a webhook
229
+ # @param webhook_id [String] The Webhook id that needs to be updated
230
+ # @param [Hash] opts the optional parameters
231
+ # @option opts [UpdateWebhookRequest] :update_webhook_request
232
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
233
+ def update_webhook_with_http_info(webhook_id, opts = {})
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...'
236
+ end
237
+ # verify the required parameter 'webhook_id' is set
238
+ if @api_client.config.client_side_validation && webhook_id.nil?
239
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.update_webhook"
240
+ end
241
+ # resource path
242
+ local_var_path = '/v1/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', CGI.escape(webhook_id.to_s))
243
+
244
+ # query parameters
245
+ query_params = opts[:query_params] || {}
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
251
+ # HTTP header 'Content-Type'
252
+ content_type = @api_client.select_header_content_type(['application/json'])
253
+ if !content_type.nil?
254
+ header_params['Content-Type'] = content_type
255
+ end
256
+
257
+ # form parameters
258
+ form_params = opts[:form_params] || {}
259
+
260
+ # http body (model)
261
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_webhook_request'])
262
+
263
+ # return_type
264
+ return_type = opts[:debug_return_type] || 'Webhook'
265
+
266
+ # auth_names
267
+ auth_names = opts[:debug_auth_names] || []
268
+
269
+ new_options = opts.merge(
270
+ :operation => :"WebhooksApi.update_webhook",
271
+ :header_params => header_params,
272
+ :query_params => query_params,
273
+ :form_params => form_params,
274
+ :body => post_body,
275
+ :auth_names => auth_names,
276
+ :return_type => return_type
277
+ )
278
+
279
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: WebhooksApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+ end
286
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module Coinbase::Client
79
79
  # @return [true, false]
80
80
  attr_accessor :debugging
81
81
 
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
82
90
  # Defines the logger used for debugging.
83
91
  # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
92
  #
@@ -170,6 +178,7 @@ module Coinbase::Client
170
178
  @return_binary_data = false
171
179
  @params_encoder = nil
172
180
  @debugging = false
181
+ @ignore_operation_servers = false
173
182
  @inject_format = false
174
183
  @force_ending_format = false
175
184
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -204,6 +213,7 @@ module Coinbase::Client
204
213
 
205
214
  # Returns base URL for specified operation based on server settings
206
215
  def base_url(operation = nil)
216
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
207
217
  if operation_server_settings.key?(operation) then
208
218
  index = server_operation_index.fetch(operation, server_index)
209
219
  server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12