Class: BombBomb::WebhooksApi
- Inherits:
-
Object
- Object
- BombBomb::WebhooksApi
- Defined in:
- lib/bombbomb/api/webhooks_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_web_hook(hook_url, opts = {}) ⇒ BBWebHook
Add Webhook Idempotently adds a Webhook url.
-
#add_web_hook_with_http_info(hook_url, opts = {}) ⇒ Array<(BBWebHook, Fixnum, Hash)>
Add Webhook Idempotently adds a Webhook url.
-
#delete_web_hook(hook_id, opts = {}) ⇒ String
Deletes Webhook Deletes a Webhook.
-
#delete_web_hook_with_http_info(hook_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Deletes Webhook Deletes a Webhook.
-
#get_web_hooks(opts = {}) ⇒ Array<BBWebHook>
Lists Webhooks Lists all registered Webhooks.
-
#get_web_hooks_with_http_info(opts = {}) ⇒ Array<(Array<BBWebHook>, Fixnum, Hash)>
Lists Webhooks Lists all registered Webhooks.
-
#initialize(api_client = ApiClient.default) ⇒ WebhooksApi
constructor
A new instance of WebhooksApi.
-
#list_web_hook_events(opts = {}) ⇒ nil
Describe WebHook Events Returns example Webhook events for each kind of possible event.
-
#list_web_hook_events_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Describe WebHook Events Returns example Webhook events for each kind of possible event.
-
#send_webhook_example(opts = {}) ⇒ nil
Sends test Webhook Triggers a test webhook to be sent to your endpoints.
-
#send_webhook_example_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Sends test Webhook Triggers a test webhook to be sent to your endpoints.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ WebhooksApi
Returns a new instance of WebhooksApi.
30 31 32 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
28 29 30 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 28 def api_client @api_client end |
Instance Method Details
#add_web_hook(hook_url, opts = {}) ⇒ BBWebHook
Add Webhook Idempotently adds a Webhook url
39 40 41 42 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 39 def add_web_hook(hook_url, opts = {}) data, _status_code, _headers = add_web_hook_with_http_info(hook_url, opts) return data end |
#add_web_hook_with_http_info(hook_url, opts = {}) ⇒ Array<(BBWebHook, Fixnum, Hash)>
Add Webhook Idempotently adds a Webhook url
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 49 def add_web_hook_with_http_info(hook_url, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: WebhooksApi.add_web_hook ..." end # verify the required parameter 'hook_url' is set fail ArgumentError, "Missing the required parameter 'hook_url' when calling WebhooksApi.add_web_hook" if hook_url.nil? # resource path local_var_path = "/webhook".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} form_params["hookUrl"] = hook_url # http body (model) post_body = nil auth_names = ['BBOAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BBWebHook') if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#add_web_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_web_hook(hook_id, opts = {}) ⇒ String
Deletes Webhook Deletes a Webhook
97 98 99 100 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 97 def delete_web_hook(hook_id, opts = {}) data, _status_code, _headers = delete_web_hook_with_http_info(hook_id, opts) return data end |
#delete_web_hook_with_http_info(hook_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Deletes Webhook Deletes a Webhook
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 107 def delete_web_hook_with_http_info(hook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: WebhooksApi.delete_web_hook ..." end # verify the required parameter 'hook_id' is set fail ArgumentError, "Missing the required parameter 'hook_id' when calling WebhooksApi.delete_web_hook" if hook_id.nil? # resource path local_var_path = "/webhook/{hookId}".sub('{format}','json').sub('{' + 'hookId' + '}', hook_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BBOAuth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#delete_web_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_web_hooks(opts = {}) ⇒ Array<BBWebHook>
Lists Webhooks Lists all registered Webhooks
153 154 155 156 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 153 def get_web_hooks(opts = {}) data, _status_code, _headers = get_web_hooks_with_http_info(opts) return data end |
#get_web_hooks_with_http_info(opts = {}) ⇒ Array<(Array<BBWebHook>, Fixnum, Hash)>
Lists Webhooks Lists all registered Webhooks
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 162 def get_web_hooks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: WebhooksApi.get_web_hooks ..." end # resource path local_var_path = "/webhook/".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BBOAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<BBWebHook>') if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#get_web_hooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_web_hook_events(opts = {}) ⇒ nil
Describe WebHook Events Returns example Webhook events for each kind of possible event.
206 207 208 209 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 206 def list_web_hook_events(opts = {}) list_web_hook_events_with_http_info(opts) return nil end |
#list_web_hook_events_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Describe WebHook Events Returns example Webhook events for each kind of possible event.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 215 def list_web_hook_events_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: WebhooksApi.list_web_hook_events ..." end # resource path local_var_path = "/webhook/events".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#list_web_hook_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_webhook_example(opts = {}) ⇒ nil
Sends test Webhook Triggers a test webhook to be sent to your endpoints.
258 259 260 261 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 258 def send_webhook_example(opts = {}) send_webhook_example_with_http_info(opts) return nil end |
#send_webhook_example_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Sends test Webhook Triggers a test webhook to be sent to your endpoints.
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/bombbomb/api/webhooks_api.rb', line 267 def send_webhook_example_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: WebhooksApi.send_webhook_example ..." end # resource path local_var_path = "/webhook/test".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BBOAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#send_webhook_example\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |