mailmock 1.1.1.pre.34026500447

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 (67) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +111 -0
  4. data/Rakefile +10 -0
  5. data/docs/EmailApi.md +202 -0
  6. data/docs/EmailCreate200Response.md +20 -0
  7. data/docs/EmailCreateRequest.md +20 -0
  8. data/docs/EmailList200ResponseInner.md +26 -0
  9. data/docs/EmailListDefaultResponse.md +22 -0
  10. data/docs/EmailListDefaultResponseIssuesInner.md +18 -0
  11. data/docs/EmailRead200Response.md +36 -0
  12. data/docs/EmailRead200ResponseHeadersInner.md +20 -0
  13. data/docs/EmailReadRequest.md +20 -0
  14. data/docs/SendApi.md +70 -0
  15. data/docs/SendAws200Response.md +24 -0
  16. data/docs/SendAwsRequest.md +24 -0
  17. data/docs/SendAwsRequestMail.md +30 -0
  18. data/docs/SendAwsRequestMailCommonHeaders.md +28 -0
  19. data/docs/SendAwsRequestReceipt.md +34 -0
  20. data/docs/SendAwsRequestReceiptAction.md +22 -0
  21. data/docs/SendAwsRequestReceiptSpamVerdict.md +18 -0
  22. data/git_push.sh +57 -0
  23. data/lib/mailmock/api/email_api.rb +222 -0
  24. data/lib/mailmock/api/send_api.rb +86 -0
  25. data/lib/mailmock/api_client.rb +397 -0
  26. data/lib/mailmock/api_error.rb +58 -0
  27. data/lib/mailmock/api_model_base.rb +88 -0
  28. data/lib/mailmock/configuration.rb +308 -0
  29. data/lib/mailmock/models/email_create200_response.rb +190 -0
  30. data/lib/mailmock/models/email_create_request.rb +190 -0
  31. data/lib/mailmock/models/email_list200_response_inner.rb +292 -0
  32. data/lib/mailmock/models/email_list_default_response.rb +201 -0
  33. data/lib/mailmock/models/email_list_default_response_issues_inner.rb +164 -0
  34. data/lib/mailmock/models/email_read200_response.rb +370 -0
  35. data/lib/mailmock/models/email_read200_response_headers_inner.rb +190 -0
  36. data/lib/mailmock/models/email_read_request.rb +175 -0
  37. data/lib/mailmock/models/send_aws200_response.rb +242 -0
  38. data/lib/mailmock/models/send_aws_request.rb +242 -0
  39. data/lib/mailmock/models/send_aws_request_mail.rb +324 -0
  40. data/lib/mailmock/models/send_aws_request_mail_common_headers.rb +298 -0
  41. data/lib/mailmock/models/send_aws_request_receipt.rb +374 -0
  42. data/lib/mailmock/models/send_aws_request_receipt_action.rb +216 -0
  43. data/lib/mailmock/models/send_aws_request_receipt_spam_verdict.rb +164 -0
  44. data/lib/mailmock/version.rb +15 -0
  45. data/lib/mailmock.rb +57 -0
  46. data/mailmock.gemspec +39 -0
  47. data/spec/api/email_api_spec.rb +70 -0
  48. data/spec/api/send_api_spec.rb +45 -0
  49. data/spec/api_client_spec.rb +228 -0
  50. data/spec/configuration_spec.rb +42 -0
  51. data/spec/models/email_create200_response_spec.rb +40 -0
  52. data/spec/models/email_create_request_spec.rb +40 -0
  53. data/spec/models/email_list200_response_inner_spec.rb +62 -0
  54. data/spec/models/email_list_default_response_issues_inner_spec.rb +34 -0
  55. data/spec/models/email_list_default_response_spec.rb +46 -0
  56. data/spec/models/email_read200_response_headers_inner_spec.rb +40 -0
  57. data/spec/models/email_read200_response_spec.rb +88 -0
  58. data/spec/models/email_read_request_spec.rb +40 -0
  59. data/spec/models/send_aws200_response_spec.rb +52 -0
  60. data/spec/models/send_aws_request_mail_common_headers_spec.rb +64 -0
  61. data/spec/models/send_aws_request_mail_spec.rb +70 -0
  62. data/spec/models/send_aws_request_receipt_action_spec.rb +46 -0
  63. data/spec/models/send_aws_request_receipt_spam_verdict_spec.rb +34 -0
  64. data/spec/models/send_aws_request_receipt_spec.rb +82 -0
  65. data/spec/models/send_aws_request_spec.rb +52 -0
  66. data/spec/spec_helper.rb +111 -0
  67. metadata +168 -0
