mailslurp_client 5.0.0 → 7.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +127 -40
- data/docs/AttachmentControllerApi.md +124 -0
- data/docs/AttachmentMetaData.md +23 -0
- data/docs/BasicAuthOptions.md +10 -0
- data/docs/BulkActionsControllerApi.md +165 -0
- data/docs/BulkSendEmailOptions.md +11 -1
- data/docs/CommonActionsControllerApi.md +167 -0
- data/docs/ContactControllerApi.md +274 -0
- data/docs/ContactDto.md +31 -0
- data/docs/ContactProjection.md +27 -0
- data/docs/CreateContactOptions.md +31 -0
- data/docs/CreateDomainOptions.md +17 -0
- data/docs/CreateGroupOptions.md +19 -0
- data/docs/CreateTemplateOptions.md +19 -0
- data/docs/CreateWebhookOptions.md +13 -2
- data/docs/DomainControllerApi.md +223 -0
- data/docs/DomainDto.md +29 -0
- data/docs/DomainPreview.md +21 -0
- data/docs/Email.md +40 -15
- data/docs/EmailAnalysis.md +18 -5
- data/docs/EmailControllerApi.md +740 -0
- data/docs/EmailPreview.md +24 -6
- data/docs/EmailProjection.md +33 -0
- data/docs/ForwardEmailOptions.md +12 -0
- data/docs/GroupContactsDto.md +19 -0
- data/docs/GroupControllerApi.md +437 -0
- data/docs/GroupDto.md +23 -0
- data/docs/GroupProjection.md +23 -0
- data/docs/HTMLValidationResult.md +21 -0
- data/docs/Inbox.md +26 -4
- data/docs/InboxControllerApi.md +652 -0
- data/docs/InboxProjection.md +29 -0
- data/docs/JsonNode.md +59 -0
- data/docs/MatchOption.md +13 -2
- data/docs/MatchOptions.md +9 -0
- data/docs/PageContactProjection.md +37 -0
- data/docs/PageEmailPreview.md +37 -0
- data/docs/PageEmailProjection.md +37 -0
- data/docs/PageGroupProjection.md +37 -0
- data/docs/PageInboxProjection.md +37 -0
- data/docs/PageTemplateProjection.md +37 -0
- data/docs/PageWebhookProjection.md +37 -0
- data/docs/Pageable.md +27 -0
- data/docs/RawEmailJson.md +17 -0
- data/docs/SendEmailOptions.md +33 -6
- data/docs/SetInboxFavouritedOptions.md +17 -0
- data/docs/Sort.md +21 -0
- data/docs/TemplateControllerApi.md +274 -0
- data/docs/TemplateDto.md +25 -0
- data/docs/TemplateProjection.md +25 -0
- data/docs/TemplateVariable.md +19 -0
- data/docs/UnreadCount.md +17 -0
- data/docs/UpdateGroupContacts.md +17 -0
- data/docs/UpdateInboxOptions.md +25 -0
- data/docs/UploadAttachmentOptions.md +12 -1
- data/docs/ValidationDto.md +19 -0
- data/docs/ValidationMessage.md +19 -0
- data/docs/WaitForConditions.md +29 -0
- data/docs/WaitForControllerApi.md +317 -0
- data/docs/WebhookControllerApi.md +339 -0
- data/docs/WebhookDto.md +33 -0
- data/docs/WebhookProjection.md +27 -0
- data/docs/WebhookTestRequest.md +23 -0
- data/docs/WebhookTestResponse.md +19 -0
- data/docs/WebhookTestResult.md +21 -0
- data/git_push.sh +10 -7
- data/lib/mailslurp_client.rb +56 -7
- data/lib/mailslurp_client/api/attachment_controller_api.rb +157 -0
- data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +203 -0
- data/lib/mailslurp_client/api/common_actions_controller_api.rb +201 -0
- data/lib/mailslurp_client/api/contact_controller_api.rb +323 -0
- data/lib/mailslurp_client/api/domain_controller_api.rb +264 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +852 -0
- data/lib/mailslurp_client/api/group_controller_api.rb +519 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +763 -0
- data/lib/mailslurp_client/api/template_controller_api.rb +323 -0
- data/lib/mailslurp_client/api/wait_for_controller_api.rb +359 -0
- data/lib/mailslurp_client/api/webhook_controller_api.rb +405 -0
- data/lib/mailslurp_client/api_client.rb +36 -39
- data/lib/mailslurp_client/api_error.rb +23 -4
- data/lib/mailslurp_client/configuration.rb +8 -11
- data/lib/mailslurp_client/models/attachment_meta_data.rb +253 -0
- data/lib/mailslurp_client/models/basic_auth_options.rb +39 -15
- data/lib/mailslurp_client/models/bulk_send_email_options.rb +42 -19
- data/lib/mailslurp_client/models/contact_dto.rb +288 -0
- data/lib/mailslurp_client/models/contact_projection.rb +261 -0
- data/lib/mailslurp_client/models/create_contact_options.rb +277 -0
- data/lib/mailslurp_client/models/create_domain_options.rb +208 -0
- data/lib/mailslurp_client/models/create_group_options.rb +220 -0
- data/lib/mailslurp_client/models/create_template_options.rb +225 -0
- data/lib/mailslurp_client/models/create_webhook_options.rb +54 -29
- data/lib/mailslurp_client/models/domain_dto.rb +296 -0
- data/lib/mailslurp_client/models/domain_preview.rb +240 -0
- data/lib/mailslurp_client/models/email.rb +86 -78
- data/lib/mailslurp_client/models/email_analysis.rb +46 -48
- data/lib/mailslurp_client/models/email_preview.rb +77 -41
- data/lib/mailslurp_client/models/email_projection.rb +306 -0
- data/lib/mailslurp_client/models/forward_email_options.rb +40 -17
- data/lib/mailslurp_client/models/group_contacts_dto.rb +227 -0
- data/lib/mailslurp_client/models/{webhook.rb → group_dto.rb} +60 -54
- data/lib/mailslurp_client/models/group_projection.rb +248 -0
- data/lib/mailslurp_client/models/html_validation_result.rb +243 -0
- data/lib/mailslurp_client/models/inbox.rb +104 -26
- data/lib/mailslurp_client/models/inbox_projection.rb +272 -0
- data/lib/mailslurp_client/models/json_node.rb +429 -0
- data/lib/mailslurp_client/models/match_option.rb +48 -24
- data/lib/mailslurp_client/models/match_options.rb +37 -14
- data/lib/mailslurp_client/models/page_contact_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_email_preview.rb +298 -0
- data/lib/mailslurp_client/models/page_email_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_group_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_inbox_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_template_projection.rb +298 -0
- data/lib/mailslurp_client/models/page_webhook_projection.rb +298 -0
- data/lib/mailslurp_client/models/pageable.rb +251 -0
- data/lib/mailslurp_client/models/raw_email_json.rb +211 -0
- data/lib/mailslurp_client/models/send_email_options.rb +141 -46
- data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +208 -0
- data/lib/mailslurp_client/models/sort.rb +224 -0
- data/lib/mailslurp_client/models/template_dto.rb +269 -0
- data/lib/mailslurp_client/models/template_projection.rb +269 -0
- data/lib/mailslurp_client/models/template_variable.rb +259 -0
- data/lib/mailslurp_client/models/unread_count.rb +211 -0
- data/lib/mailslurp_client/models/update_group_contacts.rb +213 -0
- data/lib/mailslurp_client/models/update_inbox_options.rb +250 -0
- data/lib/mailslurp_client/models/upload_attachment_options.rb +43 -20
- data/lib/mailslurp_client/models/validation_dto.rb +225 -0
- data/lib/mailslurp_client/models/validation_message.rb +220 -0
- data/lib/mailslurp_client/models/wait_for_conditions.rb +315 -0
- data/lib/mailslurp_client/models/webhook_dto.rb +326 -0
- data/lib/mailslurp_client/models/webhook_projection.rb +277 -0
- data/lib/mailslurp_client/models/webhook_test_request.rb +284 -0
- data/lib/mailslurp_client/models/webhook_test_response.rb +215 -0
- data/lib/mailslurp_client/models/webhook_test_result.rb +235 -0
- data/lib/mailslurp_client/version.rb +5 -5
- data/mailslurp_client.gemspec +4 -10
- data/spec/api/attachment_controller_api_spec.rb +61 -0
- data/spec/api/bulk_actions_controller_api_spec.rb +68 -0
- data/spec/api/common_actions_controller_api_spec.rb +129 -0
- data/spec/api/contact_controller_api_spec.rb +91 -0
- data/spec/api/domain_controller_api_spec.rb +82 -0
- data/spec/api/email_controller_api_spec.rb +162 -0
- data/spec/api/group_controller_api_spec.rb +126 -0
- data/spec/api/inbox_controller_api_spec.rb +172 -0
- data/spec/api/template_controller_api_spec.rb +91 -0
- data/spec/api/wait_for_controller_api_spec.rb +107 -0
- data/spec/api/webhook_controller_api_spec.rb +107 -0
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +4 -4
- data/spec/models/attachment_meta_data_spec.rb +59 -0
- data/spec/models/basic_auth_options_spec.rb +4 -4
- data/spec/models/bulk_send_email_options_spec.rb +4 -4
- data/spec/models/contact_dto_spec.rb +83 -0
- data/spec/models/contact_projection_spec.rb +71 -0
- data/spec/models/create_contact_options_spec.rb +83 -0
- data/spec/models/create_domain_options_spec.rb +41 -0
- data/spec/models/create_group_options_spec.rb +47 -0
- data/spec/models/create_template_options_spec.rb +47 -0
- data/spec/models/create_webhook_options_spec.rb +6 -6
- data/spec/models/domain_dto_spec.rb +77 -0
- data/spec/models/domain_preview_spec.rb +53 -0
- data/spec/models/email_analysis_spec.rb +4 -4
- data/spec/models/email_preview_spec.rb +41 -5
- data/spec/models/email_projection_spec.rb +89 -0
- data/spec/models/email_spec.rb +17 -5
- data/spec/models/forward_email_options_spec.rb +4 -4
- data/spec/models/group_contacts_dto_spec.rb +47 -0
- data/spec/models/group_dto_spec.rb +59 -0
- data/spec/models/group_projection_spec.rb +59 -0
- data/spec/models/html_validation_result_spec.rb +53 -0
- data/spec/models/inbox_projection_spec.rb +77 -0
- data/spec/models/inbox_spec.rb +35 -5
- data/spec/models/json_node_spec.rb +171 -0
- data/spec/models/match_option_spec.rb +4 -4
- data/spec/models/match_options_spec.rb +4 -4
- data/spec/models/page_contact_projection_spec.rb +101 -0
- data/spec/models/page_email_preview_spec.rb +101 -0
- data/spec/models/page_email_projection_spec.rb +101 -0
- data/spec/models/page_group_projection_spec.rb +101 -0
- data/spec/models/page_inbox_projection_spec.rb +101 -0
- data/spec/models/page_template_projection_spec.rb +101 -0
- data/spec/models/page_webhook_projection_spec.rb +101 -0
- data/spec/models/pageable_spec.rb +71 -0
- data/spec/models/raw_email_json_spec.rb +41 -0
- data/spec/models/send_email_options_spec.rb +45 -5
- data/spec/models/set_inbox_favourited_options_spec.rb +41 -0
- data/spec/models/sort_spec.rb +53 -0
- data/spec/models/template_dto_spec.rb +65 -0
- data/spec/models/template_projection_spec.rb +65 -0
- data/spec/models/template_variable_spec.rb +51 -0
- data/spec/models/unread_count_spec.rb +41 -0
- data/spec/models/update_group_contacts_spec.rb +41 -0
- data/spec/models/{webhook_spec.rb → update_inbox_options_spec.rb} +14 -20
- data/spec/models/upload_attachment_options_spec.rb +4 -4
- data/spec/models/validation_dto_spec.rb +47 -0
- data/spec/models/validation_message_spec.rb +47 -0
- data/spec/models/wait_for_conditions_spec.rb +85 -0
- data/spec/models/webhook_dto_spec.rb +93 -0
- data/spec/models/webhook_projection_spec.rb +71 -0
- data/spec/models/webhook_test_request_spec.rb +63 -0
- data/spec/models/webhook_test_response_spec.rb +47 -0
- data/spec/models/webhook_test_result_spec.rb +53 -0
- data/spec/spec_helper.rb +4 -4
- metadata +223 -149
- data/Gemfile.lock +0 -79
- data/docs/CommonOperationsApi.md +0 -499
- data/docs/ExtraOperationsApi.md +0 -1021
- data/docs/Webhook.md +0 -13
- data/lib/mailslurp_client/api/common_operations_api.rb +0 -502
- data/lib/mailslurp_client/api/extra_operations_api.rb +0 -1054
- data/spec/api/common_operations_api_spec.rb +0 -95
- data/spec/api/extra_operations_api_spec.rb +0 -231
@@ -0,0 +1,405 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class WebhookControllerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Attach a WebHook URL to an inbox
|
23
|
+
# 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.
|
24
|
+
# @param inbox_id [String] inboxId
|
25
|
+
# @param webhook_options [CreateWebhookOptions] webhookOptions
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [WebhookDto]
|
28
|
+
def create_webhook(inbox_id, webhook_options, opts = {})
|
29
|
+
data, _status_code, _headers = create_webhook_with_http_info(inbox_id, webhook_options, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attach a WebHook URL to an inbox
|
34
|
+
# 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.
|
35
|
+
# @param inbox_id [String] inboxId
|
36
|
+
# @param webhook_options [CreateWebhookOptions] webhookOptions
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(WebhookDto, Integer, Hash)>] WebhookDto data, response status code and response headers
|
39
|
+
def create_webhook_with_http_info(inbox_id, webhook_options, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_webhook ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'inbox_id' is set
|
44
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.create_webhook"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'webhook_options' is set
|
48
|
+
if @api_client.config.client_side_validation && webhook_options.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'webhook_options' when calling WebhookControllerApi.create_webhook"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = opts[:body] || @api_client.object_to_http_body(webhook_options)
|
69
|
+
|
70
|
+
# return_type
|
71
|
+
return_type = opts[:return_type] || 'WebhookDto'
|
72
|
+
|
73
|
+
# auth_names
|
74
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
75
|
+
|
76
|
+
new_options = opts.merge(
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Delete and disable a Webhook for an Inbox
|
93
|
+
# @param inbox_id [String] inboxId
|
94
|
+
# @param webhook_id [String] webhookId
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [nil]
|
97
|
+
def delete_webhook(inbox_id, webhook_id, opts = {})
|
98
|
+
delete_webhook_with_http_info(inbox_id, webhook_id, opts)
|
99
|
+
nil
|
100
|
+
end
|
101
|
+
|
102
|
+
# Delete and disable a Webhook for an Inbox
|
103
|
+
# @param inbox_id [String] inboxId
|
104
|
+
# @param webhook_id [String] webhookId
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
107
|
+
def delete_webhook_with_http_info(inbox_id, webhook_id, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.delete_webhook ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'inbox_id' is set
|
112
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.delete_webhook"
|
114
|
+
end
|
115
|
+
# verify the required parameter 'webhook_id' is set
|
116
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.delete_webhook"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/inboxes/{inboxId}/webhooks/{webhookId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
|
128
|
+
# form parameters
|
129
|
+
form_params = opts[:form_params] || {}
|
130
|
+
|
131
|
+
# http body (model)
|
132
|
+
post_body = opts[:body]
|
133
|
+
|
134
|
+
# return_type
|
135
|
+
return_type = opts[:return_type]
|
136
|
+
|
137
|
+
# auth_names
|
138
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
139
|
+
|
140
|
+
new_options = opts.merge(
|
141
|
+
:header_params => header_params,
|
142
|
+
:query_params => query_params,
|
143
|
+
:form_params => form_params,
|
144
|
+
:body => post_body,
|
145
|
+
:auth_names => auth_names,
|
146
|
+
:return_type => return_type
|
147
|
+
)
|
148
|
+
|
149
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
150
|
+
if @api_client.config.debugging
|
151
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
152
|
+
end
|
153
|
+
return data, status_code, headers
|
154
|
+
end
|
155
|
+
|
156
|
+
# List Webhooks Paginated
|
157
|
+
# List webhooks in paginated form. Allows for page index, page size, and sort direction.
|
158
|
+
# @param [Hash] opts the optional parameters
|
159
|
+
# @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
|
160
|
+
# @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
|
161
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
162
|
+
# @return [PageWebhookProjection]
|
163
|
+
def get_all_webhooks(opts = {})
|
164
|
+
data, _status_code, _headers = get_all_webhooks_with_http_info(opts)
|
165
|
+
data
|
166
|
+
end
|
167
|
+
|
168
|
+
# List Webhooks Paginated
|
169
|
+
# List webhooks in paginated form. Allows for page index, page size, and sort direction.
|
170
|
+
# @param [Hash] opts the optional parameters
|
171
|
+
# @option opts [Integer] :page Optional page index in inbox list pagination
|
172
|
+
# @option opts [Integer] :size Optional page size in inbox list pagination
|
173
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
174
|
+
# @return [Array<(PageWebhookProjection, Integer, Hash)>] PageWebhookProjection data, response status code and response headers
|
175
|
+
def get_all_webhooks_with_http_info(opts = {})
|
176
|
+
if @api_client.config.debugging
|
177
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_all_webhooks ...'
|
178
|
+
end
|
179
|
+
allowable_values = ["ASC", "DESC"]
|
180
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
181
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
182
|
+
end
|
183
|
+
# resource path
|
184
|
+
local_var_path = '/webhooks/paginated'
|
185
|
+
|
186
|
+
# query parameters
|
187
|
+
query_params = opts[:query_params] || {}
|
188
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
189
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
190
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
191
|
+
|
192
|
+
# header parameters
|
193
|
+
header_params = opts[:header_params] || {}
|
194
|
+
# HTTP header 'Accept' (if needed)
|
195
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
196
|
+
|
197
|
+
# form parameters
|
198
|
+
form_params = opts[:form_params] || {}
|
199
|
+
|
200
|
+
# http body (model)
|
201
|
+
post_body = opts[:body]
|
202
|
+
|
203
|
+
# return_type
|
204
|
+
return_type = opts[:return_type] || 'PageWebhookProjection'
|
205
|
+
|
206
|
+
# auth_names
|
207
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
208
|
+
|
209
|
+
new_options = opts.merge(
|
210
|
+
:header_params => header_params,
|
211
|
+
:query_params => query_params,
|
212
|
+
:form_params => form_params,
|
213
|
+
:body => post_body,
|
214
|
+
:auth_names => auth_names,
|
215
|
+
:return_type => return_type
|
216
|
+
)
|
217
|
+
|
218
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
219
|
+
if @api_client.config.debugging
|
220
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#get_all_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
221
|
+
end
|
222
|
+
return data, status_code, headers
|
223
|
+
end
|
224
|
+
|
225
|
+
# Get a webhook for an Inbox
|
226
|
+
# @param webhook_id [String] webhookId
|
227
|
+
# @param [Hash] opts the optional parameters
|
228
|
+
# @return [WebhookDto]
|
229
|
+
def get_webhook(webhook_id, opts = {})
|
230
|
+
data, _status_code, _headers = get_webhook_with_http_info(webhook_id, opts)
|
231
|
+
data
|
232
|
+
end
|
233
|
+
|
234
|
+
# Get a webhook for an Inbox
|
235
|
+
# @param webhook_id [String] webhookId
|
236
|
+
# @param [Hash] opts the optional parameters
|
237
|
+
# @return [Array<(WebhookDto, Integer, Hash)>] WebhookDto data, response status code and response headers
|
238
|
+
def get_webhook_with_http_info(webhook_id, opts = {})
|
239
|
+
if @api_client.config.debugging
|
240
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook ...'
|
241
|
+
end
|
242
|
+
# verify the required parameter 'webhook_id' is set
|
243
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
244
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_webhook"
|
245
|
+
end
|
246
|
+
# resource path
|
247
|
+
local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))
|
248
|
+
|
249
|
+
# query parameters
|
250
|
+
query_params = opts[:query_params] || {}
|
251
|
+
|
252
|
+
# header parameters
|
253
|
+
header_params = opts[:header_params] || {}
|
254
|
+
# HTTP header 'Accept' (if needed)
|
255
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
256
|
+
|
257
|
+
# form parameters
|
258
|
+
form_params = opts[:form_params] || {}
|
259
|
+
|
260
|
+
# http body (model)
|
261
|
+
post_body = opts[:body]
|
262
|
+
|
263
|
+
# return_type
|
264
|
+
return_type = opts[:return_type] || 'WebhookDto'
|
265
|
+
|
266
|
+
# auth_names
|
267
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
268
|
+
|
269
|
+
new_options = opts.merge(
|
270
|
+
:header_params => header_params,
|
271
|
+
:query_params => query_params,
|
272
|
+
:form_params => form_params,
|
273
|
+
:body => post_body,
|
274
|
+
:auth_names => auth_names,
|
275
|
+
:return_type => return_type
|
276
|
+
)
|
277
|
+
|
278
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
279
|
+
if @api_client.config.debugging
|
280
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
281
|
+
end
|
282
|
+
return data, status_code, headers
|
283
|
+
end
|
284
|
+
|
285
|
+
# Get all Webhooks for an Inbox
|
286
|
+
# @param inbox_id [String] inboxId
|
287
|
+
# @param [Hash] opts the optional parameters
|
288
|
+
# @return [Array<WebhookDto>]
|
289
|
+
def get_webhooks(inbox_id, opts = {})
|
290
|
+
data, _status_code, _headers = get_webhooks_with_http_info(inbox_id, opts)
|
291
|
+
data
|
292
|
+
end
|
293
|
+
|
294
|
+
# Get all Webhooks for an Inbox
|
295
|
+
# @param inbox_id [String] inboxId
|
296
|
+
# @param [Hash] opts the optional parameters
|
297
|
+
# @return [Array<(Array<WebhookDto>, Integer, Hash)>] Array<WebhookDto> data, response status code and response headers
|
298
|
+
def get_webhooks_with_http_info(inbox_id, opts = {})
|
299
|
+
if @api_client.config.debugging
|
300
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhooks ...'
|
301
|
+
end
|
302
|
+
# verify the required parameter 'inbox_id' is set
|
303
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
304
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.get_webhooks"
|
305
|
+
end
|
306
|
+
# resource path
|
307
|
+
local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
308
|
+
|
309
|
+
# query parameters
|
310
|
+
query_params = opts[:query_params] || {}
|
311
|
+
|
312
|
+
# header parameters
|
313
|
+
header_params = opts[:header_params] || {}
|
314
|
+
# HTTP header 'Accept' (if needed)
|
315
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
316
|
+
|
317
|
+
# form parameters
|
318
|
+
form_params = opts[:form_params] || {}
|
319
|
+
|
320
|
+
# http body (model)
|
321
|
+
post_body = opts[:body]
|
322
|
+
|
323
|
+
# return_type
|
324
|
+
return_type = opts[:return_type] || 'Array<WebhookDto>'
|
325
|
+
|
326
|
+
# auth_names
|
327
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
328
|
+
|
329
|
+
new_options = opts.merge(
|
330
|
+
:header_params => header_params,
|
331
|
+
:query_params => query_params,
|
332
|
+
:form_params => form_params,
|
333
|
+
:body => post_body,
|
334
|
+
:auth_names => auth_names,
|
335
|
+
:return_type => return_type
|
336
|
+
)
|
337
|
+
|
338
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
339
|
+
if @api_client.config.debugging
|
340
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#get_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
341
|
+
end
|
342
|
+
return data, status_code, headers
|
343
|
+
end
|
344
|
+
|
345
|
+
# Send webhook test data
|
346
|
+
# @param webhook_id [String] webhookId
|
347
|
+
# @param [Hash] opts the optional parameters
|
348
|
+
# @return [WebhookTestResult]
|
349
|
+
def send_test_data(webhook_id, opts = {})
|
350
|
+
data, _status_code, _headers = send_test_data_with_http_info(webhook_id, opts)
|
351
|
+
data
|
352
|
+
end
|
353
|
+
|
354
|
+
# Send webhook test data
|
355
|
+
# @param webhook_id [String] webhookId
|
356
|
+
# @param [Hash] opts the optional parameters
|
357
|
+
# @return [Array<(WebhookTestResult, Integer, Hash)>] WebhookTestResult data, response status code and response headers
|
358
|
+
def send_test_data_with_http_info(webhook_id, opts = {})
|
359
|
+
if @api_client.config.debugging
|
360
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.send_test_data ...'
|
361
|
+
end
|
362
|
+
# verify the required parameter 'webhook_id' is set
|
363
|
+
if @api_client.config.client_side_validation && webhook_id.nil?
|
364
|
+
fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.send_test_data"
|
365
|
+
end
|
366
|
+
# resource path
|
367
|
+
local_var_path = '/webhooks/{webhookId}/test'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))
|
368
|
+
|
369
|
+
# query parameters
|
370
|
+
query_params = opts[:query_params] || {}
|
371
|
+
|
372
|
+
# header parameters
|
373
|
+
header_params = opts[:header_params] || {}
|
374
|
+
# HTTP header 'Accept' (if needed)
|
375
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
376
|
+
|
377
|
+
# form parameters
|
378
|
+
form_params = opts[:form_params] || {}
|
379
|
+
|
380
|
+
# http body (model)
|
381
|
+
post_body = opts[:body]
|
382
|
+
|
383
|
+
# return_type
|
384
|
+
return_type = opts[:return_type] || 'WebhookTestResult'
|
385
|
+
|
386
|
+
# auth_names
|
387
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
388
|
+
|
389
|
+
new_options = opts.merge(
|
390
|
+
:header_params => header_params,
|
391
|
+
:query_params => query_params,
|
392
|
+
:form_params => form_params,
|
393
|
+
:body => post_body,
|
394
|
+
:auth_names => auth_names,
|
395
|
+
:return_type => return_type
|
396
|
+
)
|
397
|
+
|
398
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
399
|
+
if @api_client.config.debugging
|
400
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#send_test_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
401
|
+
end
|
402
|
+
return data, status_code, headers
|
403
|
+
end
|
404
|
+
end
|
405
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#MailSlurp API
|
3
3
|
|
4
|
-
#
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
|
5
7
|
|
6
|
-
OpenAPI spec version: 0.0.1-alpha
|
7
|
-
Contact: contact@mailslurp.dev
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -15,7 +15,6 @@ require 'json'
|
|
15
15
|
require 'logger'
|
16
16
|
require 'tempfile'
|
17
17
|
require 'typhoeus'
|
18
|
-
require 'uri'
|
19
18
|
|
20
19
|
module MailSlurpClient
|
21
20
|
class ApiClient
|
@@ -44,7 +43,7 @@ module MailSlurpClient
|
|
44
43
|
|
45
44
|
# Call an API with given options.
|
46
45
|
#
|
47
|
-
# @return [Array<(Object,
|
46
|
+
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
47
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
49
48
|
def call_api(http_method, path, opts = {})
|
50
49
|
request = build_request(http_method, path, opts)
|
@@ -128,6 +127,34 @@ module MailSlurpClient
|
|
128
127
|
request
|
129
128
|
end
|
130
129
|
|
130
|
+
# Builds the HTTP request body
|
131
|
+
#
|
132
|
+
# @param [Hash] header_params Header parameters
|
133
|
+
# @param [Hash] form_params Query parameters
|
134
|
+
# @param [Object] body HTTP body (JSON/XML)
|
135
|
+
# @return [String] HTTP body data in the form of string
|
136
|
+
def build_request_body(header_params, form_params, body)
|
137
|
+
# http form
|
138
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
139
|
+
header_params['Content-Type'] == 'multipart/form-data'
|
140
|
+
data = {}
|
141
|
+
form_params.each do |key, value|
|
142
|
+
case value
|
143
|
+
when ::File, ::Array, nil
|
144
|
+
# let typhoeus handle File, Array and nil parameters
|
145
|
+
data[key] = value
|
146
|
+
else
|
147
|
+
data[key] = value.to_s
|
148
|
+
end
|
149
|
+
end
|
150
|
+
elsif body
|
151
|
+
data = body.is_a?(String) ? body : body.to_json
|
152
|
+
else
|
153
|
+
data = nil
|
154
|
+
end
|
155
|
+
data
|
156
|
+
end
|
157
|
+
|
131
158
|
# Check if the given MIME is a JSON MIME.
|
132
159
|
# JSON MIME examples:
|
133
160
|
# application/json
|
@@ -187,7 +214,7 @@ module MailSlurpClient
|
|
187
214
|
data.to_i
|
188
215
|
when 'Float'
|
189
216
|
data.to_f
|
190
|
-
when '
|
217
|
+
when 'Boolean'
|
191
218
|
data == true
|
192
219
|
when 'DateTime'
|
193
220
|
# parse date time (expecting ISO 8601 format)
|
@@ -210,9 +237,7 @@ module MailSlurpClient
|
|
210
237
|
end
|
211
238
|
else
|
212
239
|
# models, e.g. Pet
|
213
|
-
MailSlurpClient.const_get(return_type).
|
214
|
-
model.build_from_hash data
|
215
|
-
end
|
240
|
+
MailSlurpClient.const_get(return_type).build_from_hash(data)
|
216
241
|
end
|
217
242
|
end
|
218
243
|
|
@@ -264,35 +289,7 @@ module MailSlurpClient
|
|
264
289
|
def build_request_url(path)
|
265
290
|
# Add leading and trailing slashes to path
|
266
291
|
path = "/#{path}".gsub(/\/+/, '/')
|
267
|
-
|
268
|
-
end
|
269
|
-
|
270
|
-
# Builds the HTTP request body
|
271
|
-
#
|
272
|
-
# @param [Hash] header_params Header parameters
|
273
|
-
# @param [Hash] form_params Query parameters
|
274
|
-
# @param [Object] body HTTP body (JSON/XML)
|
275
|
-
# @return [String] HTTP body data in the form of string
|
276
|
-
def build_request_body(header_params, form_params, body)
|
277
|
-
# http form
|
278
|
-
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
279
|
-
header_params['Content-Type'] == 'multipart/form-data'
|
280
|
-
data = {}
|
281
|
-
form_params.each do |key, value|
|
282
|
-
case value
|
283
|
-
when ::File, ::Array, nil
|
284
|
-
# let typhoeus handle File, Array and nil parameters
|
285
|
-
data[key] = value
|
286
|
-
else
|
287
|
-
data[key] = value.to_s
|
288
|
-
end
|
289
|
-
end
|
290
|
-
elsif body
|
291
|
-
data = body.is_a?(String) ? body : body.to_json
|
292
|
-
else
|
293
|
-
data = nil
|
294
|
-
end
|
295
|
-
data
|
292
|
+
@config.base_url + path
|
296
293
|
end
|
297
294
|
|
298
295
|
# Update hearder and query params based on authentication settings.
|