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,201 @@
|
|
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 CommonActionsControllerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create new random inbox
|
23
|
+
# Returns an Inbox with an `id` and an `emailAddress`
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Inbox]
|
26
|
+
def create_new_email_address(opts = {})
|
27
|
+
data, _status_code, _headers = create_new_email_address_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create new random inbox
|
32
|
+
# Returns an Inbox with an `id` and an `emailAddress`
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
|
35
|
+
def create_new_email_address_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: CommonActionsControllerApi.create_new_email_address ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/newEmailAddress'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:return_type] || 'Inbox'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => return_type
|
69
|
+
)
|
70
|
+
|
71
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
72
|
+
if @api_client.config.debugging
|
73
|
+
@api_client.config.logger.debug "API called: CommonActionsControllerApi#create_new_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
|
+
end
|
75
|
+
return data, status_code, headers
|
76
|
+
end
|
77
|
+
|
78
|
+
# Delete all emails in an inbox
|
79
|
+
# Deletes all emails
|
80
|
+
# @param inbox_id [String] inboxId
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [nil]
|
83
|
+
def empty_inbox(inbox_id, opts = {})
|
84
|
+
empty_inbox_with_http_info(inbox_id, opts)
|
85
|
+
nil
|
86
|
+
end
|
87
|
+
|
88
|
+
# Delete all emails in an inbox
|
89
|
+
# Deletes all emails
|
90
|
+
# @param inbox_id [String] inboxId
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
93
|
+
def empty_inbox_with_http_info(inbox_id, opts = {})
|
94
|
+
if @api_client.config.debugging
|
95
|
+
@api_client.config.logger.debug 'Calling API: CommonActionsControllerApi.empty_inbox ...'
|
96
|
+
end
|
97
|
+
# verify the required parameter 'inbox_id' is set
|
98
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
99
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling CommonActionsControllerApi.empty_inbox"
|
100
|
+
end
|
101
|
+
# resource path
|
102
|
+
local_var_path = '/emptyInbox'
|
103
|
+
|
104
|
+
# query parameters
|
105
|
+
query_params = opts[:query_params] || {}
|
106
|
+
query_params[:'inboxId'] = inbox_id
|
107
|
+
|
108
|
+
# header parameters
|
109
|
+
header_params = opts[:header_params] || {}
|
110
|
+
|
111
|
+
# form parameters
|
112
|
+
form_params = opts[:form_params] || {}
|
113
|
+
|
114
|
+
# http body (model)
|
115
|
+
post_body = opts[:body]
|
116
|
+
|
117
|
+
# return_type
|
118
|
+
return_type = opts[:return_type]
|
119
|
+
|
120
|
+
# auth_names
|
121
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
122
|
+
|
123
|
+
new_options = opts.merge(
|
124
|
+
:header_params => header_params,
|
125
|
+
:query_params => query_params,
|
126
|
+
:form_params => form_params,
|
127
|
+
:body => post_body,
|
128
|
+
:auth_names => auth_names,
|
129
|
+
:return_type => return_type
|
130
|
+
)
|
131
|
+
|
132
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
133
|
+
if @api_client.config.debugging
|
134
|
+
@api_client.config.logger.debug "API called: CommonActionsControllerApi#empty_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
135
|
+
end
|
136
|
+
return data, status_code, headers
|
137
|
+
end
|
138
|
+
|
139
|
+
# Send an email from a random email address
|
140
|
+
# To specify an email address first create an inbox and use that with the other send email methods
|
141
|
+
# @param send_email_options [SendEmailOptions] sendEmailOptions
|
142
|
+
# @param [Hash] opts the optional parameters
|
143
|
+
# @return [nil]
|
144
|
+
def send_email_simple(send_email_options, opts = {})
|
145
|
+
send_email_simple_with_http_info(send_email_options, opts)
|
146
|
+
nil
|
147
|
+
end
|
148
|
+
|
149
|
+
# Send an email from a random email address
|
150
|
+
# To specify an email address first create an inbox and use that with the other send email methods
|
151
|
+
# @param send_email_options [SendEmailOptions] sendEmailOptions
|
152
|
+
# @param [Hash] opts the optional parameters
|
153
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
154
|
+
def send_email_simple_with_http_info(send_email_options, opts = {})
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug 'Calling API: CommonActionsControllerApi.send_email_simple ...'
|
157
|
+
end
|
158
|
+
# verify the required parameter 'send_email_options' is set
|
159
|
+
if @api_client.config.client_side_validation && send_email_options.nil?
|
160
|
+
fail ArgumentError, "Missing the required parameter 'send_email_options' when calling CommonActionsControllerApi.send_email_simple"
|
161
|
+
end
|
162
|
+
# resource path
|
163
|
+
local_var_path = '/sendEmail'
|
164
|
+
|
165
|
+
# query parameters
|
166
|
+
query_params = opts[:query_params] || {}
|
167
|
+
|
168
|
+
# header parameters
|
169
|
+
header_params = opts[:header_params] || {}
|
170
|
+
# HTTP header 'Content-Type'
|
171
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
172
|
+
|
173
|
+
# form parameters
|
174
|
+
form_params = opts[:form_params] || {}
|
175
|
+
|
176
|
+
# http body (model)
|
177
|
+
post_body = opts[:body] || @api_client.object_to_http_body(send_email_options)
|
178
|
+
|
179
|
+
# return_type
|
180
|
+
return_type = opts[:return_type]
|
181
|
+
|
182
|
+
# auth_names
|
183
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
184
|
+
|
185
|
+
new_options = opts.merge(
|
186
|
+
:header_params => header_params,
|
187
|
+
:query_params => query_params,
|
188
|
+
:form_params => form_params,
|
189
|
+
:body => post_body,
|
190
|
+
:auth_names => auth_names,
|
191
|
+
:return_type => return_type
|
192
|
+
)
|
193
|
+
|
194
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
195
|
+
if @api_client.config.debugging
|
196
|
+
@api_client.config.logger.debug "API called: CommonActionsControllerApi#send_email_simple\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
197
|
+
end
|
198
|
+
return data, status_code, headers
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
@@ -0,0 +1,323 @@
|
|
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 ContactControllerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a contact
|
23
|
+
# @param create_contact_options [CreateContactOptions] createContactOptions
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [ContactDto]
|
26
|
+
def create_contact(create_contact_options, opts = {})
|
27
|
+
data, _status_code, _headers = create_contact_with_http_info(create_contact_options, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create a contact
|
32
|
+
# @param create_contact_options [CreateContactOptions] createContactOptions
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(ContactDto, Integer, Hash)>] ContactDto data, response status code and response headers
|
35
|
+
def create_contact_with_http_info(create_contact_options, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: ContactControllerApi.create_contact ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'create_contact_options' is set
|
40
|
+
if @api_client.config.client_side_validation && create_contact_options.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'create_contact_options' when calling ContactControllerApi.create_contact"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/contacts'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
53
|
+
# HTTP header 'Content-Type'
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_contact_options)
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'ContactDto'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: ContactControllerApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Delete contact
|
85
|
+
# @param contact_id [String] contactId
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [nil]
|
88
|
+
def delete_contact(contact_id, opts = {})
|
89
|
+
delete_contact_with_http_info(contact_id, opts)
|
90
|
+
nil
|
91
|
+
end
|
92
|
+
|
93
|
+
# Delete contact
|
94
|
+
# @param contact_id [String] contactId
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
97
|
+
def delete_contact_with_http_info(contact_id, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: ContactControllerApi.delete_contact ...'
|
100
|
+
end
|
101
|
+
# verify the required parameter 'contact_id' is set
|
102
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactControllerApi.delete_contact"
|
104
|
+
end
|
105
|
+
# resource path
|
106
|
+
local_var_path = '/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
107
|
+
|
108
|
+
# query parameters
|
109
|
+
query_params = opts[:query_params] || {}
|
110
|
+
|
111
|
+
# header parameters
|
112
|
+
header_params = opts[:header_params] || {}
|
113
|
+
|
114
|
+
# form parameters
|
115
|
+
form_params = opts[:form_params] || {}
|
116
|
+
|
117
|
+
# http body (model)
|
118
|
+
post_body = opts[:body]
|
119
|
+
|
120
|
+
# return_type
|
121
|
+
return_type = opts[:return_type]
|
122
|
+
|
123
|
+
# auth_names
|
124
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
125
|
+
|
126
|
+
new_options = opts.merge(
|
127
|
+
:header_params => header_params,
|
128
|
+
:query_params => query_params,
|
129
|
+
:form_params => form_params,
|
130
|
+
:body => post_body,
|
131
|
+
:auth_names => auth_names,
|
132
|
+
:return_type => return_type
|
133
|
+
)
|
134
|
+
|
135
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
136
|
+
if @api_client.config.debugging
|
137
|
+
@api_client.config.logger.debug "API called: ContactControllerApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
138
|
+
end
|
139
|
+
return data, status_code, headers
|
140
|
+
end
|
141
|
+
|
142
|
+
# Get all contacts
|
143
|
+
# @param [Hash] opts the optional parameters
|
144
|
+
# @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
|
145
|
+
# @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
|
146
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
147
|
+
# @return [PageContactProjection]
|
148
|
+
def get_all_contacts(opts = {})
|
149
|
+
data, _status_code, _headers = get_all_contacts_with_http_info(opts)
|
150
|
+
data
|
151
|
+
end
|
152
|
+
|
153
|
+
# Get all contacts
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @option opts [Integer] :page Optional page index in inbox list pagination
|
156
|
+
# @option opts [Integer] :size Optional page size in inbox list pagination
|
157
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
158
|
+
# @return [Array<(PageContactProjection, Integer, Hash)>] PageContactProjection data, response status code and response headers
|
159
|
+
def get_all_contacts_with_http_info(opts = {})
|
160
|
+
if @api_client.config.debugging
|
161
|
+
@api_client.config.logger.debug 'Calling API: ContactControllerApi.get_all_contacts ...'
|
162
|
+
end
|
163
|
+
allowable_values = ["ASC", "DESC"]
|
164
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
165
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
166
|
+
end
|
167
|
+
# resource path
|
168
|
+
local_var_path = '/contacts/paginated'
|
169
|
+
|
170
|
+
# query parameters
|
171
|
+
query_params = opts[:query_params] || {}
|
172
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
173
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
174
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
175
|
+
|
176
|
+
# header parameters
|
177
|
+
header_params = opts[:header_params] || {}
|
178
|
+
# HTTP header 'Accept' (if needed)
|
179
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
180
|
+
|
181
|
+
# form parameters
|
182
|
+
form_params = opts[:form_params] || {}
|
183
|
+
|
184
|
+
# http body (model)
|
185
|
+
post_body = opts[:body]
|
186
|
+
|
187
|
+
# return_type
|
188
|
+
return_type = opts[:return_type] || 'PageContactProjection'
|
189
|
+
|
190
|
+
# auth_names
|
191
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
192
|
+
|
193
|
+
new_options = opts.merge(
|
194
|
+
:header_params => header_params,
|
195
|
+
:query_params => query_params,
|
196
|
+
:form_params => form_params,
|
197
|
+
:body => post_body,
|
198
|
+
:auth_names => auth_names,
|
199
|
+
:return_type => return_type
|
200
|
+
)
|
201
|
+
|
202
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
203
|
+
if @api_client.config.debugging
|
204
|
+
@api_client.config.logger.debug "API called: ContactControllerApi#get_all_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
205
|
+
end
|
206
|
+
return data, status_code, headers
|
207
|
+
end
|
208
|
+
|
209
|
+
# Get contact
|
210
|
+
# @param contact_id [String] contactId
|
211
|
+
# @param [Hash] opts the optional parameters
|
212
|
+
# @return [ContactDto]
|
213
|
+
def get_contact(contact_id, opts = {})
|
214
|
+
data, _status_code, _headers = get_contact_with_http_info(contact_id, opts)
|
215
|
+
data
|
216
|
+
end
|
217
|
+
|
218
|
+
# Get contact
|
219
|
+
# @param contact_id [String] contactId
|
220
|
+
# @param [Hash] opts the optional parameters
|
221
|
+
# @return [Array<(ContactDto, Integer, Hash)>] ContactDto data, response status code and response headers
|
222
|
+
def get_contact_with_http_info(contact_id, opts = {})
|
223
|
+
if @api_client.config.debugging
|
224
|
+
@api_client.config.logger.debug 'Calling API: ContactControllerApi.get_contact ...'
|
225
|
+
end
|
226
|
+
# verify the required parameter 'contact_id' is set
|
227
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
228
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactControllerApi.get_contact"
|
229
|
+
end
|
230
|
+
# resource path
|
231
|
+
local_var_path = '/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
232
|
+
|
233
|
+
# query parameters
|
234
|
+
query_params = opts[:query_params] || {}
|
235
|
+
|
236
|
+
# header parameters
|
237
|
+
header_params = opts[:header_params] || {}
|
238
|
+
# HTTP header 'Accept' (if needed)
|
239
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
240
|
+
|
241
|
+
# form parameters
|
242
|
+
form_params = opts[:form_params] || {}
|
243
|
+
|
244
|
+
# http body (model)
|
245
|
+
post_body = opts[:body]
|
246
|
+
|
247
|
+
# return_type
|
248
|
+
return_type = opts[:return_type] || 'ContactDto'
|
249
|
+
|
250
|
+
# auth_names
|
251
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
252
|
+
|
253
|
+
new_options = opts.merge(
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names,
|
259
|
+
:return_type => return_type
|
260
|
+
)
|
261
|
+
|
262
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
263
|
+
if @api_client.config.debugging
|
264
|
+
@api_client.config.logger.debug "API called: ContactControllerApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
265
|
+
end
|
266
|
+
return data, status_code, headers
|
267
|
+
end
|
268
|
+
|
269
|
+
# Get all contacts
|
270
|
+
# @param [Hash] opts the optional parameters
|
271
|
+
# @return [Array<ContactProjection>]
|
272
|
+
def get_contacts(opts = {})
|
273
|
+
data, _status_code, _headers = get_contacts_with_http_info(opts)
|
274
|
+
data
|
275
|
+
end
|
276
|
+
|
277
|
+
# Get all contacts
|
278
|
+
# @param [Hash] opts the optional parameters
|
279
|
+
# @return [Array<(Array<ContactProjection>, Integer, Hash)>] Array<ContactProjection> data, response status code and response headers
|
280
|
+
def get_contacts_with_http_info(opts = {})
|
281
|
+
if @api_client.config.debugging
|
282
|
+
@api_client.config.logger.debug 'Calling API: ContactControllerApi.get_contacts ...'
|
283
|
+
end
|
284
|
+
# resource path
|
285
|
+
local_var_path = '/contacts'
|
286
|
+
|
287
|
+
# query parameters
|
288
|
+
query_params = opts[:query_params] || {}
|
289
|
+
|
290
|
+
# header parameters
|
291
|
+
header_params = opts[:header_params] || {}
|
292
|
+
# HTTP header 'Accept' (if needed)
|
293
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
294
|
+
|
295
|
+
# form parameters
|
296
|
+
form_params = opts[:form_params] || {}
|
297
|
+
|
298
|
+
# http body (model)
|
299
|
+
post_body = opts[:body]
|
300
|
+
|
301
|
+
# return_type
|
302
|
+
return_type = opts[:return_type] || 'Array<ContactProjection>'
|
303
|
+
|
304
|
+
# auth_names
|
305
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
306
|
+
|
307
|
+
new_options = opts.merge(
|
308
|
+
:header_params => header_params,
|
309
|
+
:query_params => query_params,
|
310
|
+
:form_params => form_params,
|
311
|
+
:body => post_body,
|
312
|
+
:auth_names => auth_names,
|
313
|
+
:return_type => return_type
|
314
|
+
)
|
315
|
+
|
316
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
317
|
+
if @api_client.config.debugging
|
318
|
+
@api_client.config.logger.debug "API called: ContactControllerApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
319
|
+
end
|
320
|
+
return data, status_code, headers
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|