mailslurp_client 8.0.6 → 8.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +7 -0
  3. data/README.md +117 -0
  4. data/SECURITY.md +4 -0
  5. data/SUPPORT.md +4 -0
  6. data/lib/mailslurp_client/api/alias_controller_api.rb +405 -0
  7. data/lib/mailslurp_client/api/attachment_controller_api.rb +160 -0
  8. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +203 -0
  9. data/lib/mailslurp_client/api/common_actions_controller_api.rb +257 -0
  10. data/lib/mailslurp_client/api/contact_controller_api.rb +323 -0
  11. data/lib/mailslurp_client/api/domain_controller_api.rb +264 -0
  12. data/lib/mailslurp_client/api/email_controller_api.rb +852 -0
  13. data/lib/mailslurp_client/api/form_controller_api.rb +104 -0
  14. data/lib/mailslurp_client/api/group_controller_api.rb +592 -0
  15. data/lib/mailslurp_client/api/inbox_controller_api.rb +897 -0
  16. data/lib/mailslurp_client/api/mail_server_controller_api.rb +146 -0
  17. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +152 -0
  18. data/lib/mailslurp_client/api/template_controller_api.rb +323 -0
  19. data/lib/mailslurp_client/api/wait_for_controller_api.rb +359 -0
  20. data/lib/mailslurp_client/api/webhook_controller_api.rb +405 -0
  21. data/lib/mailslurp_client/api_client.rb +388 -0
  22. data/lib/mailslurp_client/api_error.rb +57 -0
  23. data/lib/mailslurp_client/configuration.rb +248 -0
  24. data/lib/mailslurp_client/models/attachment_meta_data.rb +238 -0
  25. data/lib/mailslurp_client/models/basic_auth_options.rb +226 -0
  26. data/lib/mailslurp_client/models/bulk_send_email_options.rb +219 -0
  27. data/lib/mailslurp_client/models/contact_dto.rb +311 -0
  28. data/lib/mailslurp_client/models/contact_projection.rb +270 -0
  29. data/lib/mailslurp_client/models/create_anonymous_alias_options.rb +208 -0
  30. data/lib/mailslurp_client/models/create_contact_options.rb +277 -0
  31. data/lib/mailslurp_client/models/create_domain_options.rb +208 -0
  32. data/lib/mailslurp_client/models/create_group_options.rb +220 -0
  33. data/lib/mailslurp_client/models/create_owned_alias_options.rb +238 -0
  34. data/lib/mailslurp_client/models/create_template_options.rb +225 -0
  35. data/lib/mailslurp_client/models/create_webhook_options.rb +227 -0
  36. data/lib/mailslurp_client/models/describe_domain_options.rb +211 -0
  37. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +237 -0
  38. data/lib/mailslurp_client/models/domain_dto.rb +296 -0
  39. data/lib/mailslurp_client/models/domain_preview.rb +240 -0
  40. data/lib/mailslurp_client/models/email.rb +386 -0
  41. data/lib/mailslurp_client/models/email_analysis.rb +248 -0
  42. data/lib/mailslurp_client/models/email_preview.rb +296 -0
  43. data/lib/mailslurp_client/models/email_projection.rb +325 -0
  44. data/lib/mailslurp_client/models/email_verification_result.rb +263 -0
  45. data/lib/mailslurp_client/models/forward_email_options.rb +244 -0
  46. data/lib/mailslurp_client/models/group_contacts_dto.rb +227 -0
  47. data/lib/mailslurp_client/models/group_dto.rb +248 -0
  48. data/lib/mailslurp_client/models/group_projection.rb +248 -0
  49. data/lib/mailslurp_client/models/html_validation_result.rb +244 -0
  50. data/lib/mailslurp_client/models/inbox.rb +290 -0
  51. data/lib/mailslurp_client/models/inbox_projection.rb +263 -0
  52. data/lib/mailslurp_client/models/match_option.rb +274 -0
  53. data/lib/mailslurp_client/models/match_options.rb +210 -0
  54. data/lib/mailslurp_client/models/model_alias.rb +284 -0
  55. data/lib/mailslurp_client/models/name_server_record.rb +254 -0
  56. data/lib/mailslurp_client/models/page_alias.rb +298 -0
  57. data/lib/mailslurp_client/models/page_contact_projection.rb +298 -0
  58. data/lib/mailslurp_client/models/page_email_preview.rb +298 -0
  59. data/lib/mailslurp_client/models/page_email_projection.rb +298 -0
  60. data/lib/mailslurp_client/models/page_group_projection.rb +298 -0
  61. data/lib/mailslurp_client/models/page_inbox_projection.rb +298 -0
  62. data/lib/mailslurp_client/models/page_sent_email_projection.rb +298 -0
  63. data/lib/mailslurp_client/models/page_template_projection.rb +298 -0
  64. data/lib/mailslurp_client/models/page_webhook_projection.rb +298 -0
  65. data/lib/mailslurp_client/models/pageable.rb +251 -0
  66. data/lib/mailslurp_client/models/raw_email_json.rb +211 -0
  67. data/lib/mailslurp_client/models/send_email_options.rb +392 -0
  68. data/lib/mailslurp_client/models/sent_email_dto.rb +351 -0
  69. data/lib/mailslurp_client/models/sent_email_projection.rb +344 -0
  70. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +208 -0
  71. data/lib/mailslurp_client/models/simple_send_email_options.rb +237 -0
  72. data/lib/mailslurp_client/models/sort.rb +224 -0
  73. data/lib/mailslurp_client/models/template_dto.rb +269 -0
  74. data/lib/mailslurp_client/models/template_projection.rb +269 -0
  75. data/lib/mailslurp_client/models/template_variable.rb +259 -0
  76. data/lib/mailslurp_client/models/unread_count.rb +211 -0
  77. data/lib/mailslurp_client/models/update_group_contacts.rb +213 -0
  78. data/lib/mailslurp_client/models/update_inbox_options.rb +250 -0
  79. data/lib/mailslurp_client/models/upload_attachment_options.rb +228 -0
  80. data/lib/mailslurp_client/models/validation_dto.rb +217 -0
  81. data/lib/mailslurp_client/models/validation_message.rb +220 -0
  82. data/lib/mailslurp_client/models/verify_email_address_options.rb +239 -0
  83. data/lib/mailslurp_client/models/wait_for_conditions.rb +316 -0
  84. data/lib/mailslurp_client/models/webhook_dto.rb +326 -0
  85. data/lib/mailslurp_client/models/webhook_projection.rb +277 -0
  86. data/lib/mailslurp_client/models/webhook_test_request.rb +284 -0
  87. data/lib/mailslurp_client/models/webhook_test_response.rb +215 -0
  88. data/lib/mailslurp_client/models/webhook_test_result.rb +235 -0
  89. data/lib/mailslurp_client/version.rb +15 -0
  90. metadata +90 -2
@@ -0,0 +1,104 @@
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: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MailSlurpClient
16
+ class FormControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Submit a form to be parsed and sent as an email to an address determined by the form fields
23
+ # This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address or a `_toAlias` email alias ID to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://api.mailslurp.com/forms?_toAlias=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
26
+ # @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
27
+ # @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
28
+ # @option opts [String] :_subject Optional subject of the email that will be sent.
29
+ # @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
30
+ # @option opts [String] :_to The email address that submitted form should be sent to. Either this or _toAlias must be present for a form to be successfully submitted..
31
+ # @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
32
+ # @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
33
+ # @return [String]
34
+ def submit_form(opts = {})
35
+ data, _status_code, _headers = submit_form_with_http_info(opts)
36
+ data
37
+ end
38
+
39
+ # Submit a form to be parsed and sent as an email to an address determined by the form fields
40
+ # This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a &#x60;_to&#x60; email address or a &#x60;_toAlias&#x60; email alias ID to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding &#x60;name&#x60; attributes or as URL query parameters such as &#x60;?_to&#x3D;test@example.com&#x60; The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts &#x60;application/x-www-form-urlencoded&#x60;, and &#x60;multipart/form-data&#x60; content-types. #### HTML Example &#x60;&#x60;&#x60;html &lt;form action&#x3D;\&quot;https://api.mailslurp.com/forms\&quot; method&#x3D;\&quot;post\&quot; &gt; &lt;input name&#x3D;\&quot;_to\&quot; type&#x3D;\&quot;hidden\&quot; value&#x3D;\&quot;test@example.com\&quot;/&gt; &lt;textarea name&#x3D;\&quot;feedback\&quot;&gt;&lt;/textarea&gt; &lt;button type&#x3D;\&quot;submit\&quot;&gt;Submit&lt;/button&gt; &lt;/form&gt; &#x60;&#x60;&#x60; #### URL Example &#x60;&#x60;&#x60;html &lt;form action&#x3D;\&quot;https://api.mailslurp.com/forms?_toAlias&#x3D;test@example.com\&quot; method&#x3D;\&quot;post\&quot; &gt; &lt;textarea name&#x3D;\&quot;feedback\&quot;&gt;&lt;/textarea&gt; &lt;button type&#x3D;\&quot;submit\&quot;&gt;Submit&lt;/button&gt; &lt;/form&gt; &#x60;&#x60;&#x60; The email address is specified by a &#x60;_to&#x60; field OR is extracted from an email alias specified by a &#x60;_toAlias&#x60; field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the &#x60;enctype&#x60; attribute, for instance: &#x60;&lt;form enctype&#x3D;\&quot;multipart/form-data\&quot;&gt;&#x60;.
41
+ # @param [Hash] opts the optional parameters
42
+ # @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
43
+ # @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
44
+ # @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
45
+ # @option opts [String] :_subject Optional subject of the email that will be sent.
46
+ # @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
47
+ # @option opts [String] :_to The email address that submitted form should be sent to. Either this or _toAlias must be present for a form to be successfully submitted..
48
+ # @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
49
+ # @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
50
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
51
+ def submit_form_with_http_info(opts = {})
52
+ if @api_client.config.debugging
53
+ @api_client.config.logger.debug 'Calling API: FormControllerApi.submit_form ...'
54
+ end
55
+ # resource path
56
+ local_var_path = '/forms'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+ # HTTP header 'Content-Type'
66
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+ form_params['_emailAddress'] = opts[:'_email_address'] if !opts[:'_email_address'].nil?
71
+ form_params['_redirectTo'] = opts[:'_redirect_to'] if !opts[:'_redirect_to'].nil?
72
+ form_params['_spamCheck'] = opts[:'_spam_check'] if !opts[:'_spam_check'].nil?
73
+ form_params['_subject'] = opts[:'_subject'] if !opts[:'_subject'].nil?
74
+ form_params['_successMessage'] = opts[:'_success_message'] if !opts[:'_success_message'].nil?
75
+ form_params['_to'] = opts[:'_to'] if !opts[:'_to'].nil?
76
+ form_params['_toAlias'] = opts[:'_to_alias'] if !opts[:'_to_alias'].nil?
77
+ form_params['otherParameters'] = opts[:'other_parameters'] if !opts[:'other_parameters'].nil?
78
+
79
+ # http body (model)
80
+ post_body = opts[:body]
81
+
82
+ # return_type
83
+ return_type = opts[:return_type] || 'String'
84
+
85
+ # auth_names
86
+ auth_names = opts[:auth_names] || ['API_KEY']
87
+
88
+ new_options = opts.merge(
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: FormControllerApi#submit_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,592 @@
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: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MailSlurpClient
16
+ class GroupControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add contacts to a group
23
+ # @param group_id [String] groupId
24
+ # @param update_group_contacts_option [UpdateGroupContacts] updateGroupContactsOption
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [GroupContactsDto]
27
+ def add_contacts_to_group(group_id, update_group_contacts_option, opts = {})
28
+ data, _status_code, _headers = add_contacts_to_group_with_http_info(group_id, update_group_contacts_option, opts)
29
+ data
30
+ end
31
+
32
+ # Add contacts to a group
33
+ # @param group_id [String] groupId
34
+ # @param update_group_contacts_option [UpdateGroupContacts] updateGroupContactsOption
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(GroupContactsDto, Integer, Hash)>] GroupContactsDto data, response status code and response headers
37
+ def add_contacts_to_group_with_http_info(group_id, update_group_contacts_option, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.add_contacts_to_group ...'
40
+ end
41
+ # verify the required parameter 'group_id' is set
42
+ if @api_client.config.client_side_validation && group_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.add_contacts_to_group"
44
+ end
45
+ # verify the required parameter 'update_group_contacts_option' is set
46
+ if @api_client.config.client_side_validation && update_group_contacts_option.nil?
47
+ fail ArgumentError, "Missing the required parameter 'update_group_contacts_option' when calling GroupControllerApi.add_contacts_to_group"
48
+ end
49
+ # resource path
50
+ local_var_path = '/groups/{groupId}/contacts'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:body] || @api_client.object_to_http_body(update_group_contacts_option)
67
+
68
+ # return_type
69
+ return_type = opts[:return_type] || 'GroupContactsDto'
70
+
71
+ # auth_names
72
+ auth_names = opts[:auth_names] || ['API_KEY']
73
+
74
+ new_options = opts.merge(
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: GroupControllerApi#add_contacts_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Create a group
91
+ # @param create_group_options [CreateGroupOptions] createGroupOptions
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [GroupDto]
94
+ def create_group(create_group_options, opts = {})
95
+ data, _status_code, _headers = create_group_with_http_info(create_group_options, opts)
96
+ data
97
+ end
98
+
99
+ # Create a group
100
+ # @param create_group_options [CreateGroupOptions] createGroupOptions
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(GroupDto, Integer, Hash)>] GroupDto data, response status code and response headers
103
+ def create_group_with_http_info(create_group_options, opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.create_group ...'
106
+ end
107
+ # verify the required parameter 'create_group_options' is set
108
+ if @api_client.config.client_side_validation && create_group_options.nil?
109
+ fail ArgumentError, "Missing the required parameter 'create_group_options' when calling GroupControllerApi.create_group"
110
+ end
111
+ # resource path
112
+ local_var_path = '/groups'
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+
117
+ # header parameters
118
+ header_params = opts[:header_params] || {}
119
+ # HTTP header 'Accept' (if needed)
120
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
+ # HTTP header 'Content-Type'
122
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:body] || @api_client.object_to_http_body(create_group_options)
129
+
130
+ # return_type
131
+ return_type = opts[:return_type] || 'GroupDto'
132
+
133
+ # auth_names
134
+ auth_names = opts[:auth_names] || ['API_KEY']
135
+
136
+ new_options = opts.merge(
137
+ :header_params => header_params,
138
+ :query_params => query_params,
139
+ :form_params => form_params,
140
+ :body => post_body,
141
+ :auth_names => auth_names,
142
+ :return_type => return_type
143
+ )
144
+
145
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug "API called: GroupControllerApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ end
149
+ return data, status_code, headers
150
+ end
151
+
152
+ # Delete group
153
+ # @param group_id [String] groupId
154
+ # @param [Hash] opts the optional parameters
155
+ # @return [nil]
156
+ def delete_group(group_id, opts = {})
157
+ delete_group_with_http_info(group_id, opts)
158
+ nil
159
+ end
160
+
161
+ # Delete group
162
+ # @param group_id [String] groupId
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
165
+ def delete_group_with_http_info(group_id, opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.delete_group ...'
168
+ end
169
+ # verify the required parameter 'group_id' is set
170
+ if @api_client.config.client_side_validation && group_id.nil?
171
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.delete_group"
172
+ end
173
+ # resource path
174
+ local_var_path = '/groups/{groupId}'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
175
+
176
+ # query parameters
177
+ query_params = opts[:query_params] || {}
178
+
179
+ # header parameters
180
+ header_params = opts[:header_params] || {}
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:body]
187
+
188
+ # return_type
189
+ return_type = opts[:return_type]
190
+
191
+ # auth_names
192
+ auth_names = opts[:auth_names] || ['API_KEY']
193
+
194
+ new_options = opts.merge(
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => return_type
201
+ )
202
+
203
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug "API called: GroupControllerApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
+ end
207
+ return data, status_code, headers
208
+ end
209
+
210
+ # Get all Contact Groups in paginated format
211
+ # @param [Hash] opts the optional parameters
212
+ # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
213
+ # @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
214
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
215
+ # @return [PageGroupProjection]
216
+ def get_all_groups(opts = {})
217
+ data, _status_code, _headers = get_all_groups_with_http_info(opts)
218
+ data
219
+ end
220
+
221
+ # Get all Contact Groups in paginated format
222
+ # @param [Hash] opts the optional parameters
223
+ # @option opts [Integer] :page Optional page index in inbox list pagination
224
+ # @option opts [Integer] :size Optional page size in inbox list pagination
225
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
226
+ # @return [Array<(PageGroupProjection, Integer, Hash)>] PageGroupProjection data, response status code and response headers
227
+ def get_all_groups_with_http_info(opts = {})
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_all_groups ...'
230
+ end
231
+ allowable_values = ["ASC", "DESC"]
232
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
233
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
234
+ end
235
+ # resource path
236
+ local_var_path = '/groups/paginated'
237
+
238
+ # query parameters
239
+ query_params = opts[:query_params] || {}
240
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
241
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
242
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
243
+
244
+ # header parameters
245
+ header_params = opts[:header_params] || {}
246
+ # HTTP header 'Accept' (if needed)
247
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
248
+
249
+ # form parameters
250
+ form_params = opts[:form_params] || {}
251
+
252
+ # http body (model)
253
+ post_body = opts[:body]
254
+
255
+ # return_type
256
+ return_type = opts[:return_type] || 'PageGroupProjection'
257
+
258
+ # auth_names
259
+ auth_names = opts[:auth_names] || ['API_KEY']
260
+
261
+ new_options = opts.merge(
262
+ :header_params => header_params,
263
+ :query_params => query_params,
264
+ :form_params => form_params,
265
+ :body => post_body,
266
+ :auth_names => auth_names,
267
+ :return_type => return_type
268
+ )
269
+
270
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
271
+ if @api_client.config.debugging
272
+ @api_client.config.logger.debug "API called: GroupControllerApi#get_all_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
273
+ end
274
+ return data, status_code, headers
275
+ end
276
+
277
+ # Get group
278
+ # @param group_id [String] groupId
279
+ # @param [Hash] opts the optional parameters
280
+ # @return [GroupDto]
281
+ def get_group(group_id, opts = {})
282
+ data, _status_code, _headers = get_group_with_http_info(group_id, opts)
283
+ data
284
+ end
285
+
286
+ # Get group
287
+ # @param group_id [String] groupId
288
+ # @param [Hash] opts the optional parameters
289
+ # @return [Array<(GroupDto, Integer, Hash)>] GroupDto data, response status code and response headers
290
+ def get_group_with_http_info(group_id, opts = {})
291
+ if @api_client.config.debugging
292
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_group ...'
293
+ end
294
+ # verify the required parameter 'group_id' is set
295
+ if @api_client.config.client_side_validation && group_id.nil?
296
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.get_group"
297
+ end
298
+ # resource path
299
+ local_var_path = '/groups/{groupId}'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
300
+
301
+ # query parameters
302
+ query_params = opts[:query_params] || {}
303
+
304
+ # header parameters
305
+ header_params = opts[:header_params] || {}
306
+ # HTTP header 'Accept' (if needed)
307
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
308
+
309
+ # form parameters
310
+ form_params = opts[:form_params] || {}
311
+
312
+ # http body (model)
313
+ post_body = opts[:body]
314
+
315
+ # return_type
316
+ return_type = opts[:return_type] || 'GroupDto'
317
+
318
+ # auth_names
319
+ auth_names = opts[:auth_names] || ['API_KEY']
320
+
321
+ new_options = opts.merge(
322
+ :header_params => header_params,
323
+ :query_params => query_params,
324
+ :form_params => form_params,
325
+ :body => post_body,
326
+ :auth_names => auth_names,
327
+ :return_type => return_type
328
+ )
329
+
330
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug "API called: GroupControllerApi#get_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
333
+ end
334
+ return data, status_code, headers
335
+ end
336
+
337
+ # Get group and contacts belonging to it
338
+ # @param group_id [String] groupId
339
+ # @param [Hash] opts the optional parameters
340
+ # @return [GroupContactsDto]
341
+ def get_group_with_contacts(group_id, opts = {})
342
+ data, _status_code, _headers = get_group_with_contacts_with_http_info(group_id, opts)
343
+ data
344
+ end
345
+
346
+ # Get group and contacts belonging to it
347
+ # @param group_id [String] groupId
348
+ # @param [Hash] opts the optional parameters
349
+ # @return [Array<(GroupContactsDto, Integer, Hash)>] GroupContactsDto data, response status code and response headers
350
+ def get_group_with_contacts_with_http_info(group_id, opts = {})
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_group_with_contacts ...'
353
+ end
354
+ # verify the required parameter 'group_id' is set
355
+ if @api_client.config.client_side_validation && group_id.nil?
356
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.get_group_with_contacts"
357
+ end
358
+ # resource path
359
+ local_var_path = '/groups/{groupId}/contacts'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
360
+
361
+ # query parameters
362
+ query_params = opts[:query_params] || {}
363
+
364
+ # header parameters
365
+ header_params = opts[:header_params] || {}
366
+ # HTTP header 'Accept' (if needed)
367
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
368
+
369
+ # form parameters
370
+ form_params = opts[:form_params] || {}
371
+
372
+ # http body (model)
373
+ post_body = opts[:body]
374
+
375
+ # return_type
376
+ return_type = opts[:return_type] || 'GroupContactsDto'
377
+
378
+ # auth_names
379
+ auth_names = opts[:auth_names] || ['API_KEY']
380
+
381
+ new_options = opts.merge(
382
+ :header_params => header_params,
383
+ :query_params => query_params,
384
+ :form_params => form_params,
385
+ :body => post_body,
386
+ :auth_names => auth_names,
387
+ :return_type => return_type
388
+ )
389
+
390
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
391
+ if @api_client.config.debugging
392
+ @api_client.config.logger.debug "API called: GroupControllerApi#get_group_with_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
393
+ end
394
+ return data, status_code, headers
395
+ end
396
+
397
+ # Get group and paginated contacts belonging to it
398
+ # @param group_id [String] groupId
399
+ # @param [Hash] opts the optional parameters
400
+ # @option opts [Integer] :page Optional page index in group contact pagination (default to 0)
401
+ # @option opts [Integer] :size Optional page size in group contact pagination (default to 20)
402
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
403
+ # @return [PageContactProjection]
404
+ def get_group_with_contacts_paginated(group_id, opts = {})
405
+ data, _status_code, _headers = get_group_with_contacts_paginated_with_http_info(group_id, opts)
406
+ data
407
+ end
408
+
409
+ # Get group and paginated contacts belonging to it
410
+ # @param group_id [String] groupId
411
+ # @param [Hash] opts the optional parameters
412
+ # @option opts [Integer] :page Optional page index in group contact pagination
413
+ # @option opts [Integer] :size Optional page size in group contact pagination
414
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
415
+ # @return [Array<(PageContactProjection, Integer, Hash)>] PageContactProjection data, response status code and response headers
416
+ def get_group_with_contacts_paginated_with_http_info(group_id, opts = {})
417
+ if @api_client.config.debugging
418
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_group_with_contacts_paginated ...'
419
+ end
420
+ # verify the required parameter 'group_id' is set
421
+ if @api_client.config.client_side_validation && group_id.nil?
422
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.get_group_with_contacts_paginated"
423
+ end
424
+ allowable_values = ["ASC", "DESC"]
425
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
426
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
427
+ end
428
+ # resource path
429
+ local_var_path = '/groups/{groupId}/contacts-paginated'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
430
+
431
+ # query parameters
432
+ query_params = opts[:query_params] || {}
433
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
434
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
435
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
436
+
437
+ # header parameters
438
+ header_params = opts[:header_params] || {}
439
+ # HTTP header 'Accept' (if needed)
440
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
441
+
442
+ # form parameters
443
+ form_params = opts[:form_params] || {}
444
+
445
+ # http body (model)
446
+ post_body = opts[:body]
447
+
448
+ # return_type
449
+ return_type = opts[:return_type] || 'PageContactProjection'
450
+
451
+ # auth_names
452
+ auth_names = opts[:auth_names] || ['API_KEY']
453
+
454
+ new_options = opts.merge(
455
+ :header_params => header_params,
456
+ :query_params => query_params,
457
+ :form_params => form_params,
458
+ :body => post_body,
459
+ :auth_names => auth_names,
460
+ :return_type => return_type
461
+ )
462
+
463
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
464
+ if @api_client.config.debugging
465
+ @api_client.config.logger.debug "API called: GroupControllerApi#get_group_with_contacts_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
466
+ end
467
+ return data, status_code, headers
468
+ end
469
+
470
+ # Get all groups
471
+ # @param [Hash] opts the optional parameters
472
+ # @return [Array<GroupProjection>]
473
+ def get_groups(opts = {})
474
+ data, _status_code, _headers = get_groups_with_http_info(opts)
475
+ data
476
+ end
477
+
478
+ # Get all groups
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [Array<(Array<GroupProjection>, Integer, Hash)>] Array<GroupProjection> data, response status code and response headers
481
+ def get_groups_with_http_info(opts = {})
482
+ if @api_client.config.debugging
483
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_groups ...'
484
+ end
485
+ # resource path
486
+ local_var_path = '/groups'
487
+
488
+ # query parameters
489
+ query_params = opts[:query_params] || {}
490
+
491
+ # header parameters
492
+ header_params = opts[:header_params] || {}
493
+ # HTTP header 'Accept' (if needed)
494
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
495
+
496
+ # form parameters
497
+ form_params = opts[:form_params] || {}
498
+
499
+ # http body (model)
500
+ post_body = opts[:body]
501
+
502
+ # return_type
503
+ return_type = opts[:return_type] || 'Array<GroupProjection>'
504
+
505
+ # auth_names
506
+ auth_names = opts[:auth_names] || ['API_KEY']
507
+
508
+ new_options = opts.merge(
509
+ :header_params => header_params,
510
+ :query_params => query_params,
511
+ :form_params => form_params,
512
+ :body => post_body,
513
+ :auth_names => auth_names,
514
+ :return_type => return_type
515
+ )
516
+
517
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
518
+ if @api_client.config.debugging
519
+ @api_client.config.logger.debug "API called: GroupControllerApi#get_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
520
+ end
521
+ return data, status_code, headers
522
+ end
523
+
524
+ # Remove contacts from a group
525
+ # @param group_id [String] groupId
526
+ # @param update_group_contacts_option [UpdateGroupContacts] updateGroupContactsOption
527
+ # @param [Hash] opts the optional parameters
528
+ # @return [GroupContactsDto]
529
+ def remove_contacts_from_group(group_id, update_group_contacts_option, opts = {})
530
+ data, _status_code, _headers = remove_contacts_from_group_with_http_info(group_id, update_group_contacts_option, opts)
531
+ data
532
+ end
533
+
534
+ # Remove contacts from a group
535
+ # @param group_id [String] groupId
536
+ # @param update_group_contacts_option [UpdateGroupContacts] updateGroupContactsOption
537
+ # @param [Hash] opts the optional parameters
538
+ # @return [Array<(GroupContactsDto, Integer, Hash)>] GroupContactsDto data, response status code and response headers
539
+ def remove_contacts_from_group_with_http_info(group_id, update_group_contacts_option, opts = {})
540
+ if @api_client.config.debugging
541
+ @api_client.config.logger.debug 'Calling API: GroupControllerApi.remove_contacts_from_group ...'
542
+ end
543
+ # verify the required parameter 'group_id' is set
544
+ if @api_client.config.client_side_validation && group_id.nil?
545
+ fail ArgumentError, "Missing the required parameter 'group_id' when calling GroupControllerApi.remove_contacts_from_group"
546
+ end
547
+ # verify the required parameter 'update_group_contacts_option' is set
548
+ if @api_client.config.client_side_validation && update_group_contacts_option.nil?
549
+ fail ArgumentError, "Missing the required parameter 'update_group_contacts_option' when calling GroupControllerApi.remove_contacts_from_group"
550
+ end
551
+ # resource path
552
+ local_var_path = '/groups/{groupId}/contacts'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))
553
+
554
+ # query parameters
555
+ query_params = opts[:query_params] || {}
556
+
557
+ # header parameters
558
+ header_params = opts[:header_params] || {}
559
+ # HTTP header 'Accept' (if needed)
560
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
561
+ # HTTP header 'Content-Type'
562
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
563
+
564
+ # form parameters
565
+ form_params = opts[:form_params] || {}
566
+
567
+ # http body (model)
568
+ post_body = opts[:body] || @api_client.object_to_http_body(update_group_contacts_option)
569
+
570
+ # return_type
571
+ return_type = opts[:return_type] || 'GroupContactsDto'
572
+
573
+ # auth_names
574
+ auth_names = opts[:auth_names] || ['API_KEY']
575
+
576
+ new_options = opts.merge(
577
+ :header_params => header_params,
578
+ :query_params => query_params,
579
+ :form_params => form_params,
580
+ :body => post_body,
581
+ :auth_names => auth_names,
582
+ :return_type => return_type
583
+ )
584
+
585
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
586
+ if @api_client.config.debugging
587
+ @api_client.config.logger.debug "API called: GroupControllerApi#remove_contacts_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
588
+ end
589
+ return data, status_code, headers
590
+ end
591
+ end
592
+ end