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.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/AGENTS.md +99 -0
  3. data/LICENSE +21 -0
  4. data/README.md +270 -0
  5. data/docs/ConfirmedEmail.md +109 -0
  6. data/docs/Domain.md +257 -0
  7. data/docs/Email.md +126 -0
  8. data/docs/EmailValidation.md +54 -0
  9. data/docs/EventDump.md +157 -0
  10. data/docs/Obsolete.md +119 -0
  11. data/docs/Project.md +174 -0
  12. data/docs/Suppression.md +163 -0
  13. data/docs/System.md +73 -0
  14. data/docs/Tag.md +73 -0
  15. data/docs/Template.md +164 -0
  16. data/docs/Webhook.md +182 -0
  17. data/lib/unione/api/confirmed_email/confirmed_email_api.rb +47 -0
  18. data/lib/unione/api/confirmed_email/model/confirmed_email.rb +49 -0
  19. data/lib/unione/api/confirmed_email/model/confirmed_email_create_response.rb +50 -0
  20. data/lib/unione/api/confirmed_email/model/confirmed_email_delete_response.rb +50 -0
  21. data/lib/unione/api/confirmed_email/model/confirmed_email_list_response.rb +50 -0
  22. data/lib/unione/api/confirmed_email/model/confirmed_email_request.rb +42 -0
  23. data/lib/unione/api/domain/domain_api.rb +129 -0
  24. data/lib/unione/api/domain/model/dkim_status.rb +18 -0
  25. data/lib/unione/api/domain/model/domain_delete_request.rb +42 -0
  26. data/lib/unione/api/domain/model/domain_delete_response.rb +51 -0
  27. data/lib/unione/api/domain/model/domain_get_dns_records_request.rb +42 -0
  28. data/lib/unione/api/domain/model/domain_get_dns_records_response.rb +76 -0
  29. data/lib/unione/api/domain/model/domain_get_sandbox_domain_response.rb +51 -0
  30. data/lib/unione/api/domain/model/domain_list_request.rb +60 -0
  31. data/lib/unione/api/domain/model/domain_list_response.rb +51 -0
  32. data/lib/unione/api/domain/model/domain_list_response_domains_item.rb +58 -0
  33. data/lib/unione/api/domain/model/domain_list_response_domains_item_dkim.rb +52 -0
  34. data/lib/unione/api/domain/model/domain_list_response_domains_item_verification_record.rb +50 -0
  35. data/lib/unione/api/domain/model/domain_validate_dkim_request.rb +42 -0
  36. data/lib/unione/api/domain/model/domain_validate_dkim_response.rb +51 -0
  37. data/lib/unione/api/domain/model/domain_validate_verification_record_request.rb +42 -0
  38. data/lib/unione/api/domain/model/domain_validate_verification_record_response.rb +51 -0
  39. data/lib/unione/api/email/email_api.rb +56 -0
  40. data/lib/unione/api/email/model/email_send_request.rb +42 -0
  41. data/lib/unione/api/email/model/email_send_response.rb +83 -0
  42. data/lib/unione/api/email/model/email_subscribe_request.rb +58 -0
  43. data/lib/unione/api/email/model/message_object.rb +291 -0
  44. data/lib/unione/api/email/model/message_object_options.rb +70 -0
  45. data/lib/unione/api/email/model/message_object_recipients_item.rb +77 -0
  46. data/lib/unione/api/email_validation/email_validation_api.rb +34 -0
  47. data/lib/unione/api/email_validation/model/email_validation_single_request.rb +42 -0
  48. data/lib/unione/api/email_validation/model/email_validation_single_response.rb +140 -0
  49. data/lib/unione/api/event_dump/event_dump_api.rb +67 -0
  50. data/lib/unione/api/event_dump/model/event_dump_create_request.rb +119 -0
  51. data/lib/unione/api/event_dump/model/event_dump_create_response.rb +52 -0
  52. data/lib/unione/api/event_dump/model/event_dump_delete_request.rb +43 -0
  53. data/lib/unione/api/event_dump/model/event_dump_files_object.rb +51 -0
  54. data/lib/unione/api/event_dump/model/event_dump_get_request.rb +43 -0
  55. data/lib/unione/api/event_dump/model/event_dump_get_response.rb +51 -0
  56. data/lib/unione/api/event_dump/model/event_dump_list_response.rb +52 -0
  57. data/lib/unione/api/event_dump/model/event_dump_object.rb +66 -0
  58. data/lib/unione/api/event_dump/model/filter_object.rb +139 -0
  59. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_request.rb +42 -0
  60. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_response.rb +59 -0
  61. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_request.rb +43 -0
  62. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response.rb +51 -0
  63. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response_unsubscribed_item.rb +50 -0
  64. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_message.rb +25 -0
  65. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_request.rb +42 -0
  66. data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_response.rb +64 -0
  67. data/lib/unione/api/obsolete/obsolete_api.rb +57 -0
  68. data/lib/unione/api/project/model/project_create_request.rb +42 -0
  69. data/lib/unione/api/project/model/project_create_response.rb +60 -0
  70. data/lib/unione/api/project/model/project_delete_request.rb +52 -0
  71. data/lib/unione/api/project/model/project_list_object.rb +146 -0
  72. data/lib/unione/api/project/model/project_list_request.rb +50 -0
  73. data/lib/unione/api/project/model/project_list_response.rb +51 -0
  74. data/lib/unione/api/project/model/project_object.rb +94 -0
  75. data/lib/unione/api/project/model/project_update_object.rb +130 -0
  76. data/lib/unione/api/project/model/project_update_request.rb +60 -0
  77. data/lib/unione/api/project/model/project_update_response.rb +52 -0
  78. data/lib/unione/api/project/project_api.rb +71 -0
  79. data/lib/unione/api/suppression/model/suppression_delete_request.rb +42 -0
  80. data/lib/unione/api/suppression/model/suppression_get_object.rb +91 -0
  81. data/lib/unione/api/suppression/model/suppression_get_request.rb +52 -0
  82. data/lib/unione/api/suppression/model/suppression_get_response.rb +59 -0
  83. data/lib/unione/api/suppression/model/suppression_list_object.rb +91 -0
  84. data/lib/unione/api/suppression/model/suppression_list_request.rb +94 -0
  85. data/lib/unione/api/suppression/model/suppression_list_response.rb +61 -0
  86. data/lib/unione/api/suppression/model/suppression_set_request.rb +69 -0
  87. data/lib/unione/api/suppression/suppression_api.rb +63 -0
  88. data/lib/unione/api/system/model/project_accounting_object.rb +62 -0
  89. data/lib/unione/api/system/model/system_info_response.rb +95 -0
  90. data/lib/unione/api/system/model/system_info_response_accounting.rb +68 -0
  91. data/lib/unione/api/system/model/system_ping_response.rb +51 -0
  92. data/lib/unione/api/system/system_api.rb +35 -0
  93. data/lib/unione/api/tag/model/tag_delete_request.rb +42 -0
  94. data/lib/unione/api/tag/model/tag_list_response.rb +51 -0
  95. data/lib/unione/api/tag/model/tags_response_object.rb +50 -0
  96. data/lib/unione/api/tag/tag_api.rb +40 -0
  97. data/lib/unione/api/template/model/editor_type.rb +19 -0
  98. data/lib/unione/api/template/model/template_delete_request.rb +42 -0
  99. data/lib/unione/api/template/model/template_get_request.rb +42 -0
  100. data/lib/unione/api/template/model/template_get_response.rb +51 -0
  101. data/lib/unione/api/template/model/template_list_object.rb +232 -0
  102. data/lib/unione/api/template/model/template_list_request.rb +52 -0
  103. data/lib/unione/api/template/model/template_list_response.rb +51 -0
  104. data/lib/unione/api/template/model/template_object.rb +201 -0
  105. data/lib/unione/api/template/model/template_set_request.rb +42 -0
  106. data/lib/unione/api/template/model/template_set_response.rb +51 -0
  107. data/lib/unione/api/template/template_api.rb +66 -0
  108. data/lib/unione/api/webhook/model/block_type.rb +20 -0
  109. data/lib/unione/api/webhook/model/device_type.rb +22 -0
  110. data/lib/unione/api/webhook/model/domain_status.rb +19 -0
  111. data/lib/unione/api/webhook/model/event_name.rb +19 -0
  112. data/lib/unione/api/webhook/model/traffic_type.rb +24 -0
  113. data/lib/unione/api/webhook/model/webhook_callback.rb +52 -0
  114. data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item.rb +66 -0
  115. data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item.rb +52 -0
  116. data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data.rb +167 -0
  117. data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data_delivery_info.rb +192 -0
  118. data/lib/unione/api/webhook/model/webhook_delete_request.rb +42 -0
  119. data/lib/unione/api/webhook/model/webhook_event_format.rb +18 -0
  120. data/lib/unione/api/webhook/model/webhook_events_object.rb +52 -0
  121. data/lib/unione/api/webhook/model/webhook_get_request.rb +42 -0
  122. data/lib/unione/api/webhook/model/webhook_get_response.rb +51 -0
  123. data/lib/unione/api/webhook/model/webhook_list_request.rb +51 -0
  124. data/lib/unione/api/webhook/model/webhook_list_response.rb +51 -0
  125. data/lib/unione/api/webhook/model/webhook_object.rb +123 -0
  126. data/lib/unione/api/webhook/model/webhook_set_request.rb +109 -0
  127. data/lib/unione/api/webhook/model/webhook_set_response.rb +51 -0
  128. data/lib/unione/api/webhook/model/webhook_status.rb +21 -0
  129. data/lib/unione/api/webhook/webhook_api.rb +89 -0
  130. data/lib/unione/client/api_client.rb +93 -0
  131. data/lib/unione/client/api_error.rb +22 -0
  132. data/lib/unione/client/configuration.rb +49 -0
  133. data/lib/unione/client/decode.rb +33 -0
  134. data/lib/unione/common/model/attachments_array_item.rb +59 -0
  135. data/lib/unione/common/model/body_object.rb +57 -0
  136. data/lib/unione/common/model/email_counter_mode.rb +21 -0
  137. data/lib/unione/common/model/email_status.rb +23 -0
  138. data/lib/unione/common/model/headers_object.rb +72 -0
  139. data/lib/unione/common/model/inline_attachments_array_item.rb +59 -0
  140. data/lib/unione/common/model/success_response.rb +41 -0
  141. data/lib/unione/common/model/template_engine.rb +19 -0
  142. data/lib/unione/common/model/verification_record_status.rb +16 -0
  143. data/lib/unione/uni_one_client.rb +127 -0
  144. data/lib/unione/version.rb +5 -0
  145. data/lib/unione.rb +130 -0
  146. metadata +187 -0
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ module UniOne
6
+ module Api
7
+ module EventDump
8
+ # These methods are used to obtain a list of events for a given period of time. The data is stored for
9
+ # up to 45 days, depending on your tariff, i. e. you may fetch all event data starting from 00:00:00
10
+ # 31 days ago and up to current time. For custom tarifs with big sending volumes event dumps are
11
+ # available only for the last 7 days.
12
+ class EventDumpApi
13
+ # @param client [::UniOne::Client::ApiClient]
14
+ def initialize(client)
15
+ @client = client
16
+ end
17
+
18
+ # This asynchronous method initiates the preparation of data dump in CSV format. The number of dump
19
+ # files created or stored is limited to 10; to order more files, you have to delete one of the
20
+ # previous ones or wait until they will be deleted automatically. A newly created dump file is kept
21
+ # for 8 hours. If the request period is more than a day or there are too many events then several
22
+ # files will be generated and each file will contain no more than 100,000 events. File contains
23
+ # columns with the following information - 'event_time', 'job_id', 'from_email', 'email', 'status',
24
+ # 'delivery_status', 'metadata', 'destination_response', 'user_agent', 'url', 'ip', 'tags' and
25
+ # 'project_id' (for accounts with projects enabled). You can change the fields and include 'subject'
26
+ # field using 'dump_fileds' parameter.
27
+ #
28
+ # Documentation: https://docs.unione.io/en/web-api-ref#event-dump-create
29
+ # @param request [::UniOne::Api::EventDump::Model::EventDumpCreateRequest, Hash]
30
+ # @return [::UniOne::Api::EventDump::Model::EventDumpCreateResponse]
31
+ # @raise [::UniOne::Client::ApiError]
32
+ def create(request)
33
+ ::UniOne::Api::EventDump::Model::EventDumpCreateResponse.from_h(@client.call('/event-dump/create.json', request.is_a?(Hash) ? request : request.to_h))
34
+ end
35
+
36
+ # Returns dump properties for a given identifier
37
+ #
38
+ # Documentation: https://docs.unione.io/en/web-api-ref#event-dump-get
39
+ # @param request [::UniOne::Api::EventDump::Model::EventDumpGetRequest, Hash]
40
+ # @return [::UniOne::Api::EventDump::Model::EventDumpGetResponse]
41
+ # @raise [::UniOne::Client::ApiError]
42
+ def get(request)
43
+ ::UniOne::Api::EventDump::Model::EventDumpGetResponse.from_h(@client.call('/event-dump/get.json', request.is_a?(Hash) ? request : request.to_h))
44
+ end
45
+
46
+ # This method does not require any parameters; returns the full list of existing dumps.
47
+ #
48
+ # Documentation: https://docs.unione.io/en/web-api-ref#event-dump-list
49
+ # @return [::UniOne::Api::EventDump::Model::EventDumpListResponse]
50
+ # @raise [::UniOne::Client::ApiError]
51
+ def list
52
+ ::UniOne::Api::EventDump::Model::EventDumpListResponse.from_h(@client.call('/event-dump/list.json'))
53
+ end
54
+
55
+ # Removes dump from queue or storage.
56
+ #
57
+ # Documentation: https://docs.unione.io/en/web-api-ref#event-dump-delete
58
+ # @param request [::UniOne::Api::EventDump::Model::EventDumpDeleteRequest, Hash]
59
+ # @return [::UniOne::Common::Model::SuccessResponse]
60
+ # @raise [::UniOne::Client::ApiError]
61
+ def delete(request)
62
+ ::UniOne::Common::Model::SuccessResponse.from_h(@client.call('/event-dump/delete.json', request.is_a?(Hash) ? request : request.to_h))
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # EventDumpCreateRequest
8
+ class EventDumpCreateRequest
9
+ # Date and time in YYYY-MM-DD hh:mm:ss format, specifying period start time. Data is stored for up to
10
+ # 32 days, depending on your tariff.
11
+ # @return [String, nil]
12
+ attr_accessor :start_time
13
+
14
+ # Date and time in YYYY-MM-DD hh:mm:ss format, specifying period end time (non-inclusive).
15
+ # @return [String, nil]
16
+ attr_accessor :end_time
17
+
18
+ # Maximum number of events returned (default is 50). If this value is over 100 000, several files will
19
+ # be created, each having 100 000 events maximum.
20
+ # @return [Integer, nil]
21
+ attr_accessor :limit
22
+
23
+ # For accounts with projects enabled, the value all_projects=true allows to fetch data for all
24
+ # existing projects.
25
+ # Default: `False`.
26
+ # @return [Boolean, nil]
27
+ attr_accessor :all_projects
28
+
29
+ # An object with the properties of the event dump filter.
30
+ # @return [FilterObject, nil]
31
+ attr_accessor :filter
32
+
33
+ # An array of strings containing the names of columns you need in your report, in your preferred
34
+ # order. If the 'dump_fields' array is missing or empty, a default field list and order will be
35
+ # applied. Allowed values, in their default order, are - 'project_id', 'event_time', 'job_id',
36
+ # 'from_email', 'email', 'status', 'delivery_status', 'metadata', 'destination_response',
37
+ # 'user_agent', 'url', 'ip', 'tags'. For maximum security, the 'subject' field is not included by
38
+ # default, but you can add it by explicitly including in the 'dump_fields' array.
39
+ # @return [Array<String>, nil]
40
+ attr_accessor :dump_fields
41
+
42
+ # Allows you to obtain aggregated statistics for a given time period. The two allowed values are:
43
+ #
44
+ # - __day_status__ - fetch aggregated statistics (the filter value must be missing or empty, as filters are not allowed with this option);
45
+ # - __an empty string__ - used by default, event_dump/create works as if the aggregate parameter is omitted.
46
+ # @return [String, nil]
47
+ attr_accessor :aggregate
48
+
49
+ # Field delimiter, can be set to either ',' or ';', defaults to ','.
50
+ # @return [String, nil]
51
+ attr_accessor :delimiter
52
+
53
+ # File format, either “csv” (default) or “csv_gzip”.
54
+ # Default: `csv`.
55
+ # @return [String, nil]
56
+ attr_accessor :format
57
+
58
+ def initialize(
59
+ start_time:,
60
+ end_time: nil,
61
+ limit: nil,
62
+ all_projects: nil,
63
+ filter: nil,
64
+ dump_fields: nil,
65
+ aggregate: nil,
66
+ delimiter: nil,
67
+ format: nil
68
+ )
69
+ @start_time = start_time
70
+ @end_time = end_time
71
+ @limit = limit
72
+ @all_projects = all_projects
73
+ @filter = filter
74
+ @dump_fields = dump_fields
75
+ @aggregate = aggregate
76
+ @delimiter = delimiter
77
+ @format = format
78
+ end
79
+
80
+ # Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
81
+ # gives nil (data that is not a Hash gives an empty object).
82
+ def self.from_h(data)
83
+ data = {} unless data.is_a?(Hash)
84
+ new(
85
+ start_time: data['start_time'],
86
+ end_time: data['end_time'],
87
+ limit: data['limit'],
88
+ all_projects: data['all_projects'],
89
+ filter: ::UniOne::Client::Decode.model(::UniOne::Api::EventDump::Model::FilterObject, data['filter']),
90
+ dump_fields: ::UniOne::Client::Decode.list(data['dump_fields']),
91
+ aggregate: data['aggregate'],
92
+ delimiter: data['delimiter'],
93
+ format: data['format']
94
+ )
95
+ end
96
+
97
+ # JSON-ready hash, nil fields are omitted.
98
+ def to_h
99
+ {
100
+ 'start_time' => @start_time,
101
+ 'end_time' => @end_time,
102
+ 'limit' => @limit,
103
+ 'all_projects' => @all_projects,
104
+ 'filter' => @filter.nil? ? nil : @filter.to_h,
105
+ 'dump_fields' => @dump_fields,
106
+ 'aggregate' => @aggregate,
107
+ 'delimiter' => @delimiter,
108
+ 'format' => @format,
109
+ }.compact
110
+ end
111
+
112
+ def to_json(*args)
113
+ to_h.to_json(*args)
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # EventDumpCreateResponse
8
+ class EventDumpCreateResponse
9
+ # "success" string
10
+ # Allowed values: `success`.
11
+ # @return [String, nil]
12
+ attr_accessor :status
13
+
14
+ # Dump identifier, used to call the
15
+ # [event-dump/get](https://docs.unione.io/en/web-api-ref#event-dump-get) method.
16
+ # @return [String, nil]
17
+ attr_accessor :dump_id
18
+
19
+ def initialize(
20
+ status: nil,
21
+ dump_id: nil
22
+ )
23
+ @status = status
24
+ @dump_id = dump_id
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
+ status: data['status'],
33
+ dump_id: data['dump_id']
34
+ )
35
+ end
36
+
37
+ # JSON-ready hash, nil fields are omitted.
38
+ def to_h
39
+ {
40
+ 'status' => @status,
41
+ 'dump_id' => @dump_id,
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
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # EventDumpDeleteRequest
8
+ class EventDumpDeleteRequest
9
+ # Dump identifier, obtained via the
10
+ # [event-dump/create](https://docs.unione.io/en/web-api-ref#event-dump-create) method.
11
+ # @return [String, nil]
12
+ attr_accessor :dump_id
13
+
14
+ def initialize(
15
+ dump_id:
16
+ )
17
+ @dump_id = dump_id
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
+ dump_id: data['dump_id']
26
+ )
27
+ end
28
+
29
+ # JSON-ready hash, nil fields are omitted.
30
+ def to_h
31
+ {
32
+ 'dump_id' => @dump_id,
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 EventDump
6
+ module Model
7
+ # An object with the properties of the event dump file.
8
+ class EventDumpFilesObject
9
+ # Use this unique URL to download the requested dump file (either .csv or .csv.gz, depending on your
10
+ # request).
11
+ # @return [String, nil]
12
+ attr_accessor :url
13
+
14
+ # File size.
15
+ # @return [Integer, nil]
16
+ attr_accessor :size
17
+
18
+ def initialize(
19
+ url: nil,
20
+ size: nil
21
+ )
22
+ @url = url
23
+ @size = size
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
+ url: data['url'],
32
+ size: data['size']
33
+ )
34
+ end
35
+
36
+ # JSON-ready hash, nil fields are omitted.
37
+ def to_h
38
+ {
39
+ 'url' => @url,
40
+ 'size' => @size,
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,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # EventDumpGetRequest
8
+ class EventDumpGetRequest
9
+ # Dump identifier received by the method
10
+ # [event-dump/create](https://docs.unione.io/en/web-api-ref#event-dump-create).
11
+ # @return [String, nil]
12
+ attr_accessor :dump_id
13
+
14
+ def initialize(
15
+ dump_id:
16
+ )
17
+ @dump_id = dump_id
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
+ dump_id: data['dump_id']
26
+ )
27
+ end
28
+
29
+ # JSON-ready hash, nil fields are omitted.
30
+ def to_h
31
+ {
32
+ 'dump_id' => @dump_id,
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 EventDump
6
+ module Model
7
+ # EventDumpGetResponse
8
+ class EventDumpGetResponse
9
+ # "success" string
10
+ # Allowed values: `success`.
11
+ # @return [String, nil]
12
+ attr_accessor :status
13
+
14
+ # An object with the properties of the event dump.
15
+ # @return [EventDumpObject, nil]
16
+ attr_accessor :event_dump
17
+
18
+ def initialize(
19
+ status: nil,
20
+ event_dump: nil
21
+ )
22
+ @status = status
23
+ @event_dump = event_dump
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
+ event_dump: ::UniOne::Client::Decode.model(::UniOne::Api::EventDump::Model::EventDumpObject, data['event_dump'])
33
+ )
34
+ end
35
+
36
+ # JSON-ready hash, nil fields are omitted.
37
+ def to_h
38
+ {
39
+ 'status' => @status,
40
+ 'event_dump' => @event_dump.nil? ? nil : @event_dump.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,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # EventDumpListResponse
8
+ class EventDumpListResponse
9
+ # "success" string
10
+ # Allowed values: `success`.
11
+ # @return [String, nil]
12
+ attr_accessor :status
13
+
14
+ # An array of objects describing event dumps. Each object is similar to 'event_dump' object returned
15
+ # by the [event-dump/get](https://docs.unione.io/en/web-api-ref#event-dump-get) method.
16
+ # @return [Array<EventDumpObject>, nil]
17
+ attr_accessor :event_dumps
18
+
19
+ def initialize(
20
+ status: nil,
21
+ event_dumps: nil
22
+ )
23
+ @status = status
24
+ @event_dumps = event_dumps
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
+ status: data['status'],
33
+ event_dumps: ::UniOne::Client::Decode.list(data['event_dumps']) { |item0| ::UniOne::Client::Decode.model(::UniOne::Api::EventDump::Model::EventDumpObject, item0) }
34
+ )
35
+ end
36
+
37
+ # JSON-ready hash, nil fields are omitted.
38
+ def to_h
39
+ {
40
+ 'status' => @status,
41
+ 'event_dumps' => @event_dumps.nil? ? nil : @event_dumps.map { |item0| item0.to_h },
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
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # An object with the properties of the event dump.
8
+ class EventDumpObject
9
+ # Dump ID received by the method
10
+ # [event-dump/create](https://docs.unione.io/en/web-api-ref#event-dump-create).
11
+ # @return [String, nil]
12
+ attr_accessor :dump_id
13
+
14
+ # Task status, possible values are:
15
+ #
16
+ # - __queued__ - the task is in the queue, processing is not started yet;
17
+ # - __in_process__ - the request is being processed;
18
+ # - __ready__ - the task is finished, dump file is ready for download;
19
+ # - __failed__ - processing failed due to an internal error.
20
+ # @return [String, nil]
21
+ attr_accessor :dump_status
22
+
23
+ # An array of objects, each representing a file, ready for download. You may start downloading
24
+ # everything listed in “files” even if "dump_status" is still "in_process". If there are no events,
25
+ # according to the specified parameters, an empty array will be returned.
26
+ # @return [Array<EventDumpFilesObject>, nil]
27
+ attr_accessor :files
28
+
29
+ def initialize(
30
+ dump_id: nil,
31
+ dump_status: nil,
32
+ files: nil
33
+ )
34
+ @dump_id = dump_id
35
+ @dump_status = dump_status
36
+ @files = files
37
+ end
38
+
39
+ # Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
40
+ # gives nil (data that is not a Hash gives an empty object).
41
+ def self.from_h(data)
42
+ data = {} unless data.is_a?(Hash)
43
+ new(
44
+ dump_id: data['dump_id'],
45
+ dump_status: data['dump_status'],
46
+ files: ::UniOne::Client::Decode.list(data['files']) { |item0| ::UniOne::Client::Decode.model(::UniOne::Api::EventDump::Model::EventDumpFilesObject, item0) }
47
+ )
48
+ end
49
+
50
+ # JSON-ready hash, nil fields are omitted.
51
+ def to_h
52
+ {
53
+ 'dump_id' => @dump_id,
54
+ 'dump_status' => @dump_status,
55
+ 'files' => @files.nil? ? nil : @files.map { |item0| item0.to_h },
56
+ }.compact
57
+ end
58
+
59
+ def to_json(*args)
60
+ to_h.to_json(*args)
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,139 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UniOne
4
+ module Api
5
+ module EventDump
6
+ module Model
7
+ # An object with the properties of the event dump filter.
8
+ class FilterObject
9
+ # Job identifier returned earlier by [email/send](https://docs.unione.io/en/web-api-ref#email-send)
10
+ # method.
11
+ # @return [String, nil]
12
+ attr_accessor :job_id
13
+
14
+ # Email status. Possible values are:
15
+ #
16
+ # __accepted__ — the message has been accepted, but not sent yet.
17
+ # __sent__ — the message has been sent, but not delivered yet.
18
+ # __delivered__ — the message has been delivered.
19
+ # __opened__ — the message has been delivered and read.
20
+ # __clicked__ — the message has been delivered, read, and at least one of the links in email has been
21
+ # clicked.
22
+ # __unsubscribed__ — the message has been delivered to the recipient and read, but then the recipient
23
+ # unsubscribed.
24
+ # __subscribed__ — the message has been delivered to the recipient and read, but then the recipient
25
+ # unsubscribed and subscribed again.
26
+ # __soft_bounced__ — temporary delivery failure. UniOne will try to deliver the message during 48
27
+ # hours.
28
+ # __hard_bounced__ — failed to deliver the message, there will be no delivery attempts.
29
+ # __spam__ — the message has been delivered, but it was reported as spam by the recipient.
30
+ # @return [EmailStatus, nil]
31
+ attr_accessor :status
32
+
33
+ # UniOne internal detailed delivery status, you can pass several values at once, comma-separated. Some
34
+ # possible values are:
35
+ #
36
+ # __err_user_unknown__ -- email address doesn't exist;
37
+ # __err_user_inactive__ -- email address isn't used anymore;
38
+ # __err_will_retry__ -- email was temporary rejected, delivery will be retried later;
39
+ # __err_mailbox_discarded__ -- email address was active earlier, but now it's deleted;
40
+ # __err_mailbox_full__ -- mailbox is full;
41
+ # __err_spam_rejected__ -- email was rejected as a spam;
42
+ # __err_blacklisted__ -- email was rejected because sender IP or sender domain is found in a black
43
+ # list;
44
+ # __err_too_large__ -- email size is over limit, according to recipient's server;
45
+ # __err_unsubscribed__ -- email was unsubscribed;
46
+ # __err_unreachable__ -- numerous delivery failures lead to mark this email address as permanently
47
+ # unavailable;
48
+ # __err_skip_letter__ -- sending has been canceled because the email address is temporarily
49
+ # unavailable;
50
+ # __err_domain_inactive__ -- the domain does not accept mail or does not exist;
51
+ # __err_destination_misconfigured__ -- the domain does not accept mail due to incorrect settings on
52
+ # the recipient’s side, and the server’s response contains information about a cause that can be fixed
53
+ # (for example, an inoperative blacklist is used, etc.);
54
+ # __err_delivery_failed__ -- delivery failed due to other reasons;
55
+ # __err_spam_skipped__ -- sending has been canceled because the campaign has been blocked as a spam;
56
+ # __err_lost__ -- the message was not sent due to inconsistency of its parts or it has been lost
57
+ # because of the failure on our side. The sender needs to re-send the letter on his own, since the
58
+ # original has not been saved;
59
+ #
60
+ # We reserve the right to change or add internal delivery statuses as we need, so the following list
61
+ # is provided as an example only, without any description: ok_sent, ok_delivered, ok_read,
62
+ # ok_link_visited, ok_unsubscribed, ok_resubscribed, ok_spam_folder, ok_fbl, not_sent,
63
+ # skip_dup_unreachable, skip_dup_temp_unreachable, skip_dup_mailbox_full, err_spam_removed,
64
+ # err_resend, err_unknown, err_retry_letter, err_src_invalid, err_dest_invalid, err_not_available,
65
+ # err_internal, err_no_dns, err_no_smtp, err_giveup.
66
+ # @return [String, nil]
67
+ attr_accessor :delivery_status
68
+
69
+ # Recipient email address
70
+ # @return [String, nil]
71
+ attr_accessor :email
72
+
73
+ # Sender email address
74
+ # @return [String, nil]
75
+ attr_accessor :email_from
76
+
77
+ # Recipient domain
78
+ # @return [String, nil]
79
+ attr_accessor :domain
80
+
81
+ # Campaign identifier, unsigned decimal integer or UUID up to 128-bit, passed in metadata with name
82
+ # "campaign_id" (name is configurable thru support).
83
+ # @return [String, nil]
84
+ attr_accessor :campaign_id
85
+
86
+ def initialize(
87
+ job_id: nil,
88
+ status: nil,
89
+ delivery_status: nil,
90
+ email: nil,
91
+ email_from: nil,
92
+ domain: nil,
93
+ campaign_id: nil
94
+ )
95
+ @job_id = job_id
96
+ @status = status
97
+ @delivery_status = delivery_status
98
+ @email = email
99
+ @email_from = email_from
100
+ @domain = domain
101
+ @campaign_id = campaign_id
102
+ end
103
+
104
+ # Builds the object from decoded JSON. Lenient: a missing field, nil or a value of another type
105
+ # gives nil (data that is not a Hash gives an empty object).
106
+ def self.from_h(data)
107
+ data = {} unless data.is_a?(Hash)
108
+ new(
109
+ job_id: data['job_id'],
110
+ status: data['status'],
111
+ delivery_status: data['delivery_status'],
112
+ email: data['email'],
113
+ email_from: data['email_from'],
114
+ domain: data['domain'],
115
+ campaign_id: data['campaign_id']
116
+ )
117
+ end
118
+
119
+ # JSON-ready hash, nil fields are omitted.
120
+ def to_h
121
+ {
122
+ 'job_id' => @job_id,
123
+ 'status' => @status,
124
+ 'delivery_status' => @delivery_status,
125
+ 'email' => @email,
126
+ 'email_from' => @email_from,
127
+ 'domain' => @domain,
128
+ 'campaign_id' => @campaign_id,
129
+ }.compact
130
+ end
131
+
132
+ def to_json(*args)
133
+ to_h.to_json(*args)
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end