@@ -0,0 +1,28 @@
1
+ # Mailmock::SendAwsRequestMailCommonHeaders
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **return_path** | **String** | | |
8
+ | **from** | **Array<String>** | | |
9
+ | **date** | **String** | | |
10
+ | **to** | **Array<String>** | | |
11
+ | **message_id** | **String** | | |
12
+ | **subject** | **String** | | |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'mailmock'
18
+
19
+ instance = Mailmock::SendAwsRequestMailCommonHeaders.new(
20
+ return_path: null,
21
+ from: null,
22
+ date: null,
23
+ to: null,
24
+ message_id: null,
25
+ subject: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,34 @@
1
+ # Mailmock::SendAwsRequestReceipt
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **timestamp** | **Time** | | |
8
+ | **processing_time_millis** | **Float** | | |
9
+ | **recipients** | **Array<String>** | | |
10
+ | **spam_verdict** | [**SendAwsRequestReceiptSpamVerdict**](SendAwsRequestReceiptSpamVerdict.md) | | |
11
+ | **virus_verdict** | [**SendAwsRequestReceiptSpamVerdict**](SendAwsRequestReceiptSpamVerdict.md) | | |
12
+ | **spf_verdict** | [**SendAwsRequestReceiptSpamVerdict**](SendAwsRequestReceiptSpamVerdict.md) | | |
13
+ | **dkim_verdict** | [**SendAwsRequestReceiptSpamVerdict**](SendAwsRequestReceiptSpamVerdict.md) | | |
14
+ | **dmarc_verdict** | [**SendAwsRequestReceiptSpamVerdict**](SendAwsRequestReceiptSpamVerdict.md) | | |
15
+ | **action** | [**SendAwsRequestReceiptAction**](SendAwsRequestReceiptAction.md) | | |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'mailmock'
21
+
22
+ instance = Mailmock::SendAwsRequestReceipt.new(
23
+ timestamp: null,
24
+ processing_time_millis: null,
25
+ recipients: null,
26
+ spam_verdict: null,
27
+ virus_verdict: null,
28
+ spf_verdict: null,
29
+ dkim_verdict: null,
30
+ dmarc_verdict: null,
31
+ action: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,22 @@
1
+ # Mailmock::SendAwsRequestReceiptAction
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **type** | **String** | | |
8
+ | **topic_arn** | **String** | | |
9
+ | **encoding** | **String** | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'mailmock'
15
+
16
+ instance = Mailmock::SendAwsRequestReceiptAction.new(
17
+ type: null,
18
+ topic_arn: null,
19
+ encoding: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,18 @@
1
+ # Mailmock::SendAwsRequestReceiptSpamVerdict
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'mailmock'
13
+
14
+ instance = Mailmock::SendAwsRequestReceiptSpamVerdict.new(
15
+ status: null
16
+ )
17
+ ```
18
+
data/git_push.sh ADDED
@@ -0,0 +1,57 @@
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+ git_host=$4
10
+
11
+ if [ "$git_host" = "" ]; then
12
+ git_host="github.com"
13
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
+ fi
15
+
16
+ if [ "$git_user_id" = "" ]; then
17
+ git_user_id="descope"
18
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
+ fi
20
+
21
+ if [ "$git_repo_id" = "" ]; then
22
+ git_repo_id="mailmock"
23
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
+ fi
25
+
26
+ if [ "$release_note" = "" ]; then
27
+ release_note="Minor update"
28
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
+ fi
30
+
31
+ # Initialize the local directory as a Git repository
32
+ git init
33
+
34
+ # Adds the files in the local repository and stages them for commit.
35
+ git add .
36
+
37
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
+ git commit -m "$release_note"
39
+
40
+ # Sets the new remote
41
+ git_remote=$(git remote)
42
+ if [ "$git_remote" = "" ]; then # git remote not defined
43
+
44
+ if [ "$GIT_TOKEN" = "" ]; then
45
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
+ else
48
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
+ fi
50
+
51
+ fi
52
+
53
+ git pull origin master
54
+
55
+ # Pushes (Forces) the changes in the local repository up to the remote repository
56
+ echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
+ git push origin master 2>&1 | grep -v 'To https'
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Mailmock API
3
+
4
+ #Mailmock API
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Mailmock
16
+ class EmailApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new mailbox
23
+ # @param email_create_request [EmailCreateRequest]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [EmailCreate200Response]
26
+ def email_create(email_create_request, opts = {})
27
+ data, _status_code, _headers = email_create_with_http_info(email_create_request, opts)
28
+ data
29
+ end
30
+
31
+ # Create a new mailbox
32
+ # @param email_create_request [EmailCreateRequest]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(EmailCreate200Response, Integer, Hash)>] EmailCreate200Response data, response status code and response headers
35
+ def email_create_with_http_info(email_create_request, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: EmailApi.email_create ...'
38
+ end
39
+ # verify the required parameter 'email_create_request' is set
40
+ if @api_client.config.client_side_validation && email_create_request.nil?
41
+ fail ArgumentError, "Missing the required parameter 'email_create_request' when calling EmailApi.email_create"
42
+ end
43
+ # resource path
44
+ local_var_path = '/email'
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']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(email_create_request)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'EmailCreate200Response'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || []
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"EmailApi.email_create",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: EmailApi#email_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # List mailbox(es)
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :user
91
+ # @option opts [String] :mailbox
92
+ # @option opts [String] :unread
93
+ # @return [Array<EmailList200ResponseInner>]
94
+ def email_list(opts = {})
95
+ data, _status_code, _headers = email_list_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # List mailbox(es)
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [String] :user
102
+ # @option opts [String] :mailbox
103
+ # @option opts [String] :unread
104
+ # @return [Array<(Array<EmailList200ResponseInner>, Integer, Hash)>] Array<EmailList200ResponseInner> data, response status code and response headers
105
+ def email_list_with_http_info(opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: EmailApi.email_list ...'
108
+ end
109
+ allowable_values = ["true", "false", "*"]
110
+ if @api_client.config.client_side_validation && opts[:'unread'] && !allowable_values.include?(opts[:'unread'])
111
+ fail ArgumentError, "invalid value for \"unread\", must be one of #{allowable_values}"
112
+ end
113
+ # resource path
114
+ local_var_path = '/email'
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+ query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
119
+ query_params[:'mailbox'] = opts[:'mailbox'] if !opts[:'mailbox'].nil?
120
+ query_params[:'unread'] = opts[:'unread'] if !opts[:'unread'].nil?
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body]
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'Array<EmailList200ResponseInner>'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || []
138
+
139
+ new_options = opts.merge(
140
+ :operation => :"EmailApi.email_list",
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type
147
+ )
148
+
149
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: EmailApi#email_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
156
+ # Fetch an email, optionally mark as read
157
+ # @param email_read_request [EmailReadRequest]
158
+ # @param [Hash] opts the optional parameters
159
+ # @return [EmailRead200Response]
160
+ def email_read(email_read_request, opts = {})
161
+ data, _status_code, _headers = email_read_with_http_info(email_read_request, opts)
162
+ data
163
+ end
164
+
165
+ # Fetch an email, optionally mark as read
166
+ # @param email_read_request [EmailReadRequest]
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [Array<(EmailRead200Response, Integer, Hash)>] EmailRead200Response data, response status code and response headers
169
+ def email_read_with_http_info(email_read_request, opts = {})
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug 'Calling API: EmailApi.email_read ...'
172
+ end
173
+ # verify the required parameter 'email_read_request' is set
174
+ if @api_client.config.client_side_validation && email_read_request.nil?
175
+ fail ArgumentError, "Missing the required parameter 'email_read_request' when calling EmailApi.email_read"
176
+ end
177
+ # resource path
178
+ local_var_path = '/email'
179
+
180
+ # query parameters
181
+ query_params = opts[:query_params] || {}
182
+
183
+ # header parameters
184
+ header_params = opts[:header_params] || {}
185
+ # HTTP header 'Accept' (if needed)
186
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
187
+ # HTTP header 'Content-Type'
188
+ content_type = @api_client.select_header_content_type(['application/json'])
189
+ if !content_type.nil?
190
+ header_params['Content-Type'] = content_type
191
+ end
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(email_read_request)
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type] || 'EmailRead200Response'
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || []
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"EmailApi.email_read",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: EmailApi#email_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,86 @@
1
+ =begin
2
+ #Mailmock API
3
+
4
+ #Mailmock API
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Mailmock
16
+ class SendApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # @param send_aws_request [SendAwsRequest]
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [SendAws200Response]
25
+ def send_aws(send_aws_request, opts = {})
26
+ data, _status_code, _headers = send_aws_with_http_info(send_aws_request, opts)
27
+ data
28
+ end
29
+
30
+ # @param send_aws_request [SendAwsRequest]
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [Array<(SendAws200Response, Integer, Hash)>] SendAws200Response data, response status code and response headers
33
+ def send_aws_with_http_info(send_aws_request, opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: SendApi.send_aws ...'
36
+ end
37
+ # verify the required parameter 'send_aws_request' is set
38
+ if @api_client.config.client_side_validation && send_aws_request.nil?
39
+ fail ArgumentError, "Missing the required parameter 'send_aws_request' when calling SendApi.send_aws"
40
+ end
41
+ # resource path
42
+ local_var_path = '/aws'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ # HTTP header 'Content-Type'
52
+ content_type = @api_client.select_header_content_type(['application/json'])
53
+ if !content_type.nil?
54
+ header_params['Content-Type'] = content_type
55
+ end
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(send_aws_request)
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'SendAws200Response'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || []
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"SendApi.send_aws",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: SendApi#send_aws\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+ end
86
+ end