unione 1.1.3
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 +7 -0
- data/AGENTS.md +99 -0
- data/LICENSE +21 -0
- data/README.md +270 -0
- data/docs/ConfirmedEmail.md +109 -0
- data/docs/Domain.md +257 -0
- data/docs/Email.md +126 -0
- data/docs/EmailValidation.md +54 -0
- data/docs/EventDump.md +157 -0
- data/docs/Obsolete.md +119 -0
- data/docs/Project.md +174 -0
- data/docs/Suppression.md +163 -0
- data/docs/System.md +73 -0
- data/docs/Tag.md +73 -0
- data/docs/Template.md +164 -0
- data/docs/Webhook.md +182 -0
- data/lib/unione/api/confirmed_email/confirmed_email_api.rb +47 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email.rb +49 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_create_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_delete_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_list_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_request.rb +42 -0
- data/lib/unione/api/domain/domain_api.rb +129 -0
- data/lib/unione/api/domain/model/dkim_status.rb +18 -0
- data/lib/unione/api/domain/model/domain_delete_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_delete_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_get_dns_records_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_get_dns_records_response.rb +76 -0
- data/lib/unione/api/domain/model/domain_get_sandbox_domain_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_list_request.rb +60 -0
- data/lib/unione/api/domain/model/domain_list_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item.rb +58 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item_dkim.rb +52 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item_verification_record.rb +50 -0
- data/lib/unione/api/domain/model/domain_validate_dkim_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_validate_dkim_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_validate_verification_record_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_validate_verification_record_response.rb +51 -0
- data/lib/unione/api/email/email_api.rb +56 -0
- data/lib/unione/api/email/model/email_send_request.rb +42 -0
- data/lib/unione/api/email/model/email_send_response.rb +83 -0
- data/lib/unione/api/email/model/email_subscribe_request.rb +58 -0
- data/lib/unione/api/email/model/message_object.rb +291 -0
- data/lib/unione/api/email/model/message_object_options.rb +70 -0
- data/lib/unione/api/email/model/message_object_recipients_item.rb +77 -0
- data/lib/unione/api/email_validation/email_validation_api.rb +34 -0
- data/lib/unione/api/email_validation/model/email_validation_single_request.rb +42 -0
- data/lib/unione/api/email_validation/model/email_validation_single_response.rb +140 -0
- data/lib/unione/api/event_dump/event_dump_api.rb +67 -0
- data/lib/unione/api/event_dump/model/event_dump_create_request.rb +119 -0
- data/lib/unione/api/event_dump/model/event_dump_create_response.rb +52 -0
- data/lib/unione/api/event_dump/model/event_dump_delete_request.rb +43 -0
- data/lib/unione/api/event_dump/model/event_dump_files_object.rb +51 -0
- data/lib/unione/api/event_dump/model/event_dump_get_request.rb +43 -0
- data/lib/unione/api/event_dump/model/event_dump_get_response.rb +51 -0
- data/lib/unione/api/event_dump/model/event_dump_list_response.rb +52 -0
- data/lib/unione/api/event_dump/model/event_dump_object.rb +66 -0
- data/lib/unione/api/event_dump/model/filter_object.rb +139 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_request.rb +42 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_response.rb +59 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_request.rb +43 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response.rb +51 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response_unsubscribed_item.rb +50 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_message.rb +25 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_request.rb +42 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_response.rb +64 -0
- data/lib/unione/api/obsolete/obsolete_api.rb +57 -0
- data/lib/unione/api/project/model/project_create_request.rb +42 -0
- data/lib/unione/api/project/model/project_create_response.rb +60 -0
- data/lib/unione/api/project/model/project_delete_request.rb +52 -0
- data/lib/unione/api/project/model/project_list_object.rb +146 -0
- data/lib/unione/api/project/model/project_list_request.rb +50 -0
- data/lib/unione/api/project/model/project_list_response.rb +51 -0
- data/lib/unione/api/project/model/project_object.rb +94 -0
- data/lib/unione/api/project/model/project_update_object.rb +130 -0
- data/lib/unione/api/project/model/project_update_request.rb +60 -0
- data/lib/unione/api/project/model/project_update_response.rb +52 -0
- data/lib/unione/api/project/project_api.rb +71 -0
- data/lib/unione/api/suppression/model/suppression_delete_request.rb +42 -0
- data/lib/unione/api/suppression/model/suppression_get_object.rb +91 -0
- data/lib/unione/api/suppression/model/suppression_get_request.rb +52 -0
- data/lib/unione/api/suppression/model/suppression_get_response.rb +59 -0
- data/lib/unione/api/suppression/model/suppression_list_object.rb +91 -0
- data/lib/unione/api/suppression/model/suppression_list_request.rb +94 -0
- data/lib/unione/api/suppression/model/suppression_list_response.rb +61 -0
- data/lib/unione/api/suppression/model/suppression_set_request.rb +69 -0
- data/lib/unione/api/suppression/suppression_api.rb +63 -0
- data/lib/unione/api/system/model/project_accounting_object.rb +62 -0
- data/lib/unione/api/system/model/system_info_response.rb +95 -0
- data/lib/unione/api/system/model/system_info_response_accounting.rb +68 -0
- data/lib/unione/api/system/model/system_ping_response.rb +51 -0
- data/lib/unione/api/system/system_api.rb +35 -0
- data/lib/unione/api/tag/model/tag_delete_request.rb +42 -0
- data/lib/unione/api/tag/model/tag_list_response.rb +51 -0
- data/lib/unione/api/tag/model/tags_response_object.rb +50 -0
- data/lib/unione/api/tag/tag_api.rb +40 -0
- data/lib/unione/api/template/model/editor_type.rb +19 -0
- data/lib/unione/api/template/model/template_delete_request.rb +42 -0
- data/lib/unione/api/template/model/template_get_request.rb +42 -0
- data/lib/unione/api/template/model/template_get_response.rb +51 -0
- data/lib/unione/api/template/model/template_list_object.rb +232 -0
- data/lib/unione/api/template/model/template_list_request.rb +52 -0
- data/lib/unione/api/template/model/template_list_response.rb +51 -0
- data/lib/unione/api/template/model/template_object.rb +201 -0
- data/lib/unione/api/template/model/template_set_request.rb +42 -0
- data/lib/unione/api/template/model/template_set_response.rb +51 -0
- data/lib/unione/api/template/template_api.rb +66 -0
- data/lib/unione/api/webhook/model/block_type.rb +20 -0
- data/lib/unione/api/webhook/model/device_type.rb +22 -0
- data/lib/unione/api/webhook/model/domain_status.rb +19 -0
- data/lib/unione/api/webhook/model/event_name.rb +19 -0
- data/lib/unione/api/webhook/model/traffic_type.rb +24 -0
- data/lib/unione/api/webhook/model/webhook_callback.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item.rb +66 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data.rb +167 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data_delivery_info.rb +192 -0
- data/lib/unione/api/webhook/model/webhook_delete_request.rb +42 -0
- data/lib/unione/api/webhook/model/webhook_event_format.rb +18 -0
- data/lib/unione/api/webhook/model/webhook_events_object.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_get_request.rb +42 -0
- data/lib/unione/api/webhook/model/webhook_get_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_list_request.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_list_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_object.rb +123 -0
- data/lib/unione/api/webhook/model/webhook_set_request.rb +109 -0
- data/lib/unione/api/webhook/model/webhook_set_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_status.rb +21 -0
- data/lib/unione/api/webhook/webhook_api.rb +89 -0
- data/lib/unione/client/api_client.rb +93 -0
- data/lib/unione/client/api_error.rb +22 -0
- data/lib/unione/client/configuration.rb +49 -0
- data/lib/unione/client/decode.rb +33 -0
- data/lib/unione/common/model/attachments_array_item.rb +59 -0
- data/lib/unione/common/model/body_object.rb +57 -0
- data/lib/unione/common/model/email_counter_mode.rb +21 -0
- data/lib/unione/common/model/email_status.rb +23 -0
- data/lib/unione/common/model/headers_object.rb +72 -0
- data/lib/unione/common/model/inline_attachments_array_item.rb +59 -0
- data/lib/unione/common/model/success_response.rb +41 -0
- data/lib/unione/common/model/template_engine.rb +19 -0
- data/lib/unione/common/model/verification_record_status.rb +16 -0
- data/lib/unione/uni_one_client.rb +127 -0
- data/lib/unione/version.rb +5 -0
- data/lib/unione.rb +130 -0
- metadata +187 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedCheckRequest
|
|
8
|
+
class ObsoleteUnsubscribedCheckRequest
|
|
9
|
+
# Email to check.
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
attr_accessor :address
|
|
12
|
+
|
|
13
|
+
def initialize(
|
|
14
|
+
address:
|
|
15
|
+
)
|
|
16
|
+
@address = address
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
20
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
21
|
+
def self.from_h(data)
|
|
22
|
+
data = {} unless data.is_a?(Hash)
|
|
23
|
+
new(
|
|
24
|
+
address: data['address']
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# JSON-ready hash, nil fields are omitted.
|
|
29
|
+
def to_h
|
|
30
|
+
{
|
|
31
|
+
'address' => @address,
|
|
32
|
+
}.compact
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def to_json(*args)
|
|
36
|
+
to_h.to_json(*args)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedCheckResponse
|
|
8
|
+
class ObsoleteUnsubscribedCheckResponse
|
|
9
|
+
# "success" string
|
|
10
|
+
# Allowed values: `success`.
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :status
|
|
13
|
+
|
|
14
|
+
# Email that was checked.
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
attr_accessor :address
|
|
17
|
+
|
|
18
|
+
# true if unsubscribed, false if not.
|
|
19
|
+
# @return [Boolean, nil]
|
|
20
|
+
attr_accessor :is_unsubscribed
|
|
21
|
+
|
|
22
|
+
def initialize(
|
|
23
|
+
status: nil,
|
|
24
|
+
address: nil,
|
|
25
|
+
is_unsubscribed: nil
|
|
26
|
+
)
|
|
27
|
+
@status = status
|
|
28
|
+
@address = address
|
|
29
|
+
@is_unsubscribed = is_unsubscribed
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
33
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
34
|
+
def self.from_h(data)
|
|
35
|
+
data = {} unless data.is_a?(Hash)
|
|
36
|
+
new(
|
|
37
|
+
status: data['status'],
|
|
38
|
+
address: data['address'],
|
|
39
|
+
is_unsubscribed: data['is_unsubscribed']
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# JSON-ready hash, nil fields are omitted.
|
|
44
|
+
def to_h
|
|
45
|
+
{
|
|
46
|
+
'status' => @status,
|
|
47
|
+
'address' => @address,
|
|
48
|
+
'is_unsubscribed' => @is_unsubscribed,
|
|
49
|
+
}.compact
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def to_json(*args)
|
|
53
|
+
to_h.to_json(*args)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedListRequest
|
|
8
|
+
class ObsoleteUnsubscribedListRequest
|
|
9
|
+
# Date in the format YYYY-MM-DD to get all unsubscribed emails from the "date_from" to the present
|
|
10
|
+
# day. If the parameter is not specified, the default period is today (from 00:00 UTC).
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :date_from
|
|
13
|
+
|
|
14
|
+
def initialize(
|
|
15
|
+
date_from: nil
|
|
16
|
+
)
|
|
17
|
+
@date_from = date_from
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
21
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
22
|
+
def self.from_h(data)
|
|
23
|
+
data = {} unless data.is_a?(Hash)
|
|
24
|
+
new(
|
|
25
|
+
date_from: data['date_from']
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# JSON-ready hash, nil fields are omitted.
|
|
30
|
+
def to_h
|
|
31
|
+
{
|
|
32
|
+
'date_from' => @date_from,
|
|
33
|
+
}.compact
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def to_json(*args)
|
|
37
|
+
to_h.to_json(*args)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedListResponse
|
|
8
|
+
class ObsoleteUnsubscribedListResponse
|
|
9
|
+
# "success" string
|
|
10
|
+
# Allowed values: `success`.
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :status
|
|
13
|
+
|
|
14
|
+
# Array of object describing unsubscribed emails.
|
|
15
|
+
# @return [Array<ObsoleteUnsubscribedListResponseUnsubscribedItem>, nil]
|
|
16
|
+
attr_accessor :unsubscribed
|
|
17
|
+
|
|
18
|
+
def initialize(
|
|
19
|
+
status: nil,
|
|
20
|
+
unsubscribed: nil
|
|
21
|
+
)
|
|
22
|
+
@status = status
|
|
23
|
+
@unsubscribed = unsubscribed
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
27
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
28
|
+
def self.from_h(data)
|
|
29
|
+
data = {} unless data.is_a?(Hash)
|
|
30
|
+
new(
|
|
31
|
+
status: data['status'],
|
|
32
|
+
unsubscribed: ::UniOne::Client::Decode.list(data['unsubscribed']) { |item0| ::UniOne::Client::Decode.model(::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedListResponseUnsubscribedItem, item0) }
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# JSON-ready hash, nil fields are omitted.
|
|
37
|
+
def to_h
|
|
38
|
+
{
|
|
39
|
+
'status' => @status,
|
|
40
|
+
'unsubscribed' => @unsubscribed.nil? ? nil : @unsubscribed.map { |item0| item0.to_h },
|
|
41
|
+
}.compact
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def to_json(*args)
|
|
45
|
+
to_h.to_json(*args)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedListResponseUnsubscribedItem
|
|
8
|
+
class ObsoleteUnsubscribedListResponseUnsubscribedItem
|
|
9
|
+
# Unsubscribed email.
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
attr_accessor :address
|
|
12
|
+
|
|
13
|
+
# Date and time when a recipient unsubscribed, in UTC timezone and "YYYY-MM-DD hh:mm:ss" format.
|
|
14
|
+
# @return [String, nil]
|
|
15
|
+
attr_accessor :unsubscribed_on
|
|
16
|
+
|
|
17
|
+
def initialize(
|
|
18
|
+
address: nil,
|
|
19
|
+
unsubscribed_on: nil
|
|
20
|
+
)
|
|
21
|
+
@address = address
|
|
22
|
+
@unsubscribed_on = unsubscribed_on
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
26
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
27
|
+
def self.from_h(data)
|
|
28
|
+
data = {} unless data.is_a?(Hash)
|
|
29
|
+
new(
|
|
30
|
+
address: data['address'],
|
|
31
|
+
unsubscribed_on: data['unsubscribed_on']
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# JSON-ready hash, nil fields are omitted.
|
|
36
|
+
def to_h
|
|
37
|
+
{
|
|
38
|
+
'address' => @address,
|
|
39
|
+
'unsubscribed_on' => @unsubscribed_on,
|
|
40
|
+
}.compact
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def to_json(*args)
|
|
44
|
+
to_h.to_json(*args)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# Unsubscription process details:
|
|
8
|
+
#
|
|
9
|
+
# - "unsubscribed" if email has just been unsubscribed,
|
|
10
|
+
# - "was inactive" if it was inactive due some reason,
|
|
11
|
+
# - "was unsubscribed" if it already was unsubscribed before the call,
|
|
12
|
+
# - "added and unsubscribed" if it's a new email without status history and it was added and then unsubscribed immediately.
|
|
13
|
+
module ObsoleteUnsubscribedSetMessage
|
|
14
|
+
UNSUBSCRIBED = 'unsubscribed'
|
|
15
|
+
WAS_INACTIVE = 'was inactive'
|
|
16
|
+
WAS_UNSUBSCRIBED = 'was unsubscribed'
|
|
17
|
+
ADDED_AND_UNSUBSCRIBED = 'added and unsubscribed'
|
|
18
|
+
|
|
19
|
+
# All values
|
|
20
|
+
ALL = [UNSUBSCRIBED, WAS_INACTIVE, WAS_UNSUBSCRIBED, ADDED_AND_UNSUBSCRIBED].freeze
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedSetRequest
|
|
8
|
+
class ObsoleteUnsubscribedSetRequest
|
|
9
|
+
# Email to be unsubscribed.
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
attr_accessor :address
|
|
12
|
+
|
|
13
|
+
def initialize(
|
|
14
|
+
address:
|
|
15
|
+
)
|
|
16
|
+
@address = address
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
20
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
21
|
+
def self.from_h(data)
|
|
22
|
+
data = {} unless data.is_a?(Hash)
|
|
23
|
+
new(
|
|
24
|
+
address: data['address']
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# JSON-ready hash, nil fields are omitted.
|
|
29
|
+
def to_h
|
|
30
|
+
{
|
|
31
|
+
'address' => @address,
|
|
32
|
+
}.compact
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def to_json(*args)
|
|
36
|
+
to_h.to_json(*args)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Obsolete
|
|
6
|
+
module Model
|
|
7
|
+
# ObsoleteUnsubscribedSetResponse
|
|
8
|
+
class ObsoleteUnsubscribedSetResponse
|
|
9
|
+
# "success" string
|
|
10
|
+
# Allowed values: `success`.
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :status
|
|
13
|
+
|
|
14
|
+
# The unsubscribed email.
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
attr_accessor :address
|
|
17
|
+
|
|
18
|
+
# Unsubscription process details:
|
|
19
|
+
#
|
|
20
|
+
# - "unsubscribed" if email has just been unsubscribed,
|
|
21
|
+
# - "was inactive" if it was inactive due some reason,
|
|
22
|
+
# - "was unsubscribed" if it already was unsubscribed before the call,
|
|
23
|
+
# - "added and unsubscribed" if it's a new email without status history and it was added and then unsubscribed immediately.
|
|
24
|
+
# @return [ObsoleteUnsubscribedSetMessage, nil]
|
|
25
|
+
attr_accessor :message
|
|
26
|
+
|
|
27
|
+
def initialize(
|
|
28
|
+
status: nil,
|
|
29
|
+
address: nil,
|
|
30
|
+
message: nil
|
|
31
|
+
)
|
|
32
|
+
@status = status
|
|
33
|
+
@address = address
|
|
34
|
+
@message = message
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
38
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
39
|
+
def self.from_h(data)
|
|
40
|
+
data = {} unless data.is_a?(Hash)
|
|
41
|
+
new(
|
|
42
|
+
status: data['status'],
|
|
43
|
+
address: data['address'],
|
|
44
|
+
message: data['message']
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# JSON-ready hash, nil fields are omitted.
|
|
49
|
+
def to_h
|
|
50
|
+
{
|
|
51
|
+
'status' => @status,
|
|
52
|
+
'address' => @address,
|
|
53
|
+
'message' => @message,
|
|
54
|
+
}.compact
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def to_json(*args)
|
|
58
|
+
to_h.to_json(*args)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'json'
|
|
4
|
+
|
|
5
|
+
module UniOne
|
|
6
|
+
module Api
|
|
7
|
+
module Obsolete
|
|
8
|
+
# Obsolete methods dealing with unsubscribes. We recommend using the more flexible
|
|
9
|
+
# [suppression](https://docs.unione.io/en/web-api-ref#suppression) methods instead. Note that you
|
|
10
|
+
# can't resubscribe an unsubscribed recipient using WebAPI, but you can send him an email with
|
|
11
|
+
# subscription link using email/subscribe method.
|
|
12
|
+
class ObsoleteApi
|
|
13
|
+
# @param client [::UniOne::Client::ApiClient]
|
|
14
|
+
def initialize(client)
|
|
15
|
+
@client = client
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Registers a new unsubscribed email.
|
|
19
|
+
#
|
|
20
|
+
# After registering an email as unsubscribed all future attempts to send a message to this email will
|
|
21
|
+
# be rejected. Please note that there's no way to remove an email from unsubscribed thru the API. But
|
|
22
|
+
# you can send an email with a link to resubscribe using
|
|
23
|
+
# [email/subscribe](https://docs.unione.io/en/web-api-ref#email-subscribe) method or remove
|
|
24
|
+
# "unsubscribed" status manually on [Email Search page](https://cp.unione.io/en/user/email) in control
|
|
25
|
+
# panel (but only a limited number of unsubscribed email per day can be removed).
|
|
26
|
+
#
|
|
27
|
+
# Documentation: https://docs.unione.io/en/web-api-ref#unsubscribed-set
|
|
28
|
+
# @param request [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedSetRequest, Hash]
|
|
29
|
+
# @return [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedSetResponse]
|
|
30
|
+
# @raise [::UniOne::Client::ApiError]
|
|
31
|
+
def unsubscribed_set(request)
|
|
32
|
+
::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedSetResponse.from_h(@client.call('/unsubscribed/set.json', request.is_a?(Hash) ? request : request.to_h))
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Checks if an email is unsubscribed.
|
|
36
|
+
#
|
|
37
|
+
# Documentation: https://docs.unione.io/en/web-api-ref#unsubscribed-check
|
|
38
|
+
# @param request [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedCheckRequest, Hash]
|
|
39
|
+
# @return [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedCheckResponse]
|
|
40
|
+
# @raise [::UniOne::Client::ApiError]
|
|
41
|
+
def unsubscribed_check(request)
|
|
42
|
+
::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedCheckResponse.from_h(@client.call('/unsubscribed/check.json', request.is_a?(Hash) ? request : request.to_h))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns a list of all unsubscribed emails since provided date.
|
|
46
|
+
#
|
|
47
|
+
# Documentation: https://docs.unione.io/en/web-api-ref#unsubscribed-list
|
|
48
|
+
# @param request [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedListRequest, Hash]
|
|
49
|
+
# @return [::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedListResponse]
|
|
50
|
+
# @raise [::UniOne::Client::ApiError]
|
|
51
|
+
def unsubscribed_list(request)
|
|
52
|
+
::UniOne::Api::Obsolete::Model::ObsoleteUnsubscribedListResponse.from_h(@client.call('/unsubscribed/list.json', request.is_a?(Hash) ? request : request.to_h))
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Project
|
|
6
|
+
module Model
|
|
7
|
+
# ProjectCreateRequest
|
|
8
|
+
class ProjectCreateRequest
|
|
9
|
+
# Object with project properties.
|
|
10
|
+
# @return [ProjectObject, nil]
|
|
11
|
+
attr_accessor :project
|
|
12
|
+
|
|
13
|
+
def initialize(
|
|
14
|
+
project:
|
|
15
|
+
)
|
|
16
|
+
@project = project
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
20
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
21
|
+
def self.from_h(data)
|
|
22
|
+
data = {} unless data.is_a?(Hash)
|
|
23
|
+
new(
|
|
24
|
+
project: ::UniOne::Client::Decode.model(::UniOne::Api::Project::Model::ProjectObject, data['project'])
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# JSON-ready hash, nil fields are omitted.
|
|
29
|
+
def to_h
|
|
30
|
+
{
|
|
31
|
+
'project' => @project.nil? ? nil : @project.to_h,
|
|
32
|
+
}.compact
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def to_json(*args)
|
|
36
|
+
to_h.to_json(*args)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Project
|
|
6
|
+
module Model
|
|
7
|
+
# ProjectCreateResponse
|
|
8
|
+
class ProjectCreateResponse
|
|
9
|
+
# "success" string
|
|
10
|
+
# Allowed values: `success`.
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :status
|
|
13
|
+
|
|
14
|
+
# Unqiue project identifier, ASCII string up to 36 characters long.
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
attr_accessor :project_id
|
|
17
|
+
|
|
18
|
+
# API key of the project. You can use it instead of the user API key parameter in all methods except
|
|
19
|
+
# project/* methods.
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
attr_accessor :project_api_key
|
|
22
|
+
|
|
23
|
+
def initialize(
|
|
24
|
+
status: nil,
|
|
25
|
+
project_id: nil,
|
|
26
|
+
project_api_key: nil
|
|
27
|
+
)
|
|
28
|
+
@status = status
|
|
29
|
+
@project_id = project_id
|
|
30
|
+
@project_api_key = project_api_key
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
34
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
35
|
+
def self.from_h(data)
|
|
36
|
+
data = {} unless data.is_a?(Hash)
|
|
37
|
+
new(
|
|
38
|
+
status: data['status'],
|
|
39
|
+
project_id: data['project_id'],
|
|
40
|
+
project_api_key: data['project_api_key']
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# JSON-ready hash, nil fields are omitted.
|
|
45
|
+
def to_h
|
|
46
|
+
{
|
|
47
|
+
'status' => @status,
|
|
48
|
+
'project_id' => @project_id,
|
|
49
|
+
'project_api_key' => @project_api_key,
|
|
50
|
+
}.compact
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def to_json(*args)
|
|
54
|
+
to_h.to_json(*args)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module UniOne
|
|
4
|
+
module Api
|
|
5
|
+
module Project
|
|
6
|
+
module Model
|
|
7
|
+
# ProjectDeleteRequest
|
|
8
|
+
class ProjectDeleteRequest
|
|
9
|
+
# Unique project identifier. You should identify project to delete either with project_id or with
|
|
10
|
+
# project_api_key field. We recommend usage of project_id as a more secure option.
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
attr_accessor :project_id
|
|
13
|
+
|
|
14
|
+
# Optional project API key. You should identify project to delete either with project_id or with
|
|
15
|
+
# project_api_key field. We recommend usage of project_id as a more secure option.
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
attr_accessor :project_api_key
|
|
18
|
+
|
|
19
|
+
def initialize(
|
|
20
|
+
project_id: nil,
|
|
21
|
+
project_api_key: nil
|
|
22
|
+
)
|
|
23
|
+
@project_id = project_id
|
|
24
|
+
@project_api_key = project_api_key
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
|
|
28
|
+
# gives nil (data that is not a Hash gives an empty object).
|
|
29
|
+
def self.from_h(data)
|
|
30
|
+
data = {} unless data.is_a?(Hash)
|
|
31
|
+
new(
|
|
32
|
+
project_id: data['project_id'],
|
|
33
|
+
project_api_key: data['project_api_key']
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# JSON-ready hash, nil fields are omitted.
|
|
38
|
+
def to_h
|
|
39
|
+
{
|
|
40
|
+
'project_id' => @project_id,
|
|
41
|
+
'project_api_key' => @project_api_key,
|
|
42
|
+
}.compact
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def to_json(*args)
|
|
46
|
+
to_h.to_json(*args)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|