class CryptoApis::ManageSubscriptionsApi
Attributes
Public Class Methods
# File lib/crypto_apis/api/manage_subscriptions_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete Blockchain Event Subscription Through this endpoint the customer can delete blockchain event subscriptions they have by attributes `referenceId` and `network`. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} {warning}Crypto APIs will notify the user **only when** the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification **will not** be sent if the event does not or cannot occur, or will take long time to occur.{/warning} @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param reference_id [String] Represents a unique ID used to reference the specific callback subscription. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. @return [DeleteBlockchainEventSubscriptionR]
# File lib/crypto_apis/api/manage_subscriptions_api.rb, line 30 def delete_blockchain_event_subscription(blockchain, network, reference_id, opts = {}) data, _status_code, _headers = delete_blockchain_event_subscription_with_http_info(blockchain, network, reference_id, opts) data end
Delete Blockchain Event Subscription Through this endpoint the customer can delete blockchain event subscriptions they have by attributes `referenceId` and `network`. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} {warning}Crypto APIs will notify the user **only when** the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification **will not** be sent if the event does not or cannot occur, or will take long time to occur.{/warning} @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param reference_id [String] Represents a unique ID used to reference the specific callback subscription. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. @return [Array<(DeleteBlockchainEventSubscriptionR
, Integer, Hash)>] DeleteBlockchainEventSubscriptionR
data, response status code and response headers
# File lib/crypto_apis/api/manage_subscriptions_api.rb, line 43 def delete_blockchain_event_subscription_with_http_info(blockchain, network, reference_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManageSubscriptionsApi.delete_blockchain_event_subscription ...' end # verify the required parameter 'blockchain' is set if @api_client.config.client_side_validation && blockchain.nil? fail ArgumentError, "Missing the required parameter 'blockchain' when calling ManageSubscriptionsApi.delete_blockchain_event_subscription" end # verify enum value allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic", "xrp", "zilliqa"] if @api_client.config.client_side_validation && !allowable_values.include?(blockchain) fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}" end # verify the required parameter 'network' is set if @api_client.config.client_side_validation && network.nil? fail ArgumentError, "Missing the required parameter 'network' when calling ManageSubscriptionsApi.delete_blockchain_event_subscription" end # verify enum value allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor", "kotti"] if @api_client.config.client_side_validation && !allowable_values.include?(network) fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}" end # verify the required parameter 'reference_id' is set if @api_client.config.client_side_validation && reference_id.nil? fail ArgumentError, "Missing the required parameter 'reference_id' when calling ManageSubscriptionsApi.delete_blockchain_event_subscription" end # resource path local_var_path = '/blockchain-events/{blockchain}/{network}/subscriptions/{referenceId}'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'referenceId' + '}', CGI.escape(reference_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteBlockchainEventSubscriptionR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"ManageSubscriptionsApi.delete_blockchain_event_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManageSubscriptionsApi#delete_blockchain_event_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Blockchain Events Subscriptions Through this endpoint the customer can obtain a list of their callback subscriptions for the available Blockchain events. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. @option opts [Integer] :limit Defines how many items should be returned in the response per page basis. (default to 50) @option opts [Integer] :offset The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0) @return [ListBlockchainEventsSubscriptionsR]
# File lib/crypto_apis/api/manage_subscriptions_api.rb, line 119 def list_blockchain_events_subscriptions(blockchain, network, opts = {}) data, _status_code, _headers = list_blockchain_events_subscriptions_with_http_info(blockchain, network, opts) data end
List Blockchain Events Subscriptions Through this endpoint the customer can obtain a list of their callback subscriptions for the available Blockchain events. Currently Crypto APIs 2.0 offers certain Blockchain event endpoints which allow the user to subscribe for one/a few/all and receive callback notifications when the specific event occurs. {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. @option opts [Integer] :limit Defines how many items should be returned in the response per page basis. @option opts [Integer] :offset The starting index of the response items, i.e. where the response should start listing the returned items. @return [Array<(ListBlockchainEventsSubscriptionsR
, Integer, Hash)>] ListBlockchainEventsSubscriptionsR
data, response status code and response headers
# File lib/crypto_apis/api/manage_subscriptions_api.rb, line 133 def list_blockchain_events_subscriptions_with_http_info(blockchain, network, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManageSubscriptionsApi.list_blockchain_events_subscriptions ...' end # verify the required parameter 'blockchain' is set if @api_client.config.client_side_validation && blockchain.nil? fail ArgumentError, "Missing the required parameter 'blockchain' when calling ManageSubscriptionsApi.list_blockchain_events_subscriptions" end # verify enum value allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic", "xrp", "zilliqa"] if @api_client.config.client_side_validation && !allowable_values.include?(blockchain) fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}" end # verify the required parameter 'network' is set if @api_client.config.client_side_validation && network.nil? fail ArgumentError, "Missing the required parameter 'network' when calling ManageSubscriptionsApi.list_blockchain_events_subscriptions" end # verify enum value allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor", "kotti"] if @api_client.config.client_side_validation && !allowable_values.include?(network) fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}" end # resource path local_var_path = '/blockchain-events/{blockchain}/{network}/subscriptions'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListBlockchainEventsSubscriptionsR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"ManageSubscriptionsApi.list_blockchain_events_subscriptions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManageSubscriptionsApi#list_blockchain_events_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end