mailosaur 7.2.1 → 7.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27d013e44169ed1c8b0881334b94ce03d76177c35b48202058683a271a7920a8
4
- data.tar.gz: 3fd514240ac76ddfe02296e7a67b97f10b9d5fc711e1c7d321a1222cc1caef0a
3
+ metadata.gz: '0629407acde130c71828a35283ecc427f73881193164f236a970d6226fe4ed7d'
4
+ data.tar.gz: 66d6af0d7d7bd39d52f61c87c80acbf4524e2324c5ffe0c264397d8c99e4cdd0
5
5
  SHA512:
6
- metadata.gz: 173665bfe6e3ac1b5eacc99f8e4e3b8bf6e7e9487e4852be057473468b56c00c9f53d38ac95218587fd07d86301efcf98b7ce04f234c93dff5df66aa6c8db402
7
- data.tar.gz: 81b04fd97abcfaf0784973d7cf9e1b627d6f28664b1c38a43133f47a001f743a128102520d764d52fba0e7ca825625219b41121feb207b5f489eff569c1dac25
6
+ metadata.gz: 1754ac94d3a1566bf813e9adc6012ca42fa7be204dab7d733a2ae8bcc8d14b44a947f18a2795212ad49fd09406ebc3ba93c4cbc77b0ef57ecbf8c4f303cf4ea1
7
+ data.tar.gz: 511648f014115e7ab22f8cf2893ff87264a7355b8dddf193655c992b742ff48a30cc69d57f8ca44589e45e246fb6566cb17a503714fc9c30c013e712127a0817
data/README.md CHANGED
@@ -1,30 +1,291 @@
1
- # Mailosaur Ruby Client Library
1
+ # [Mailosaur - Ruby library](https://mailosaur.com/) · [![](https://github.com/mailosaur/mailosaur-ruby/workflows/CI/badge.svg)](https://github.com/mailosaur/mailosaur-ruby/actions)
2
2
 
