zyphr 0.1.76 → 0.1.78
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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/docs/InboundEmail.md +2 -0
- data/docs/InboundEmailApi.md +72 -0
- data/docs/Inbox.md +2 -0
- data/docs/ThreadEmail.md +2 -0
- data/lib/zyphr/api/inbound_email_api.rb +63 -0
- data/lib/zyphr/models/inbound_email.rb +12 -1
- data/lib/zyphr/models/inbox.rb +11 -1
- data/lib/zyphr/models/thread_email.rb +12 -1
- data/lib/zyphr/models/webhook_event_type.rb +12 -1
- data/spec/api/inbound_email_api_spec.rb +12 -0
- data/spec/models/inbound_email_spec.rb +6 -0
- data/spec/models/inbox_spec.rb +6 -0
- data/spec/models/thread_email_spec.rb +6 -0
- data/zyphr.gemspec +1 -1
- metadata +527 -527
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5cab379c077fcb3a8c8fcb1db7a4befe5d5cc9595d09ae626812bc9934163c03
|
|
4
|
+
data.tar.gz: ad11f122ad62033ac313217052ac1420605169bb8d494c2e5b2a05b479603c13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7faee7e46850715943ad700666a2609f18919b7be1c91f230636c74a3cdf677d82fcac2474bac9761ef7d887e85733ff8305ae63046ed789f7d612940e671728
|
|
7
|
+
data.tar.gz: 4208414f01d1aa9899bee74cae97f94a34c8406202606ec32701b430c8f66a098c5f11adb30c6e820841373cbc74a1eb4e99648493a40ad038dbd30fbe91f9ec
|
data/README.md
CHANGED
|
@@ -261,6 +261,7 @@ Class | Method | HTTP request | Description
|
|
|
261
261
|
*Zyphr::InboundEmailApi* | [**remove_inbox_thread_label**](docs/InboundEmailApi.md#remove_inbox_thread_label) | **DELETE** /inboxes/threads/{threadId}/labels/{labelId} | Remove a label from a thread
|
|
262
262
|
*Zyphr::InboundEmailApi* | [**reply_to_inbound_email**](docs/InboundEmailApi.md#reply_to_inbound_email) | **POST** /inbound-emails/{id}/reply | Reply to a received email
|
|
263
263
|
*Zyphr::InboundEmailApi* | [**reply_to_inbox_thread**](docs/InboundEmailApi.md#reply_to_inbox_thread) | **POST** /inboxes/threads/{threadId}/reply | Reply to a thread
|
|
264
|
+
*Zyphr::InboundEmailApi* | [**rotate_inbox_receiving_address**](docs/InboundEmailApi.md#rotate_inbox_receiving_address) | **POST** /inboxes/{id}/rotate-receiving-address | Rotate an inbox's forwarding address
|
|
264
265
|
*Zyphr::InboundEmailApi* | [**send_inbox_draft**](docs/InboundEmailApi.md#send_inbox_draft) | **POST** /inboxes/drafts/{draftId}/send | Send a draft
|
|
265
266
|
*Zyphr::InboundEmailApi* | [**set_inbox_thread_labels**](docs/InboundEmailApi.md#set_inbox_thread_labels) | **PUT** /inboxes/threads/{threadId}/labels | Set a thread's labels
|
|
266
267
|
*Zyphr::InboundEmailApi* | [**update_inbox**](docs/InboundEmailApi.md#update_inbox) | **PATCH** /inboxes/{id} | Update an inbox
|
data/docs/InboundEmail.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **id** | **String** | | [optional] |
|
|
8
8
|
| **to_email** | **String** | The receiving address the mail was sent to | [optional] |
|
|
9
9
|
| **inbox_id** | **String** | The inbox the mail was addressed to, or null when the domain has no inboxes (or the inbox was deleted) | [optional] |
|
|
10
|
+
| **forwarded_for** | **String** | Your address this email was forwarded from, when it arrived at an inbox's `receiving_address`. Replies default to it as Reply-To. | [optional] |
|
|
10
11
|
| **from** | [**InboundEmailFrom**](InboundEmailFrom.md) | | [optional] |
|
|
11
12
|
| **cc** | **Array<String>** | | [optional] |
|
|
12
13
|
| **subject** | **String** | | [optional] |
|
|
@@ -31,6 +32,7 @@ instance = Zyphr::InboundEmail.new(
|
|
|
31
32
|
id: null,
|
|
32
33
|
to_email: support@inbound.acme.com,
|
|
33
34
|
inbox_id: null,
|
|
35
|
+
forwarded_for: support@acme.com,
|
|
34
36
|
from: null,
|
|
35
37
|
cc: null,
|
|
36
38
|
subject: null,
|
data/docs/InboundEmailApi.md
CHANGED
|
@@ -30,6 +30,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
30
30
|
| [**remove_inbox_thread_label**](InboundEmailApi.md#remove_inbox_thread_label) | **DELETE** /inboxes/threads/{threadId}/labels/{labelId} | Remove a label from a thread |
|
|
31
31
|
| [**reply_to_inbound_email**](InboundEmailApi.md#reply_to_inbound_email) | **POST** /inbound-emails/{id}/reply | Reply to a received email |
|
|
32
32
|
| [**reply_to_inbox_thread**](InboundEmailApi.md#reply_to_inbox_thread) | **POST** /inboxes/threads/{threadId}/reply | Reply to a thread |
|
|
33
|
+
| [**rotate_inbox_receiving_address**](InboundEmailApi.md#rotate_inbox_receiving_address) | **POST** /inboxes/{id}/rotate-receiving-address | Rotate an inbox's forwarding address |
|
|
33
34
|
| [**send_inbox_draft**](InboundEmailApi.md#send_inbox_draft) | **POST** /inboxes/drafts/{draftId}/send | Send a draft |
|
|
34
35
|
| [**set_inbox_thread_labels**](InboundEmailApi.md#set_inbox_thread_labels) | **PUT** /inboxes/threads/{threadId}/labels | Set a thread's labels |
|
|
35
36
|
| [**update_inbox**](InboundEmailApi.md#update_inbox) | **PATCH** /inboxes/{id} | Update an inbox |
|
|
@@ -1931,6 +1932,77 @@ end
|
|
|
1931
1932
|
- **Accept**: application/json
|
|
1932
1933
|
|
|
1933
1934
|
|
|
1935
|
+
## rotate_inbox_receiving_address
|
|
1936
|
+
|
|
1937
|
+
> <InboxResponse> rotate_inbox_receiving_address(id)
|
|
1938
|
+
|
|
1939
|
+
Rotate an inbox's forwarding address
|
|
1940
|
+
|
|
1941
|
+
Replace the inbox's `receiving_address` with a new secret one. The old address stops working at once, so update your mailbox forwarding to the new address.
|
|
1942
|
+
|
|
1943
|
+
### Examples
|
|
1944
|
+
|
|
1945
|
+
```ruby
|
|
1946
|
+
require 'time'
|
|
1947
|
+
require 'zyphr'
|
|
1948
|
+
# setup authorization
|
|
1949
|
+
Zyphr.configure do |config|
|
|
1950
|
+
# Configure API key authorization: ApiKeyAuth
|
|
1951
|
+
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
1952
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1953
|
+
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
1954
|
+
end
|
|
1955
|
+
|
|
1956
|
+
api_instance = Zyphr::InboundEmailApi.new
|
|
1957
|
+
id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
1958
|
+
|
|
1959
|
+
begin
|
|
1960
|
+
# Rotate an inbox's forwarding address
|
|
1961
|
+
result = api_instance.rotate_inbox_receiving_address(id)
|
|
1962
|
+
p result
|
|
1963
|
+
rescue Zyphr::ApiError => e
|
|
1964
|
+
puts "Error when calling InboundEmailApi->rotate_inbox_receiving_address: #{e}"
|
|
1965
|
+
end
|
|
1966
|
+
```
|
|
1967
|
+
|
|
1968
|
+
#### Using the rotate_inbox_receiving_address_with_http_info variant
|
|
1969
|
+
|
|
1970
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1971
|
+
|
|
1972
|
+
> <Array(<InboxResponse>, Integer, Hash)> rotate_inbox_receiving_address_with_http_info(id)
|
|
1973
|
+
|
|
1974
|
+
```ruby
|
|
1975
|
+
begin
|
|
1976
|
+
# Rotate an inbox's forwarding address
|
|
1977
|
+
data, status_code, headers = api_instance.rotate_inbox_receiving_address_with_http_info(id)
|
|
1978
|
+
p status_code # => 2xx
|
|
1979
|
+
p headers # => { ... }
|
|
1980
|
+
p data # => <InboxResponse>
|
|
1981
|
+
rescue Zyphr::ApiError => e
|
|
1982
|
+
puts "Error when calling InboundEmailApi->rotate_inbox_receiving_address_with_http_info: #{e}"
|
|
1983
|
+
end
|
|
1984
|
+
```
|
|
1985
|
+
|
|
1986
|
+
### Parameters
|
|
1987
|
+
|
|
1988
|
+
| Name | Type | Description | Notes |
|
|
1989
|
+
| ---- | ---- | ----------- | ----- |
|
|
1990
|
+
| **id** | **String** | | |
|
|
1991
|
+
|
|
1992
|
+
### Return type
|
|
1993
|
+
|
|
1994
|
+
[**InboxResponse**](InboxResponse.md)
|
|
1995
|
+
|
|
1996
|
+
### Authorization
|
|
1997
|
+
|
|
1998
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
1999
|
+
|
|
2000
|
+
### HTTP request headers
|
|
2001
|
+
|
|
2002
|
+
- **Content-Type**: Not defined
|
|
2003
|
+
- **Accept**: application/json
|
|
2004
|
+
|
|
2005
|
+
|
|
1934
2006
|
## send_inbox_draft
|
|
1935
2007
|
|
|
1936
2008
|
> <SendEmailResponse> send_inbox_draft(draft_id, opts)
|
data/docs/Inbox.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **id** | **String** | | [optional] |
|
|
8
8
|
| **email_address** | **String** | The inbox's receiving address; `*@inbound.<domain>` for the catch-all | [optional] |
|
|
9
|
+
| **receiving_address** | **String** | Forwarding mode: forward your own mailbox (for example support@acme.com) to this address to receive into the inbox without publishing the inbound MX record. Keep it secret; rotate it with `POST /inboxes/{id}/rotate-receiving-address`. Forwarded mail is accepted only when it comes through your domain (SPF passes for your domain on the envelope sender, as Gmail forwarding does). | [optional] |
|
|
9
10
|
| **is_catch_all** | **Boolean** | True for the domain's catch-all, which receives mail to any address no named inbox matches | [optional] |
|
|
10
11
|
| **enabled** | **Boolean** | Always true for named inboxes. False on a disabled catch-all (strict addresses). | [optional] |
|
|
11
12
|
| **domain_id** | **String** | | [optional] |
|
|
@@ -23,6 +24,7 @@ require 'zyphr'
|
|
|
23
24
|
instance = Zyphr::Inbox.new(
|
|
24
25
|
id: null,
|
|
25
26
|
email_address: support@inbound.acme.com,
|
|
27
|
+
receiving_address: fwd-3f9a0c2e7b1d4e8fa6c5b0d9e2f17a44@inbound.zyphr.dev,
|
|
26
28
|
is_catch_all: null,
|
|
27
29
|
enabled: null,
|
|
28
30
|
domain_id: null,
|
data/docs/ThreadEmail.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **direction** | **String** | `inbound` is a received email (an `/inbound-emails` id); `outbound` is one you sent (an `/emails` id) | [optional] |
|
|
9
9
|
| **from** | [**ThreadEmailFrom**](ThreadEmailFrom.md) | | [optional] |
|
|
10
10
|
| **to** | [**ThreadEmailFrom**](ThreadEmailFrom.md) | | [optional] |
|
|
11
|
+
| **forwarded_for** | **String** | Inbound only: your address this email was forwarded from (forwarding mode). Replies are sent from it. | [optional] |
|
|
11
12
|
| **cc** | **Array<String>** | | [optional] |
|
|
12
13
|
| **subject** | **String** | | [optional] |
|
|
13
14
|
| **text** | **String** | | [optional] |
|
|
@@ -26,6 +27,7 @@ instance = Zyphr::ThreadEmail.new(
|
|
|
26
27
|
direction: null,
|
|
27
28
|
from: null,
|
|
28
29
|
to: null,
|
|
30
|
+
forwarded_for: null,
|
|
29
31
|
cc: null,
|
|
30
32
|
subject: null,
|
|
31
33
|
text: null,
|
|
@@ -1799,6 +1799,69 @@ module Zyphr
|
|
|
1799
1799
|
return data, status_code, headers
|
|
1800
1800
|
end
|
|
1801
1801
|
|
|
1802
|
+
# Rotate an inbox's forwarding address
|
|
1803
|
+
# Replace the inbox's `receiving_address` with a new secret one. The old address stops working at once, so update your mailbox forwarding to the new address.
|
|
1804
|
+
# @param id [String]
|
|
1805
|
+
# @param [Hash] opts the optional parameters
|
|
1806
|
+
# @return [InboxResponse]
|
|
1807
|
+
def rotate_inbox_receiving_address(id, opts = {})
|
|
1808
|
+
data, _status_code, _headers = rotate_inbox_receiving_address_with_http_info(id, opts)
|
|
1809
|
+
data
|
|
1810
|
+
end
|
|
1811
|
+
|
|
1812
|
+
# Rotate an inbox's forwarding address
|
|
1813
|
+
# Replace the inbox's `receiving_address` with a new secret one. The old address stops working at once, so update your mailbox forwarding to the new address.
|
|
1814
|
+
# @param id [String]
|
|
1815
|
+
# @param [Hash] opts the optional parameters
|
|
1816
|
+
# @return [Array<(InboxResponse, Integer, Hash)>] InboxResponse data, response status code and response headers
|
|
1817
|
+
def rotate_inbox_receiving_address_with_http_info(id, opts = {})
|
|
1818
|
+
if @api_client.config.debugging
|
|
1819
|
+
@api_client.config.logger.debug 'Calling API: InboundEmailApi.rotate_inbox_receiving_address ...'
|
|
1820
|
+
end
|
|
1821
|
+
# verify the required parameter 'id' is set
|
|
1822
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1823
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling InboundEmailApi.rotate_inbox_receiving_address"
|
|
1824
|
+
end
|
|
1825
|
+
# resource path
|
|
1826
|
+
local_var_path = '/inboxes/{id}/rotate-receiving-address'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1827
|
+
|
|
1828
|
+
# query parameters
|
|
1829
|
+
query_params = opts[:query_params] || {}
|
|
1830
|
+
|
|
1831
|
+
# header parameters
|
|
1832
|
+
header_params = opts[:header_params] || {}
|
|
1833
|
+
# HTTP header 'Accept' (if needed)
|
|
1834
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1835
|
+
|
|
1836
|
+
# form parameters
|
|
1837
|
+
form_params = opts[:form_params] || {}
|
|
1838
|
+
|
|
1839
|
+
# http body (model)
|
|
1840
|
+
post_body = opts[:debug_body]
|
|
1841
|
+
|
|
1842
|
+
# return_type
|
|
1843
|
+
return_type = opts[:debug_return_type] || 'InboxResponse'
|
|
1844
|
+
|
|
1845
|
+
# auth_names
|
|
1846
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
1847
|
+
|
|
1848
|
+
new_options = opts.merge(
|
|
1849
|
+
:operation => :"InboundEmailApi.rotate_inbox_receiving_address",
|
|
1850
|
+
:header_params => header_params,
|
|
1851
|
+
:query_params => query_params,
|
|
1852
|
+
:form_params => form_params,
|
|
1853
|
+
:body => post_body,
|
|
1854
|
+
:auth_names => auth_names,
|
|
1855
|
+
:return_type => return_type
|
|
1856
|
+
)
|
|
1857
|
+
|
|
1858
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1859
|
+
if @api_client.config.debugging
|
|
1860
|
+
@api_client.config.logger.debug "API called: InboundEmailApi#rotate_inbox_receiving_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1861
|
+
end
|
|
1862
|
+
return data, status_code, headers
|
|
1863
|
+
end
|
|
1864
|
+
|
|
1802
1865
|
# Send a draft
|
|
1803
1866
|
# A draft in a thread is sent exactly like `POST /inboxes/threads/{id}/reply`: to the thread's newest received email, with the `Re:` subject, threading headers, and `reply_to` defaulting to the inbox address. A draft with no thread is sent like `POST /emails`. The draft is deleted once the send is accepted; if the send is refused (a 4xx) the draft is kept and can be fixed and sent again. Takes no body.
|
|
1804
1867
|
# @param draft_id [String]
|
|
@@ -23,6 +23,9 @@ module Zyphr
|
|
|
23
23
|
# The inbox the mail was addressed to, or null when the domain has no inboxes (or the inbox was deleted)
|
|
24
24
|
attr_accessor :inbox_id
|
|
25
25
|
|
|
26
|
+
# Your address this email was forwarded from, when it arrived at an inbox's `receiving_address`. Replies default to it as Reply-To.
|
|
27
|
+
attr_accessor :forwarded_for
|
|
28
|
+
|
|
26
29
|
attr_accessor :from
|
|
27
30
|
|
|
28
31
|
attr_accessor :cc
|
|
@@ -82,6 +85,7 @@ module Zyphr
|
|
|
82
85
|
:'id' => :'id',
|
|
83
86
|
:'to_email' => :'to_email',
|
|
84
87
|
:'inbox_id' => :'inbox_id',
|
|
88
|
+
:'forwarded_for' => :'forwarded_for',
|
|
85
89
|
:'from' => :'from',
|
|
86
90
|
:'cc' => :'cc',
|
|
87
91
|
:'subject' => :'subject',
|
|
@@ -115,6 +119,7 @@ module Zyphr
|
|
|
115
119
|
:'id' => :'String',
|
|
116
120
|
:'to_email' => :'String',
|
|
117
121
|
:'inbox_id' => :'String',
|
|
122
|
+
:'forwarded_for' => :'String',
|
|
118
123
|
:'from' => :'InboundEmailFrom',
|
|
119
124
|
:'cc' => :'Array<String>',
|
|
120
125
|
:'subject' => :'String',
|
|
@@ -136,6 +141,7 @@ module Zyphr
|
|
|
136
141
|
def self.openapi_nullable
|
|
137
142
|
Set.new([
|
|
138
143
|
:'inbox_id',
|
|
144
|
+
:'forwarded_for',
|
|
139
145
|
:'subject',
|
|
140
146
|
:'text_body',
|
|
141
147
|
:'html_body',
|
|
@@ -175,6 +181,10 @@ module Zyphr
|
|
|
175
181
|
self.inbox_id = attributes[:'inbox_id']
|
|
176
182
|
end
|
|
177
183
|
|
|
184
|
+
if attributes.key?(:'forwarded_for')
|
|
185
|
+
self.forwarded_for = attributes[:'forwarded_for']
|
|
186
|
+
end
|
|
187
|
+
|
|
178
188
|
if attributes.key?(:'from')
|
|
179
189
|
self.from = attributes[:'from']
|
|
180
190
|
end
|
|
@@ -307,6 +317,7 @@ module Zyphr
|
|
|
307
317
|
id == o.id &&
|
|
308
318
|
to_email == o.to_email &&
|
|
309
319
|
inbox_id == o.inbox_id &&
|
|
320
|
+
forwarded_for == o.forwarded_for &&
|
|
310
321
|
from == o.from &&
|
|
311
322
|
cc == o.cc &&
|
|
312
323
|
subject == o.subject &&
|
|
@@ -332,7 +343,7 @@ module Zyphr
|
|
|
332
343
|
# Calculates hash code according to all attributes.
|
|
333
344
|
# @return [Integer] Hash code
|
|
334
345
|
def hash
|
|
335
|
-
[id, to_email, inbox_id, from, cc, subject, text_body, html_body, in_reply_to, replied_to_message_id, verified, spf_verdict, dkim_verdict, dmarc_verdict, status, attachments, created_at].hash
|
|
346
|
+
[id, to_email, inbox_id, forwarded_for, from, cc, subject, text_body, html_body, in_reply_to, replied_to_message_id, verified, spf_verdict, dkim_verdict, dmarc_verdict, status, attachments, created_at].hash
|
|
336
347
|
end
|
|
337
348
|
|
|
338
349
|
# Builds the object from hash
|
data/lib/zyphr/models/inbox.rb
CHANGED
|
@@ -20,6 +20,9 @@ module Zyphr
|
|
|
20
20
|
# The inbox's receiving address; `*@inbound.<domain>` for the catch-all
|
|
21
21
|
attr_accessor :email_address
|
|
22
22
|
|
|
23
|
+
# Forwarding mode: forward your own mailbox (for example support@acme.com) to this address to receive into the inbox without publishing the inbound MX record. Keep it secret; rotate it with `POST /inboxes/{id}/rotate-receiving-address`. Forwarded mail is accepted only when it comes through your domain (SPF passes for your domain on the envelope sender, as Gmail forwarding does).
|
|
24
|
+
attr_accessor :receiving_address
|
|
25
|
+
|
|
23
26
|
# True for the domain's catch-all, which receives mail to any address no named inbox matches
|
|
24
27
|
attr_accessor :is_catch_all
|
|
25
28
|
|
|
@@ -46,6 +49,7 @@ module Zyphr
|
|
|
46
49
|
{
|
|
47
50
|
:'id' => :'id',
|
|
48
51
|
:'email_address' => :'email_address',
|
|
52
|
+
:'receiving_address' => :'receiving_address',
|
|
49
53
|
:'is_catch_all' => :'is_catch_all',
|
|
50
54
|
:'enabled' => :'enabled',
|
|
51
55
|
:'domain_id' => :'domain_id',
|
|
@@ -72,6 +76,7 @@ module Zyphr
|
|
|
72
76
|
{
|
|
73
77
|
:'id' => :'String',
|
|
74
78
|
:'email_address' => :'String',
|
|
79
|
+
:'receiving_address' => :'String',
|
|
75
80
|
:'is_catch_all' => :'Boolean',
|
|
76
81
|
:'enabled' => :'Boolean',
|
|
77
82
|
:'domain_id' => :'String',
|
|
@@ -114,6 +119,10 @@ module Zyphr
|
|
|
114
119
|
self.email_address = attributes[:'email_address']
|
|
115
120
|
end
|
|
116
121
|
|
|
122
|
+
if attributes.key?(:'receiving_address')
|
|
123
|
+
self.receiving_address = attributes[:'receiving_address']
|
|
124
|
+
end
|
|
125
|
+
|
|
117
126
|
if attributes.key?(:'is_catch_all')
|
|
118
127
|
self.is_catch_all = attributes[:'is_catch_all']
|
|
119
128
|
end
|
|
@@ -169,6 +178,7 @@ module Zyphr
|
|
|
169
178
|
self.class == o.class &&
|
|
170
179
|
id == o.id &&
|
|
171
180
|
email_address == o.email_address &&
|
|
181
|
+
receiving_address == o.receiving_address &&
|
|
172
182
|
is_catch_all == o.is_catch_all &&
|
|
173
183
|
enabled == o.enabled &&
|
|
174
184
|
domain_id == o.domain_id &&
|
|
@@ -188,7 +198,7 @@ module Zyphr
|
|
|
188
198
|
# Calculates hash code according to all attributes.
|
|
189
199
|
# @return [Integer] Hash code
|
|
190
200
|
def hash
|
|
191
|
-
[id, email_address, is_catch_all, enabled, domain_id, name, from_name, created_at, updated_at, received_count].hash
|
|
201
|
+
[id, email_address, receiving_address, is_catch_all, enabled, domain_id, name, from_name, created_at, updated_at, received_count].hash
|
|
192
202
|
end
|
|
193
203
|
|
|
194
204
|
# Builds the object from hash
|
|
@@ -24,6 +24,9 @@ module Zyphr
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :to
|
|
26
26
|
|
|
27
|
+
# Inbound only: your address this email was forwarded from (forwarding mode). Replies are sent from it.
|
|
28
|
+
attr_accessor :forwarded_for
|
|
29
|
+
|
|
27
30
|
attr_accessor :cc
|
|
28
31
|
|
|
29
32
|
attr_accessor :subject
|
|
@@ -68,6 +71,7 @@ module Zyphr
|
|
|
68
71
|
:'direction' => :'direction',
|
|
69
72
|
:'from' => :'from',
|
|
70
73
|
:'to' => :'to',
|
|
74
|
+
:'forwarded_for' => :'forwarded_for',
|
|
71
75
|
:'cc' => :'cc',
|
|
72
76
|
:'subject' => :'subject',
|
|
73
77
|
:'text' => :'text',
|
|
@@ -95,6 +99,7 @@ module Zyphr
|
|
|
95
99
|
:'direction' => :'String',
|
|
96
100
|
:'from' => :'ThreadEmailFrom',
|
|
97
101
|
:'to' => :'ThreadEmailFrom',
|
|
102
|
+
:'forwarded_for' => :'String',
|
|
98
103
|
:'cc' => :'Array<String>',
|
|
99
104
|
:'subject' => :'String',
|
|
100
105
|
:'text' => :'String',
|
|
@@ -108,6 +113,7 @@ module Zyphr
|
|
|
108
113
|
# List of attributes with nullable: true
|
|
109
114
|
def self.openapi_nullable
|
|
110
115
|
Set.new([
|
|
116
|
+
:'forwarded_for',
|
|
111
117
|
:'subject',
|
|
112
118
|
:'text',
|
|
113
119
|
:'html',
|
|
@@ -146,6 +152,10 @@ module Zyphr
|
|
|
146
152
|
self.to = attributes[:'to']
|
|
147
153
|
end
|
|
148
154
|
|
|
155
|
+
if attributes.key?(:'forwarded_for')
|
|
156
|
+
self.forwarded_for = attributes[:'forwarded_for']
|
|
157
|
+
end
|
|
158
|
+
|
|
149
159
|
if attributes.key?(:'cc')
|
|
150
160
|
if (value = attributes[:'cc']).is_a?(Array)
|
|
151
161
|
self.cc = value
|
|
@@ -215,6 +225,7 @@ module Zyphr
|
|
|
215
225
|
direction == o.direction &&
|
|
216
226
|
from == o.from &&
|
|
217
227
|
to == o.to &&
|
|
228
|
+
forwarded_for == o.forwarded_for &&
|
|
218
229
|
cc == o.cc &&
|
|
219
230
|
subject == o.subject &&
|
|
220
231
|
text == o.text &&
|
|
@@ -233,7 +244,7 @@ module Zyphr
|
|
|
233
244
|
# Calculates hash code according to all attributes.
|
|
234
245
|
# @return [Integer] Hash code
|
|
235
246
|
def hash
|
|
236
|
-
[id, direction, from, to, cc, subject, text, html, status, attachments, created_at].hash
|
|
247
|
+
[id, direction, from, to, forwarded_for, cc, subject, text, html, status, attachments, created_at].hash
|
|
237
248
|
end
|
|
238
249
|
|
|
239
250
|
# Builds the object from hash
|
|
@@ -44,9 +44,20 @@ module Zyphr
|
|
|
44
44
|
USER_IMPERSONATED = "user.impersonated".freeze
|
|
45
45
|
DOMAIN_VERIFIED = "domain.verified".freeze
|
|
46
46
|
DOMAIN_VERIFICATION_FAILED = "domain.verification_failed".freeze
|
|
47
|
+
INBOX_THREAD_CREATED = "inbox.thread.created".freeze
|
|
48
|
+
INBOX_THREAD_FOLDER_UPDATED = "inbox.thread.folder.updated".freeze
|
|
49
|
+
INBOX_THREAD_ASSIGNED = "inbox.thread.assigned".freeze
|
|
50
|
+
INBOX_THREAD_UNASSIGNED = "inbox.thread.unassigned".freeze
|
|
51
|
+
INBOX_THREAD_LABELS_UPDATED = "inbox.thread.labels.updated".freeze
|
|
52
|
+
INBOX_EMAIL_RECEIVED = "inbox.email.received".freeze
|
|
53
|
+
INBOX_EMAIL_SENT = "inbox.email.sent".freeze
|
|
54
|
+
INBOX_DRAFT_CREATED = "inbox.draft.created".freeze
|
|
55
|
+
INBOX_DRAFT_UPDATED = "inbox.draft.updated".freeze
|
|
56
|
+
INBOX_DRAFT_SENT = "inbox.draft.sent".freeze
|
|
57
|
+
INBOX_DRAFT_DELETED = "inbox.draft.deleted".freeze
|
|
47
58
|
|
|
48
59
|
def self.all_vars
|
|
49
|
-
@all_vars ||= [EMAIL_QUEUED, EMAIL_SENT, EMAIL_DELIVERED, EMAIL_BOUNCED, EMAIL_SOFT_BOUNCED, EMAIL_COMPLAINED, EMAIL_OPENED, EMAIL_CLICKED, EMAIL_FAILED, EMAIL_SUPPRESSED, EMAIL_RECEIVED, PUSH_SENT, PUSH_DELIVERED, PUSH_FAILED, PUSH_EXPIRED, USER_CREATED, USER_LOGIN, USER_LOGOUT, USER_PASSWORD_CHANGED, USER_PASSWORD_RESET_REQUESTED, USER_EMAIL_VERIFIED, USER_PHONE_VERIFIED, USER_DELETED, USER_SESSION_REVOKED, USER_MFA_ENABLED, USER_MFA_DISABLED, USER_IMPERSONATED, DOMAIN_VERIFIED, DOMAIN_VERIFICATION_FAILED].freeze
|
|
60
|
+
@all_vars ||= [EMAIL_QUEUED, EMAIL_SENT, EMAIL_DELIVERED, EMAIL_BOUNCED, EMAIL_SOFT_BOUNCED, EMAIL_COMPLAINED, EMAIL_OPENED, EMAIL_CLICKED, EMAIL_FAILED, EMAIL_SUPPRESSED, EMAIL_RECEIVED, PUSH_SENT, PUSH_DELIVERED, PUSH_FAILED, PUSH_EXPIRED, USER_CREATED, USER_LOGIN, USER_LOGOUT, USER_PASSWORD_CHANGED, USER_PASSWORD_RESET_REQUESTED, USER_EMAIL_VERIFIED, USER_PHONE_VERIFIED, USER_DELETED, USER_SESSION_REVOKED, USER_MFA_ENABLED, USER_MFA_DISABLED, USER_IMPERSONATED, DOMAIN_VERIFIED, DOMAIN_VERIFICATION_FAILED, INBOX_THREAD_CREATED, INBOX_THREAD_FOLDER_UPDATED, INBOX_THREAD_ASSIGNED, INBOX_THREAD_UNASSIGNED, INBOX_THREAD_LABELS_UPDATED, INBOX_EMAIL_RECEIVED, INBOX_EMAIL_SENT, INBOX_DRAFT_CREATED, INBOX_DRAFT_UPDATED, INBOX_DRAFT_SENT, INBOX_DRAFT_DELETED].freeze
|
|
50
61
|
end
|
|
51
62
|
|
|
52
63
|
# Builds the enum from string
|
|
@@ -361,6 +361,18 @@ describe 'InboundEmailApi' do
|
|
|
361
361
|
end
|
|
362
362
|
end
|
|
363
363
|
|
|
364
|
+
# unit tests for rotate_inbox_receiving_address
|
|
365
|
+
# Rotate an inbox's forwarding address
|
|
366
|
+
# Replace the inbox's `receiving_address` with a new secret one. The old address stops working at once, so update your mailbox forwarding to the new address.
|
|
367
|
+
# @param id
|
|
368
|
+
# @param [Hash] opts the optional parameters
|
|
369
|
+
# @return [InboxResponse]
|
|
370
|
+
describe 'rotate_inbox_receiving_address test' do
|
|
371
|
+
it 'should work' do
|
|
372
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
|
|
364
376
|
# unit tests for send_inbox_draft
|
|
365
377
|
# Send a draft
|
|
366
378
|
# A draft in a thread is sent exactly like `POST /inboxes/threads/{id}/reply`: to the thread's newest received email, with the `Re:` subject, threading headers, and `reply_to` defaulting to the inbox address. A draft with no thread is sent like `POST /emails`. The draft is deleted once the send is accepted; if the send is refused (a 4xx) the draft is kept and can be fixed and sent again. Takes no body.
|
|
@@ -45,6 +45,12 @@ describe Zyphr::InboundEmail do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe 'test attribute "forwarded_for"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
48
54
|
describe 'test attribute "from"' do
|
|
49
55
|
it 'should work' do
|
|
50
56
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
data/spec/models/inbox_spec.rb
CHANGED
|
@@ -39,6 +39,12 @@ describe Zyphr::Inbox do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
describe 'test attribute "receiving_address"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
42
48
|
describe 'test attribute "is_catch_all"' do
|
|
43
49
|
it 'should work' do
|
|
44
50
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -55,6 +55,12 @@ describe Zyphr::ThreadEmail do
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
describe 'test attribute "forwarded_for"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
58
64
|
describe 'test attribute "cc"' do
|
|
59
65
|
it 'should work' do
|
|
60
66
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|