Class: MailSlurpClient::WebhookControllerApi
- Inherits:
-
Object
- Object
- MailSlurpClient::WebhookControllerApi
- Defined in:
- lib/mailslurp_client/api/webhook_controller_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_webhook(inbox_id, webhook_options, opts = {}) ⇒ WebhookDto
Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL.
-
#create_webhook_with_http_info(inbox_id, webhook_options, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>
Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL.
-
#delete_webhook(inbox_id, webhook_id, opts = {}) ⇒ nil
Delete and disable a Webhook for an Inbox.
-
#delete_webhook_with_http_info(inbox_id, webhook_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete and disable a Webhook for an Inbox.
-
#get_all_webhooks(opts = {}) ⇒ PageWebhookProjection
List Webhooks Paginated List webhooks in paginated form.
-
#get_all_webhooks_with_http_info(opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>
List Webhooks Paginated List webhooks in paginated form.
-
#get_webhook(webhook_id, opts = {}) ⇒ WebhookDto
Get a webhook for an Inbox.
-
#get_webhook_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>
Get a webhook for an Inbox.
-
#get_webhooks(inbox_id, opts = {}) ⇒ Array<WebhookDto>
Get all Webhooks for an Inbox.
-
#get_webhooks_with_http_info(inbox_id, opts = {}) ⇒ Array<(Array<WebhookDto>, Integer, Hash)>
Get all Webhooks for an Inbox.
-
#initialize(api_client = ApiClient.default) ⇒ WebhookControllerApi
constructor
A new instance of WebhookControllerApi.
-
#send_test_data(webhook_id, opts = {}) ⇒ WebhookTestResult
Send webhook test data.
-
#send_test_data_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookTestResult, Integer, Hash)>
Send webhook test data.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ WebhookControllerApi
Returns a new instance of WebhookControllerApi.
19 20 21 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_webhook(inbox_id, webhook_options, opts = {}) ⇒ WebhookDto
Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
28 29 30 31 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 28 def create_webhook(inbox_id, , opts = {}) data, _status_code, _headers = create_webhook_with_http_info(inbox_id, , opts) data end |
#create_webhook_with_http_info(inbox_id, webhook_options, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>
Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
39 40 41 42 43 44 45 46 47 48 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/mailslurp_client/api/webhook_controller_api.rb', line 39 def create_webhook_with_http_info(inbox_id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_webhook ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.create_webhook" end # verify the required parameter 'webhook_options' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'webhook_options' when calling WebhookControllerApi.create_webhook" end # resource path local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body() # return_type return_type = opts[:return_type] || 'WebhookDto' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_webhook(inbox_id, webhook_id, opts = {}) ⇒ nil
Delete and disable a Webhook for an Inbox
97 98 99 100 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 97 def delete_webhook(inbox_id, webhook_id, opts = {}) delete_webhook_with_http_info(inbox_id, webhook_id, opts) nil end |
#delete_webhook_with_http_info(inbox_id, webhook_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete and disable a Webhook for an Inbox
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 148 149 150 151 152 153 154 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 107 def delete_webhook_with_http_info(inbox_id, webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.delete_webhook ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.delete_webhook" end # verify the required parameter 'webhook_id' is set if @api_client.config.client_side_validation && webhook_id.nil? fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.delete_webhook" end # resource path local_var_path = '/inboxes/{inboxId}/webhooks/{webhookId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_all_webhooks(opts = {}) ⇒ PageWebhookProjection
List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.
163 164 165 166 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 163 def get_all_webhooks(opts = {}) data, _status_code, _headers = get_all_webhooks_with_http_info(opts) data end |
#get_all_webhooks_with_http_info(opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>
List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.
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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 175 def get_all_webhooks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_all_webhooks ...' end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/webhooks/paginated' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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[:body] # return_type return_type = opts[:return_type] || 'PageWebhookProjection' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#get_all_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_webhook(webhook_id, opts = {}) ⇒ WebhookDto
Get a webhook for an Inbox
229 230 231 232 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 229 def get_webhook(webhook_id, opts = {}) data, _status_code, _headers = get_webhook_with_http_info(webhook_id, opts) data end |
#get_webhook_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>
Get a webhook for an Inbox
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 238 def get_webhook_with_http_info(webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook ...' end # verify the required parameter 'webhook_id' is set if @api_client.config.client_side_validation && webhook_id.nil? fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_webhook" end # resource path local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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[:body] # return_type return_type = opts[:return_type] || 'WebhookDto' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_webhooks(inbox_id, opts = {}) ⇒ Array<WebhookDto>
Get all Webhooks for an Inbox
289 290 291 292 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 289 def get_webhooks(inbox_id, opts = {}) data, _status_code, _headers = get_webhooks_with_http_info(inbox_id, opts) data end |
#get_webhooks_with_http_info(inbox_id, opts = {}) ⇒ Array<(Array<WebhookDto>, Integer, Hash)>
Get all Webhooks for an Inbox
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 298 def get_webhooks_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhooks ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.get_webhooks" end # resource path local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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[:body] # return_type return_type = opts[:return_type] || 'Array<WebhookDto>' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#get_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_test_data(webhook_id, opts = {}) ⇒ WebhookTestResult
Send webhook test data
349 350 351 352 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 349 def send_test_data(webhook_id, opts = {}) data, _status_code, _headers = send_test_data_with_http_info(webhook_id, opts) data end |
#send_test_data_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookTestResult, Integer, Hash)>
Send webhook test data
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 358 def send_test_data_with_http_info(webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhookControllerApi.send_test_data ...' end # verify the required parameter 'webhook_id' is set if @api_client.config.client_side_validation && webhook_id.nil? fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.send_test_data" end # resource path local_var_path = '/webhooks/{webhookId}/test'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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[:body] # return_type return_type = opts[:return_type] || 'WebhookTestResult' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] = opts.merge( :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(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhookControllerApi#send_test_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |