mailslurp_client 8.0.8 → 8.0.13

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 +123 -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,146 @@
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 MailServerControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get DNS Mail Server records for a domain
23
+ # @param describe_options [DescribeDomainOptions] describeOptions
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [DescribeMailServerDomainResult]
26
+ def describe_mail_server_domain(describe_options, opts = {})
27
+ data, _status_code, _headers = describe_mail_server_domain_with_http_info(describe_options, opts)
28
+ data
29
+ end
30
+
31
+ # Get DNS Mail Server records for a domain
32
+ # @param describe_options [DescribeDomainOptions] describeOptions
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(DescribeMailServerDomainResult, Integer, Hash)>] DescribeMailServerDomainResult data, response status code and response headers
35
+ def describe_mail_server_domain_with_http_info(describe_options, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: MailServerControllerApi.describe_mail_server_domain ...'
38
+ end
39
+ # verify the required parameter 'describe_options' is set
40
+ if @api_client.config.client_side_validation && describe_options.nil?
41
+ fail ArgumentError, "Missing the required parameter 'describe_options' when calling MailServerControllerApi.describe_mail_server_domain"
42
+ end
43
+ # resource path
44
+ local_var_path = '/mail-server/describe/domain'
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(describe_options)
61
+
62
+ # return_type
63
+ return_type = opts[:return_type] || 'DescribeMailServerDomainResult'
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: MailServerControllerApi#describe_mail_server_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Verify the existence of an email address at a given mail server.
85
+ # @param verify_options [VerifyEmailAddressOptions] verifyOptions
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [EmailVerificationResult]
88
+ def verify_email_address(verify_options, opts = {})
89
+ data, _status_code, _headers = verify_email_address_with_http_info(verify_options, opts)
90
+ data
91
+ end
92
+
93
+ # Verify the existence of an email address at a given mail server.
94
+ # @param verify_options [VerifyEmailAddressOptions] verifyOptions
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [Array<(EmailVerificationResult, Integer, Hash)>] EmailVerificationResult data, response status code and response headers
97
+ def verify_email_address_with_http_info(verify_options, opts = {})
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug 'Calling API: MailServerControllerApi.verify_email_address ...'
100
+ end
101
+ # verify the required parameter 'verify_options' is set
102
+ if @api_client.config.client_side_validation && verify_options.nil?
103
+ fail ArgumentError, "Missing the required parameter 'verify_options' when calling MailServerControllerApi.verify_email_address"
104
+ end
105
+ # resource path
106
+ local_var_path = '/mail-server/verify/email-address'
107
+
108
+ # query parameters
109
+ query_params = opts[:query_params] || {}
110
+
111
+ # header parameters
112
+ header_params = opts[:header_params] || {}
113
+ # HTTP header 'Accept' (if needed)
114
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
115
+ # HTTP header 'Content-Type'
116
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:body] || @api_client.object_to_http_body(verify_options)
123
+
124
+ # return_type
125
+ return_type = opts[:return_type] || 'EmailVerificationResult'
126
+
127
+ # auth_names
128
+ auth_names = opts[:auth_names] || ['API_KEY']
129
+
130
+ new_options = opts.merge(
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :form_params => form_params,
134
+ :body => post_body,
135
+ :auth_names => auth_names,
136
+ :return_type => return_type
137
+ )
138
+
139
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug "API called: MailServerControllerApi#verify_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ end
143
+ return data, status_code, headers
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,152 @@
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 SentEmailsControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get sent email receipt
23
+ # @param id [String] id
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [SentEmailDto]
26
+ def get_sent_email(id, opts = {})
27
+ data, _status_code, _headers = get_sent_email_with_http_info(id, opts)
28
+ data
29
+ end
30
+
31
+ # Get sent email receipt
32
+ # @param id [String] id
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
35
+ def get_sent_email_with_http_info(id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_email ...'
38
+ end
39
+ # verify the required parameter 'id' is set
40
+ if @api_client.config.client_side_validation && id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'id' when calling SentEmailsControllerApi.get_sent_email"
42
+ end
43
+ # resource path
44
+ local_var_path = '/sent/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
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
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:body]
59
+
60
+ # return_type
61
+ return_type = opts[:return_type] || 'SentEmailDto'
62
+
63
+ # auth_names
64
+ auth_names = opts[:auth_names] || ['API_KEY']
65
+
66
+ new_options = opts.merge(
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: SentEmailsControllerApi#get_sent_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # Get all sent emails in paginated form
83
+ # @param [Hash] opts the optional parameters
84
+ # @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
85
+ # @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0)
86
+ # @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20)
87
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
88
+ # @return [PageSentEmailProjection]
89
+ def get_sent_emails(opts = {})
90
+ data, _status_code, _headers = get_sent_emails_with_http_info(opts)
91
+ data
92
+ end
93
+
94
+ # Get all sent emails in paginated form
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
97
+ # @option opts [Integer] :page Optional page index in inbox sent email list pagination
98
+ # @option opts [Integer] :size Optional page size in inbox sent email list pagination
99
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
100
+ # @return [Array<(PageSentEmailProjection, Integer, Hash)>] PageSentEmailProjection data, response status code and response headers
101
+ def get_sent_emails_with_http_info(opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_emails ...'
104
+ end
105
+ allowable_values = ["ASC", "DESC"]
106
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
107
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
108
+ end
109
+ # resource path
110
+ local_var_path = '/sent'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
115
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
116
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
117
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:body]
129
+
130
+ # return_type
131
+ return_type = opts[:return_type] || 'PageSentEmailProjection'
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(:GET, local_var_path, new_options)
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug "API called: SentEmailsControllerApi#get_sent_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ end
149
+ return data, status_code, headers
150
+ end
151
+ end
152
+ 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: 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 TemplateControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a Template
23
+ # @param create_template_options [CreateTemplateOptions] createTemplateOptions
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [TemplateDto]
26
+ def create_template(create_template_options, opts = {})
27
+ data, _status_code, _headers = create_template_with_http_info(create_template_options, opts)
28
+ data
29
+ end
30
+
31
+ # Create a Template
32
+ # @param create_template_options [CreateTemplateOptions] createTemplateOptions
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(TemplateDto, Integer, Hash)>] TemplateDto data, response status code and response headers
35
+ def create_template_with_http_info(create_template_options, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.create_template ...'
38
+ end
39
+ # verify the required parameter 'create_template_options' is set
40
+ if @api_client.config.client_side_validation && create_template_options.nil?
41
+ fail ArgumentError, "Missing the required parameter 'create_template_options' when calling TemplateControllerApi.create_template"
42
+ end
43
+ # resource path
44
+ local_var_path = '/templates'
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_template_options)
61
+
62
+ # return_type
63
+ return_type = opts[:return_type] || 'TemplateDto'
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: TemplateControllerApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Delete Template
85
+ # @param template_id [String] TemplateId
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [nil]
88
+ def delete_template(template_id, opts = {})
89
+ delete_template_with_http_info(template_id, opts)
90
+ nil
91
+ end
92
+
93
+ # Delete Template
94
+ # @param template_id [String] TemplateId
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
97
+ def delete_template_with_http_info(template_id, opts = {})
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.delete_template ...'
100
+ end
101
+ # verify the required parameter 'template_id' is set
102
+ if @api_client.config.client_side_validation && template_id.nil?
103
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateControllerApi.delete_template"
104
+ end
105
+ # resource path
106
+ local_var_path = '/templates/{TemplateId}'.sub('{' + 'TemplateId' + '}', CGI.escape(template_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: TemplateControllerApi#delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+
142
+ # Get all Templates in paginated format
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 [PageTemplateProjection]
148
+ def get_all_templates(opts = {})
149
+ data, _status_code, _headers = get_all_templates_with_http_info(opts)
150
+ data
151
+ end
152
+
153
+ # Get all Templates in paginated format
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<(PageTemplateProjection, Integer, Hash)>] PageTemplateProjection data, response status code and response headers
159
+ def get_all_templates_with_http_info(opts = {})
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.get_all_templates ...'
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 = '/templates/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] || 'PageTemplateProjection'
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: TemplateControllerApi#get_all_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
205
+ end
206
+ return data, status_code, headers
207
+ end
208
+
209
+ # Get Template
210
+ # @param template_id [String] TemplateId
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [TemplateDto]
213
+ def get_template(template_id, opts = {})
214
+ data, _status_code, _headers = get_template_with_http_info(template_id, opts)
215
+ data
216
+ end
217
+
218
+ # Get Template
219
+ # @param template_id [String] TemplateId
220
+ # @param [Hash] opts the optional parameters
221
+ # @return [Array<(TemplateDto, Integer, Hash)>] TemplateDto data, response status code and response headers
222
+ def get_template_with_http_info(template_id, opts = {})
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.get_template ...'
225
+ end
226
+ # verify the required parameter 'template_id' is set
227
+ if @api_client.config.client_side_validation && template_id.nil?
228
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateControllerApi.get_template"
229
+ end
230
+ # resource path
231
+ local_var_path = '/templates/{TemplateId}'.sub('{' + 'TemplateId' + '}', CGI.escape(template_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] || 'TemplateDto'
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: TemplateControllerApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
265
+ end
266
+ return data, status_code, headers
267
+ end
268
+
269
+ # Get all Templates
270
+ # @param [Hash] opts the optional parameters
271
+ # @return [Array<TemplateProjection>]
272
+ def get_templates(opts = {})
273
+ data, _status_code, _headers = get_templates_with_http_info(opts)
274
+ data
275
+ end
276
+
277
+ # Get all Templates
278
+ # @param [Hash] opts the optional parameters
279
+ # @return [Array<(Array<TemplateProjection>, Integer, Hash)>] Array<TemplateProjection> data, response status code and response headers
280
+ def get_templates_with_http_info(opts = {})
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.get_templates ...'
283
+ end
284
+ # resource path
285
+ local_var_path = '/templates'
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<TemplateProjection>'
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: TemplateControllerApi#get_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+ end
323
+ end