3
- [Mailosaur](https://mailosaur.com) lets you automate email and SMS tests, like account verification and password resets, and integrate these into your CI/CD pipeline.
3
+ Mailosaur lets you automate email and SMS tests as part of software development and QA.
4
4
 
5
- [![](https://github.com/mailosaur/mailosaur-ruby/workflows/CI/badge.svg)](https://github.com/mailosaur/mailosaur-ruby/actions)
5
+ - **Unlimited test email addresses for all** - every account gives users an unlimited number of test email addresses to test with.
6
+ - **End-to-end (e2e) email and SMS testing** Allowing you to set up end-to-end tests for password reset emails, account verification processes and MFA/one-time passcodes sent via text message.
7
+ - **Fake SMTP servers** Mailosaur also provides dummy SMTP servers to test with; allowing you to catch email in staging environments - preventing email being sent to customers by mistake.
6
8
 
7
- ## Installation
9
+ ## Get Started
10
+
11
+ This guide provides several key sections:
12
+
13
+ - [Get Started](#get-started)
14
+ - [Creating an account](#creating-an-account)
15
+ - [Test email addresses with Mailosaur](#test-email-addresses-with-mailosaur)
16
+ - [Find an email](#find-an-email)
17
+ - [Find an SMS message](#find-an-sms-message)
18
+ - [Testing plain text content](#testing-plain-text-content)
19
+ - [Testing HTML content](#testing-html-content)
20
+ - [Working with hyperlinks](#working-with-hyperlinks)
21
+ - [Working with attachments](#working-with-attachments)
22
+ - [Working with images and web beacons](#working-with-images-and-web-beacons)
23
+ - [Spam checking](#spam-checking)
24
+
25
+ You can find the full [Mailosaur documentation](https://mailosaur.com/docs/) on the website.
26
+
27
+ If you get stuck, just contact us at support@mailosaur.com.
28
+
29
+ ### Installation
8
30
 
9
31
  ```
10
32
  gem install mailosaur
11
33
  ```
12
34
 
13
- ## Documentation
35
+ Then import the library into your code. The value for `YOUR_API_KEY` is covered in the next step ([creating an account](#creating-an-account)):
36
+
37
+ ```ruby
38
+ require 'mailosaur'
39
+ mailosaur = Mailosaur::MailosaurClient.new("YOUR_API_KEY")
40
+ ```
41
+
42
+ ### API Reference
43
+
44
+ This library is powered by the Mailosaur [email & SMS testing API](https://mailosaur.com/docs/api/). You can easily check out the API itself by looking at our [API reference documentation](https://mailosaur.com/docs/api/) or via our Postman or Insomnia collections:
45
+
46
+ [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/6961255-6cc72dff-f576-451a-9023-b82dec84f95d?action=collection%2Ffork&collection-url=entityId%3D6961255-6cc72dff-f576-451a-9023-b82dec84f95d%26entityType%3Dcollection%26workspaceId%3D386a4af1-4293-4197-8f40-0eb49f831325)
47
+ [![Run in Insomnia}](https://insomnia.rest/images/run.svg)](https://insomnia.rest/run/?label=Mailosaur&uri=https%3A%2F%2Fmailosaur.com%2Finsomnia.json)
48
+
49
+ ## Creating an account
50
+
51
+ Create a [free trial account](https://mailosaur.com/app/signup) for Mailosaur via the website.
52
+
53
+ Once you have this, navigate to the [API tab](https://mailosaur.com/app/project/api) to find the following values:
54
+
55
+ - **Server ID** - Servers act like projects, which group your tests together. You need this ID whenever you interact with a server via the API.
56
+ - **Server Domain** - Every server has its own domain name. You'll need this to send email to your server.
57
+ - **API Key** - You can create an API key per server (recommended), or an account-level API key to use across your whole account. [Learn more about API keys](https://mailosaur.com/docs/managing-your-account/api-keys/).
14
58
 
15
- Please see the [Ruby client reference](https://mailosaur.com/docs/email-testing/ruby/client-reference/) for the most up-to-date documentation.
59
+ ## Test email addresses with Mailosaur
16
60
 
17
- ## Usage
61
+ Mailosaur gives you an **unlimited number of test email addresses** - with no setup or coding required!
18
62
 
19
- example.rb
63
+ Here's how it works:
64
+
65
+ * When you create an account, you are given a server.
66
+ * Every server has its own **Server Domain** name (e.g. `abc123.mailosaur.net`)
67
+ * Any email address that ends with `@{YOUR_SERVER_DOMAIN}` will work with Mailosaur without any special setup. For example:
68
+ * `build-423@abc123.mailosaur.net`
69
+ * `john.smith@abc123.mailosaur.net`
70
+ * `rAnDoM63423@abc123.mailosaur.net`
71
+ * You can create more servers when you need them. Each one will have its own domain name.
72
+
73
+ ***Can't use test email addresses?** You can also [use SMTP to test email](https://mailosaur.com/docs/email-testing/sending-to-mailosaur/#sending-via-smtp). By connecting your product or website to Mailosaur via SMTP, Mailosaur will catch all email your application sends, regardless of the email address.*
74
+
75
+ ## Find an email
76
+
77
+ In automated tests you will want to wait for a new email to arrive. This library makes that easy with the `messages.get` method. Here's how you use it:
20
78
 
21
79
  ```ruby
22
- require "mailosaur"
23
- mailosaur = Mailosaur::MailosaurClient.new("YOUR_API_KEY")
80
+ require 'mailosaur'
81
+
82
+ mailosaur = Mailosaur::MailosaurClient.new("API_KEY")
83
+
84
+ # See https://mailosaur.com/app/project/api
85
+ server_id = "abc123"
86
+ server_domain = "abc123.mailosaur.net"
87
+
88
+ criteria = Mailosaur::Models::SearchCriteria.new()
89
+ criteria.sent_to = "anything@" + server_domain
90
+
91
+ email = mailosaur.messages.get(server_id, criteria)
92
+
93
+ puts(email.subject) # "Hello world!"
94
+ ```
95
+
96
+ ### What is this code doing?
97
+
98
+ 1. Sets up an instance of `MailosaurClient` with your API key.
99
+ 2. Waits for an email to arrive at the server with ID `abc123`.
100
+ 3. Outputs the subject line of the email.
101
+
102
+ ## Find an SMS message
103
+
104
+ **Important:** Trial accounts do not automatically have SMS access. Please contact our support team to enable a trial of SMS functionality.
105
+
106
+ If your account has [SMS testing](https://mailosaur.com/sms-testing/) enabled, you can reserve phone numbers to test with, then use the Mailosaur API in a very similar way to when testing email:
107
+
108
+ ```ruby
109
+ require 'mailosaur'
110
+
111
+ mailosaur = Mailosaur::MailosaurClient.new("API_KEY")
112
+
113
+ server_id = "abc123"
114
+
115
+ criteria = Mailosaur::Models::SearchCriteria.new()
116
+ criteria.sent_to = "4471235554444"
117
+
118
+ sms = mailosaur.messages.get(server_id, criteria)
119
+
120
+ puts(sms.text.body)
121
+ ```
122
+
123
+ ## Testing plain text content
124
+
125
+ Most emails, and all SMS messages, should have a plain text body. Mailosaur exposes this content via the `text.body` property on an email or SMS message:
126
+
127
+ ```ruby
128
+ puts(message.text.body) # "Hi Jason, ..."
129
+
130
+ if message.text.body.include? "Jason"
131
+ puts("Email contains 'Jason'")
132
+ end
133
+ ```
134
+
135
+ ### Extracting verification codes from plain text
136
+
137
+ You may have an email or SMS message that contains an account verification code, or some other one-time passcode. You can extract content like this using a simple regex.
138
+
139
+ Here is how to extract a 6-digit numeric code:
140
+
141
+ ```ruby
142
+ puts(message.text.body) # "Your access code is 243546."
143
+
144
+ match = message.text.body.match(/([0-9]{6})/)
145
+ puts(match[0]) # "243546"
146
+ ```
147
+
148
+ [Read more](https://mailosaur.com/docs/test-cases/text-content/)
149
+
150
+ ## Testing HTML content
151
+
152
+ Most emails also have an HTML body, as well as the plain text content. You can access HTML content in a very similar way to plain text:
153
+
154
+ ```ruby
155
+ puts(message.html.body) # "<html><head ..."
156
+ ```
157
+
158
+ ### Working with HTML using nokogiri
159
+
160
+ If you need to traverse the HTML content of an email. For example, finding an element via a CSS selector, you can use the [nokogiri](https://rubygems.org/gems/nokogiri) library.
161
+
162
+ ```sh
163
+ gem install nokogiri
164
+ ```
165
+
166
+ ```ruby
167
+ require 'nokogiri'
168
+
169
+ # ...
170
+
171
+ @doc = Nokogiri::HTML(message.html.body)
172
+ el = @doc.css(".verification-code")
173
+
174
+ verification_code = el.text
175
+
176
+ puts verification_code # "542163"
177
+ ```
178
+
179
+ [Read more](https://mailosaur.com/docs/test-cases/html-content/)
180
+
181
+ ## Working with hyperlinks
182
+
183
+ When an email is sent with an HTML body, Mailosaur automatically extracts any hyperlinks found within anchor (`<a>`) and area (`<area>`) elements and makes these viable via the `html.links` array.
184
+
185
+ Each link has a text property, representing the display text of the hyperlink within the body, and an href property containing the target URL:
186
+
187
+ ```ruby
188
+ # How many links?
189
+ puts(message.html.links.length) # 2
190
+
191
+ first_link = message.html.links[0]
192
+ puts(first_link.text) # "Google Search"
193
+ puts(first_link.href) # "https://www.google.com/"
194
+ ```
195
+
196
+ **Important:** To ensure you always have valid emails. Mailosaur only extracts links that have been correctly marked up with `<a>` or `<area>` tags.
197
+
198
+ ### Links in plain text (including SMS messages)
199
+
200
+ Mailosaur auto-detects links in plain text content too, which is especially useful for SMS testing:
201
+
202
+ ```ruby
203
+ # How many links?
204
+ puts(message.text.links.length) # 2
205
+
206
+ first_link = message.text.links[0]
207
+ puts(first_link.href) # "https://www.google.com/"
208
+ ```
209
+
210
+ ## Working with attachments
211
+
212
+ If your email includes attachments, you can access these via the `attachments` property:
213
+
214
+ ```ruby
215
+ # How many attachments?
216
+ puts(message.attachments.length) # 2
217
+ ```
218
+
219
+ Each attachment contains metadata on the file name and content type:
220
+
221
+ ```ruby
222
+ first_attachment = message.attachments[0]
223
+ puts(first_attachment.file_name) # "contract.pdf"
224
+ puts(first_attachment.content_type) # "application/pdf"
225
+ ```
226
+
227
+ The `length` property returns the size of the attached file (in bytes):
228
+
229
+ ```ruby
230
+ first_attachment = message.attachments[0]
231
+ puts(first_attachment.length) # 4028
232
+ ```
233
+
234
+ ## Working with images and web beacons
235
+
236
+ The `html.images` property of a message contains an array of images found within the HTML content of an email. The length of this array corresponds to the number of images found within an email:
237
+
238
+ ```ruby
239
+ # How many images in the email?
240
+ puts(message.html.images.length) # 1
241
+ ```
242
+
243
+ ### Remotely-hosted images
244
+
245
+ Emails will often contain many images that are hosted elsewhere, such as on your website or product. It is recommended to check that these images are accessible by your recipients.
246
+
247
+ All images should have an alternative text description, which can be checked using the `alt` attribute.
248
+
249
+ ```ruby
250
+ image = message.html.images[0]
251
+ puts(image.alt) # "Hot air balloon"
252
+ ```
253
+
254
+ ### Triggering web beacons
255
+
256
+ A web beacon is a small image that can be used to track whether an email has been opened by a recipient.
257
+
258
+ Because a web beacon is simply another form of remotely-hosted image, you can use the `src` attribute to perform an HTTP request to that address:
259
+
260
+ ```ruby
261
+ image = message.html.images[0]
262
+ puts(image.src) # "https://example.com/s.png?abc123"
263
+
264
+ # Make an HTTP call to trigger the web beacon
265
+ uri = URI(image.src)
266
+ Net::HTTP.start(uri.host, uri.port,
267
+ :use_ssl => uri.scheme == 'https') do |http|
268
+ request = Net::HTTP::Get.new uri
269
+
270
+ response = http.request request # Net::HTTPResponse object
271
+ puts(response.code) # 200
272
+ end
273
+ ```
274
+
275
+ ## Spam checking
276
+
277
+ You can perform a [SpamAssassin](https://spamassassin.apache.org/) check against an email. The structure returned matches the [spam test object](https://mailosaur.com/docs/api/#spam):
278
+
279
+ ```ruby
280
+ result = mailosaur.analysis.spam(message.id)
24
281
 
25
- result = mailosaur.servers.list()
282
+ puts(result.score) # 0.5
26
283
 
27
- print("You have a server called: " + result.items[0].name)
284
+ for r in result.spam_filter_results.spam_assassin do
285
+ puts(r.rule)
286
+ puts(r.description)
287
+ puts(r.score)
288
+ end
28
289
  ```
29
290
 
30
291
  ## Development
@@ -170,5 +170,61 @@ module Mailosaur
170
170
  sleep(delay / 1000)
171
171
  end
172
172
  end
173
+
174
+ #
175
+ # Create a message.
176
+ #
177
+ # Creates a new message that can be sent to a verified email address. This is
178
+ # useful in scenarios where you want an email to trigger a workflow in your
179
+ # product
180
+ #
181
+ # @param server [String] The identifier of the server to create the message in.
182
+ # @param options [MessageCreateOptions] The options with which to create the message.
183
+ #
184
+ # @return [Message] operation result.
185
+ #
186
+ def create(server, message_create_options)
187
+ response = conn.post 'api/messages?server=' + server, message_create_options.to_json
188
+ @handle_http_error.call(response) unless response.status == 200
189
+ model = JSON.load(response.body)
190
+ Mailosaur::Models::Message.new(model)
191
+ end
192
+
193
+ #
194
+ # Forward an email.
195
+ #
196
+ # Forwards the specified email to a verified email address.
197
+ #
198
+ # @param id [String] The identifier of the email to forward.
199
+ # @param options [MessageForwardOptions] The options with which to forward the email.
200
+ # against.
201
+ #
202
+ # @return [Message] operation result.
203
+ #
204
+ def forward(id, message_forward_options)
205
+ response = conn.post 'api/messages/' + id + '/forward', message_forward_options.to_json
206
+ @handle_http_error.call(response) unless response.status == 200
207
+ model = JSON.load(response.body)
208
+ Mailosaur::Models::Message.new(model)
209
+ end
210
+
211
+ #
212
+ # Reply to an email.
213
+ #
214
+ # Sends a reply to the specified email. This is useful for when simulating a user
215
+ # replying to one of your emails.
216
+ #
217
+ # @param id [String] The identifier of the email to reply to.
218
+ # @param options [MessageReplyOptions] The options with which to reply to the email.
219
+ # against.
220
+ #
221
+ # @return [Message] operation result.
222
+ #
223
+ def reply(id, message_reply_options)
224
+ response = conn.post 'api/messages/' + id + '/reply', message_reply_options.to_json
225
+ @handle_http_error.call(response) unless response.status == 200
226
+ model = JSON.load(response.body)
227
+ Mailosaur::Models::Message.new(model)
228
+ end
173
229
  end
174
230
  end
@@ -0,0 +1,31 @@
1
+ module Mailosaur
2
+ module Models
3
+ class MessageCreateOptions < BaseModel
4
+ def initialize(data = {})
5
+ @to = data['to']
6
+ @send = data['send']
7
+ @subject = data['subject']
8
+ @text = data['text']
9
+ @html = data['html']
10
+ end
11
+
12
+ # @return [String] The email address to which the email will be sent.
13
+ # Must be a verified email address.
14
+ attr_accessor :to
15
+
16
+ # @return [Boolean] If true, email will be sent upon creation.
17
+ attr_accessor :send
18
+
19
+ # @return [String] The email subject line.
20
+ attr_accessor :subject
21
+
22
+ # @return [String] The plain text body of the email. Note that only
23
+ # text or html can be supplied, not both.
24
+ attr_accessor :text
25
+
26
+ # @return [String] The HTML body of the email. Note that only text
27
+ # or html can be supplied, not both.
28
+ attr_accessor :html
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ module Mailosaur
2
+ module Models
3
+ class MessageForwardOptions < BaseModel
4
+ def initialize(data = {})
5
+ @to = data['to']
6
+ @text = data['text']
7
+ @html = data['html']
8
+ end
9
+
10
+ # @return [String] The email address to which the email will be sent.
11
+ # Must be a verified email address.
12
+ attr_accessor :to
13
+
14
+ # @return [String] Any additional plain text content to forward the
15
+ # email with. Note that only text or html can be supplied, not both.
16
+ attr_accessor :text
17
+
18
+ # @return [String] Any additional HTML content to forward the email
19
+ # with. Note that only html or text can be supplied, not both.
20
+ attr_accessor :html
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ module Mailosaur
2
+ module Models
3
+ class MessageReplyOptions < BaseModel
4
+ def initialize(data = {})
5
+ @text = data['text']
6
+ @html = data['html']
7
+ end
8
+
9
+ # @return [String] Any additional plain text content to include in
10
+ # the reply. Note that only text or html can be supplied, not both.
11
+ attr_accessor :text
12
+
13
+ # @return [String] Any additional HTML content to include in the
14
+ # reply. Note that only html or text can be supplied, not both.
15
+ attr_accessor :html
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ module Mailosaur
2
+ module Models
3
+ class UsageAccountLimit < BaseModel
4
+ def initialize(data = {})
5
+ @limit = data['limit']
6
+ @current = data['current']
7
+ end
8
+
9
+ # @return [Integer] The limit.
10
+ attr_accessor :limit
11
+
12
+ # @return [Integer] The current usage.
13
+ attr_accessor :current
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ module Mailosaur
2
+ module Models
3
+ class UsageAccountLimits < BaseModel
4
+ def initialize(data = {})
5
+ @servers = Mailosaur::Models::UsageAccountLimit.new(data['servers'])
6
+ @users = Mailosaur::Models::UsageAccountLimit.new(data['users'])
7
+ @email = Mailosaur::Models::UsageAccountLimit.new(data['email'])
8
+ @sms = Mailosaur::Models::UsageAccountLimit.new(data['sms'])
9
+ end
10
+
11
+ # @return [UsageAccountLimit]
12
+ attr_accessor :servers
13
+
14
+ # @return [UsageAccountLimit]
15
+ attr_accessor :users
16
+
17
+ # @return [UsageAccountLimit]
18
+ attr_accessor :email
19
+
20
+ # @return [UsageAccountLimit]
21
+ attr_accessor :sms
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module Mailosaur
2
+ module Models
3
+ class UsageTransaction < BaseModel
4
+ def initialize(data = {})
5
+ @timestamp = DateTime.parse(data['timestamp'])
6
+ @email = data['email']
7
+ @sms = data['sms']
8
+ end
9
+
10
+ # @return [DateTime] The datetime that this transaction occurred.
11
+ attr_accessor :timestamp
12
+
13
+ # @return [Integer] The count of emails.
14
+ attr_accessor :email
15
+
16
+ # @return [Integer] The count of SMS messages.
17
+ attr_accessor :sms
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ module Mailosaur
2
+ module Models
3
+ class UsageTransactionListResult < BaseModel
4
+ def initialize(data = {})
5
+ @items = []
6
+ (data['items'] || []).each do |i| @items << Mailosaur::Models::UsageTransaction.new(i) end
7
+ end
8
+
9
+ # @return [Array<UsageTransaction>] The individual transactions the result.
10
+ attr_accessor :items
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ module Mailosaur
2
+ class Usage
3
+ #
4
+ # Creates and initializes a new instance of the Usage class.
5
+ # @param client connection.
6
+ #
7
+ def initialize(conn, handle_http_error)
8
+ @conn = conn
9
+ @handle_http_error = handle_http_error
10
+ end
11
+
12
+ # @return [Connection] the client connection.
13
+ attr_reader :conn
14
+
15
+ #
16
+ # Retrieve account usage limits.
17
+ #
18
+ # Details the current limits and usage for your account.
19
+ #
20
+ # @return [UsageAccountLimits] operation results.
21
+ #
22
+ def limits
23
+ response = conn.get 'api/usage/limits'
24
+ @handle_http_error.call(response) unless response.status == 200
25
+ model = JSON.load(response.body)
26
+ Mailosaur::Models::UsageAccountLimits.new(model)
27
+ end
28
+
29
+ #
30
+ # List account transactions. Retrieves the last 31 days of transactional usage.
31
+ #
32
+ # @return [UsageTransactionListResult] operation results.
33
+ #
34
+ def transactions
35
+ response = conn.get 'api/usage/transactions'
36
+ @handle_http_error.call(response) unless response.status == 200
37
+ model = JSON.load(response.body)
38
+ Mailosaur::Models::UsageTransactionListResult.new(model)
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,3 @@
1
1
  module Mailosaur
2
- VERSION = '7.2.1'.freeze
2
+ VERSION = '7.4.0'.freeze
3
3
  end
data/lib/mailosaur.rb CHANGED
@@ -13,6 +13,7 @@ module Mailosaur
13
13
  autoload :Files, 'Mailosaur/files.rb'
14
14
  autoload :Messages, 'Mailosaur/messages.rb'
15
15
  autoload :Servers, 'Mailosaur/servers.rb'
16
+ autoload :Usage, 'Mailosaur/usage.rb'
16
17
  autoload :MailosaurError, 'Mailosaur/mailosaur_error.rb'
17
18
 
18
19
  module Models
@@ -25,6 +26,9 @@ module Mailosaur
25
26
  autoload :MessageSummary, 'Mailosaur/models/message_summary.rb'
26
27
  autoload :Image, 'Mailosaur/models/image.rb'
27
28
  autoload :MessageListResult, 'Mailosaur/models/message_list_result.rb'
29
+ autoload :MessageCreateOptions, 'Mailosaur/models/message_create_options.rb'
30
+ autoload :MessageForwardOptions, 'Mailosaur/models/message_forward_options.rb'
31
+ autoload :MessageReplyOptions, 'Mailosaur/models/message_reply_options.rb'
28
32
  autoload :Attachment, 'Mailosaur/models/attachment.rb'
29
33
  autoload :SearchCriteria, 'Mailosaur/models/search_criteria.rb'
30
34
  autoload :MessageContent, 'Mailosaur/models/message_content.rb'
@@ -33,6 +37,10 @@ module Mailosaur
33
37
  autoload :ServerListResult, 'Mailosaur/models/server_list_result.rb'
34
38
  autoload :SpamFilterResults, 'Mailosaur/models/spam_filter_results.rb'
35
39
  autoload :ServerCreateOptions, 'Mailosaur/models/server_create_options.rb'
40
+ autoload :UsageAccountLimits, 'Mailosaur/models/usage_account_limits.rb'
41
+ autoload :UsageAccountLimit, 'Mailosaur/models/usage_account_limit.rb'
42
+ autoload :UsageTransactionListResult, 'Mailosaur/models/usage_transaction_list_result.rb'
43
+ autoload :UsageTransaction, 'Mailosaur/models/usage_transaction.rb'
36
44
  autoload :BaseModel, 'Mailosaur/models/base_model.rb'
37
45
  end
38
46
 
@@ -67,6 +75,11 @@ module Mailosaur
67
75
  @servers ||= Servers.new(connection, method(:handle_http_error))
68
76
  end
69
77
 
78
+ # @return [Usage] usage
79
+ def usage
80
+ @usage ||= Usage.new(connection, method(:handle_http_error))
81
+ end
82
+
70
83
  private
71
84
 
72
85
  def connection
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailosaur
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.1
4
+ version: 7.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mailosaur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-21 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<="
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 0.9.0
19
+ version: '0.9'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "<="
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
- version: 0.9.0
29
+ version: '0.9'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "<="
38
- - !ruby/object:Gem::Version
39
- version: '3.0'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
39
  version: 1.7.5
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '4'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "<="
48
- - !ruby/object:Gem::Version
49
- version: '3.0'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 1.7.5
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '4'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: mail
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -164,8 +164,11 @@ files:
164
164
  - lib/Mailosaur/models/message.rb
165
165
  - lib/Mailosaur/models/message_address.rb
166
166
  - lib/Mailosaur/models/message_content.rb
167
+ - lib/Mailosaur/models/message_create_options.rb
168
+ - lib/Mailosaur/models/message_forward_options.rb
167
169
  - lib/Mailosaur/models/message_header.rb
168
170
  - lib/Mailosaur/models/message_list_result.rb
171
+ - lib/Mailosaur/models/message_reply_options.rb
169
172
  - lib/Mailosaur/models/message_summary.rb
170
173
  - lib/Mailosaur/models/metadata.rb
171
174
  - lib/Mailosaur/models/search_criteria.rb
@@ -175,8 +178,13 @@ files:
175
178
  - lib/Mailosaur/models/spam_analysis_result.rb
176
179
  - lib/Mailosaur/models/spam_assassin_rule.rb
177
180
  - lib/Mailosaur/models/spam_filter_results.rb
181
+ - lib/Mailosaur/models/usage_account_limit.rb
182
+ - lib/Mailosaur/models/usage_account_limits.rb
183
+ - lib/Mailosaur/models/usage_transaction.rb
184
+ - lib/Mailosaur/models/usage_transaction_list_result.rb
178
185
  - lib/Mailosaur/module_definition.rb
179
186
  - lib/Mailosaur/servers.rb
187
+ - lib/Mailosaur/usage.rb
180
188
  - lib/Mailosaur/version.rb
181
189
  - lib/mailosaur.rb
182
190
  homepage: https://mailosaur.com/
@@ -203,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
211
  - !ruby/object:Gem::Version
204
212
  version: '0'
205
213
  requirements: []
206
- rubygems_version: 3.2.15
214
+ rubygems_version: 3.2.22
207
215
  signing_key:
208
216
  specification_version: 4
209
217
  summary: The Mailosaur Ruby library