pepipost_gem 2.5.0 → 5.0.0

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +6 -13
  3. data/README.md +123 -77
  4. data/lib/pepipost.rb +74 -0
  5. data/lib/{pepipost_gem → pepipost}/api_helper.rb +5 -3
  6. data/lib/pepipost/configuration.rb +24 -0
  7. data/lib/{pepipost_gem → pepipost}/controllers/base_controller.rb +10 -5
  8. data/lib/pepipost/controllers/domain_controller.rb +68 -0
  9. data/lib/pepipost/controllers/domain_delete_controller.rb +67 -0
  10. data/lib/pepipost/controllers/events_controller.rb +104 -0
  11. data/lib/pepipost/controllers/mail_send_controller.rb +54 -0
  12. data/lib/pepipost/controllers/setrecurringcreditddetails_controller.rb +68 -0
  13. data/lib/pepipost/controllers/stats_controller.rb +82 -0
  14. data/lib/pepipost/controllers/subaccounts_controller.rb +68 -0
  15. data/lib/pepipost/controllers/subaccounts_create_subaccount_controller.rb +68 -0
  16. data/lib/pepipost/controllers/subaccounts_delete_controller.rb +67 -0
  17. data/lib/pepipost/controllers/subaccounts_get_sub_accounts_controller.rb +71 -0
  18. data/lib/pepipost/controllers/subaccounts_setsubaccountcredit_controller.rb +68 -0
  19. data/lib/pepipost/controllers/subaccounts_update_subaccount_controller.rb +67 -0
  20. data/lib/pepipost/controllers/suppression_controller.rb +121 -0
  21. data/lib/{pepipost_gem → pepipost}/exceptions/api_exception.rb +5 -3
  22. data/lib/pepipost/http/auth/custom_header_auth.rb +16 -0
  23. data/lib/{pepipost_gem → pepipost}/http/faraday_client.rb +17 -8
  24. data/lib/{pepipost_gem → pepipost}/http/http_call_back.rb +5 -3
  25. data/lib/{pepipost_gem → pepipost}/http/http_client.rb +5 -3
  26. data/lib/{pepipost_gem → pepipost}/http/http_context.rb +5 -3
  27. data/lib/{pepipost_gem → pepipost}/http/http_method_enum.rb +5 -3
  28. data/lib/{pepipost_gem → pepipost}/http/http_request.rb +5 -3
  29. data/lib/{pepipost_gem → pepipost}/http/http_response.rb +5 -3
  30. data/lib/pepipost/models/action_enum.rb +18 -0
  31. data/lib/pepipost/models/add_email_or_domain_to_suppression_list.rb +48 -0
  32. data/lib/pepipost/models/aggregated_by_enum.rb +20 -0
  33. data/lib/pepipost/models/attachments.rb +44 -0
  34. data/lib/{pepipost_gem → pepipost}/models/base_model.rb +5 -3
  35. data/lib/pepipost/models/content.rb +44 -0
  36. data/lib/pepipost/models/create_subaccount.rb +76 -0
  37. data/lib/pepipost/models/delete_domain.rb +35 -0
  38. data/lib/pepipost/models/delete_subacoount.rb +35 -0
  39. data/lib/pepipost/models/domain_struct.rb +45 -0
  40. data/lib/pepipost/models/email_struct.rb +44 -0
  41. data/lib/pepipost/models/enable_or_disable_subacoount.rb +44 -0
  42. data/lib/pepipost/models/events_enum.rb +44 -0
  43. data/lib/pepipost/models/from.rb +44 -0
  44. data/lib/pepipost/models/personalizations.rb +135 -0
  45. data/lib/pepipost/models/remove_email_or_domain_to_suppression_list.rb +48 -0
  46. data/lib/pepipost/models/send.rb +164 -0
  47. data/lib/pepipost/models/settings.rb +71 -0
  48. data/lib/pepipost/models/sort_enum.rb +17 -0
  49. data/lib/pepipost/models/timeperiod_enum.rb +20 -0
  50. data/lib/pepipost/models/type_enum.rb +17 -0
  51. data/lib/pepipost/models/update_credis_of_subaccount.rb +54 -0
  52. data/lib/pepipost/models/update_recurring_credis_of_subaccount.rb +80 -0
  53. data/lib/pepipost/models/update_subaccount.rb +72 -0
  54. data/lib/pepipost/pepipost_client.rb +99 -0
  55. metadata +98 -54
  56. data/lib/pepipost_gem.rb +0 -40
  57. data/lib/pepipost_gem/configuration.rb +0 -17
  58. data/lib/pepipost_gem/controllers/email_controller.rb +0 -59
  59. data/lib/pepipost_gem/models/attachments.rb +0 -42
  60. data/lib/pepipost_gem/models/attribute.rb +0 -42
  61. data/lib/pepipost_gem/models/email_body.rb +0 -119
  62. data/lib/pepipost_gem/models/email_body_attachments.rb +0 -42
  63. data/lib/pepipost_gem/models/from.rb +0 -42
  64. data/lib/pepipost_gem/models/personalizations.rb +0 -85
  65. data/lib/pepipost_gem/models/send_email_error.rb +0 -42
  66. data/lib/pepipost_gem/models/send_email_response.rb +0 -52
  67. data/lib/pepipost_gem/models/settings.rb +0 -69
  68. data/lib/pepipost_gem/pepipost_gem_client.rb +0 -19
@@ -0,0 +1,35 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # Deletesubaccount modal
8
+ class DeleteSubacoount < BaseModel
9
+ # The username of the subaccount
10
+ # @return [String]
11
+ attr_accessor :username
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['username'] = 'username'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(username = nil)
21
+ @username = username
22
+ end
23
+
24
+ # Creates an instance of the object from a hash.
25
+ def self.from_hash(hash)
26
+ return nil unless hash
27
+
28
+ # Extract variables from the hash.
29
+ username = hash['username']
30
+
31
+ # Create object from extracted values.
32
+ DeleteSubacoount.new(username)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,45 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # Domain Modal
8
+ class DomainStruct < BaseModel
9
+ # The domain you wish to include in the 'From' header of your emails.
10
+ # @return [String]
11
+ attr_accessor :domain
12
+
13
+ # The subdomain which will be used for tracking opens, clicks and
14
+ # unsubscribe
15
+ # @return [String]
16
+ attr_accessor :envelope_name
17
+
18
+ # A mapping from model property names to API property names.
19
+ def self.names
20
+ @_hash = {} if @_hash.nil?
21
+ @_hash['domain'] = 'domain'
22
+ @_hash['envelope_name'] = 'envelopeName'
23
+ @_hash
24
+ end
25
+
26
+ def initialize(domain = nil,
27
+ envelope_name = nil)
28
+ @domain = domain
29
+ @envelope_name = envelope_name
30
+ end
31
+
32
+ # Creates an instance of the object from a hash.
33
+ def self.from_hash(hash)
34
+ return nil unless hash
35
+
36
+ # Extract variables from the hash.
37
+ domain = hash['domain']
38
+ envelope_name = hash['envelopeName']
39
+
40
+ # Create object from extracted values.
41
+ DomainStruct.new(domain,
42
+ envelope_name)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # To, CC and Bcc email Address structure
8
+ class EmailStruct < BaseModel
9
+ # Name of recipient
10
+ # @return [String]
11
+ attr_accessor :name
12
+
13
+ # Email of recipient
14
+ # @return [String]
15
+ attr_accessor :email
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['name'] = 'name'
21
+ @_hash['email'] = 'email'
22
+ @_hash
23
+ end
24
+
25
+ def initialize(name = nil,
26
+ email = nil)
27
+ @name = name
28
+ @email = email
29
+ end
30
+
31
+ # Creates an instance of the object from a hash.
32
+ def self.from_hash(hash)
33
+ return nil unless hash
34
+
35
+ # Extract variables from the hash.
36
+ name = hash['name']
37
+ email = hash['email']
38
+
39
+ # Create object from extracted values.
40
+ EmailStruct.new(name,
41
+ email)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # EnableDisablesubaccount modal
8
+ class EnableOrDisableSubacoount < BaseModel
9
+ # The username of the subaccount
10
+ # @return [String]
11
+ attr_accessor :username
12
+
13
+ # Flag to indicate whether the subaccount should be enabled or disabled.
14
+ # @return [Boolean]
15
+ attr_accessor :disabled
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['username'] = 'username'
21
+ @_hash['disabled'] = 'disabled'
22
+ @_hash
23
+ end
24
+
25
+ def initialize(username = nil,
26
+ disabled = nil)
27
+ @username = username
28
+ @disabled = disabled
29
+ end
30
+
31
+ # Creates an instance of the object from a hash.
32
+ def self.from_hash(hash)
33
+ return nil unless hash
34
+
35
+ # Extract variables from the hash.
36
+ username = hash['username']
37
+ disabled = hash['disabled']
38
+
39
+ # Create object from extracted values.
40
+ EnableOrDisableSubacoount.new(username,
41
+ disabled)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # events.
8
+ class EventsEnum
9
+ EVENTS_ENUM = [
10
+ # TODO: Write general description for PROCESSED
11
+ PROCESSED = 'processed'.freeze,
12
+
13
+ # TODO: Write general description for SENT
14
+ SENT = 'sent'.freeze,
15
+
16
+ # TODO: Write general description for OPEN
17
+ OPEN = 'open'.freeze,
18
+
19
+ # TODO: Write general description for CLICK
20
+ CLICK = 'click'.freeze,
21
+
22
+ # TODO: Write general description for UNSUBSCRIBE
23
+ UNSUBSCRIBE = 'unsubscribe'.freeze,
24
+
25
+ # TODO: Write general description for BOUNCE
26
+ BOUNCE = 'bounce'.freeze,
27
+
28
+ # TODO: Write general description for SOFTBOUNCE
29
+ SOFTBOUNCE = 'softbounce'.freeze,
30
+
31
+ # TODO: Write general description for SPAM
32
+ SPAM = 'spam'.freeze,
33
+
34
+ # TODO: Write general description for INVALID
35
+ INVALID = 'invalid'.freeze,
36
+
37
+ # TODO: Write general description for DROPPED
38
+ DROPPED = 'dropped'.freeze,
39
+
40
+ # TODO: Write general description for HARDBOUNCE
41
+ HARDBOUNCE = 'hardbounce'.freeze
42
+ ].freeze
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # Email address representing the sender of the mail
8
+ class From < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :email
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['email'] = 'email'
21
+ @_hash['name'] = 'name'
22
+ @_hash
23
+ end
24
+
25
+ def initialize(email = nil,
26
+ name = nil)
27
+ @email = email
28
+ @name = name
29
+ end
30
+
31
+ # Creates an instance of the object from a hash.
32
+ def self.from_hash(hash)
33
+ return nil unless hash
34
+
35
+ # Extract variables from the hash.
36
+ email = hash['email']
37
+ name = hash['name']
38
+
39
+ # Create object from extracted values.
40
+ From.new(email,
41
+ name)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,135 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # Personalizations
8
+ class Personalizations < BaseModel
9
+ # Dynamic attributes
10
+ # @return [Object]
11
+ attr_accessor :attributes
12
+
13
+ # Dynamic headers attributes
14
+ # @return [Object]
15
+ attr_accessor :headers
16
+
17
+ # Attachments to individuals recipient
18
+ # @return [List of Attachments]
19
+ attr_accessor :attachments
20
+
21
+ # To email-address
22
+ # @return [List of EmailStruct]
23
+ attr_accessor :to
24
+
25
+ # CC email-address
26
+ # @return [List of EmailStruct]
27
+ attr_accessor :cc
28
+
29
+ # Bcc email-addresses
30
+ # @return [List of EmailStruct]
31
+ attr_accessor :bcc
32
+
33
+ # token to which is json string
34
+ # @return [String]
35
+ attr_accessor :token_to
36
+
37
+ # token cc which is json string
38
+ # @return [String]
39
+ attr_accessor :token_cc
40
+
41
+ # token bcc which is json string
42
+ # @return [String]
43
+ attr_accessor :token_bcc
44
+
45
+ # A mapping from model property names to API property names.
46
+ def self.names
47
+ @_hash = {} if @_hash.nil?
48
+ @_hash['attributes'] = 'attributes'
49
+ @_hash['headers'] = 'headers'
50
+ @_hash['attachments'] = 'attachments'
51
+ @_hash['to'] = 'to'
52
+ @_hash['cc'] = 'cc'
53
+ @_hash['bcc'] = 'bcc'
54
+ @_hash['token_to'] = 'token_to'
55
+ @_hash['token_cc'] = 'token_cc'
56
+ @_hash['token_bcc'] = 'token_bcc'
57
+ @_hash
58
+ end
59
+
60
+ def initialize(to = nil,
61
+ attributes = nil,
62
+ headers = nil,
63
+ attachments = nil,
64
+ cc = nil,
65
+ bcc = nil,
66
+ token_to = nil,
67
+ token_cc = nil,
68
+ token_bcc = nil)
69
+ @attributes = attributes
70
+ @headers = headers
71
+ @attachments = attachments
72
+ @to = to
73
+ @cc = cc
74
+ @bcc = bcc
75
+ @token_to = token_to
76
+ @token_cc = token_cc
77
+ @token_bcc = token_bcc
78
+ end
79
+
80
+ # Creates an instance of the object from a hash.
81
+ def self.from_hash(hash)
82
+ return nil unless hash
83
+
84
+ # Extract variables from the hash.
85
+ # Parameter is an array, so we need to iterate through it
86
+ to = nil
87
+ unless hash['to'].nil?
88
+ to = []
89
+ hash['to'].each do |structure|
90
+ to << (EmailStruct.from_hash(structure) if structure)
91
+ end
92
+ end
93
+ attributes = hash['attributes']
94
+ headers = hash['headers']
95
+ # Parameter is an array, so we need to iterate through it
96
+ attachments = nil
97
+ unless hash['attachments'].nil?
98
+ attachments = []
99
+ hash['attachments'].each do |structure|
100
+ attachments << (Attachments.from_hash(structure) if structure)
101
+ end
102
+ end
103
+ # Parameter is an array, so we need to iterate through it
104
+ cc = nil
105
+ unless hash['cc'].nil?
106
+ cc = []
107
+ hash['cc'].each do |structure|
108
+ cc << (EmailStruct.from_hash(structure) if structure)
109
+ end
110
+ end
111
+ # Parameter is an array, so we need to iterate through it
112
+ bcc = nil
113
+ unless hash['bcc'].nil?
114
+ bcc = []
115
+ hash['bcc'].each do |structure|
116
+ bcc << (EmailStruct.from_hash(structure) if structure)
117
+ end
118
+ end
119
+ token_to = hash['token_to']
120
+ token_cc = hash['token_cc']
121
+ token_bcc = hash['token_bcc']
122
+
123
+ # Create object from extracted values.
124
+ Personalizations.new(to,
125
+ attributes,
126
+ headers,
127
+ attachments,
128
+ cc,
129
+ bcc,
130
+ token_to,
131
+ token_cc,
132
+ token_bcc)
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,48 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ module Pepipost
7
+ # Remove Suppression modal
8
+ class RemoveEmailOrDomainToSuppressionList < BaseModel
9
+ # List one or more recipient domains to be removed from the suppression list
10
+ # here. <br>\nComma separate the values to suppress multiple recipient
11
+ # domains.
12
+ # @return [String]
13
+ attr_accessor :domain
14
+
15
+ # List one or more email addresses to be removed from the suppression list
16
+ # here. <br>\nComma separate the values to suppress multiple email
17
+ # addresses.
18
+ # @return [String]
19
+ attr_accessor :email
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['domain'] = 'domain'
25
+ @_hash['email'] = 'email'
26
+ @_hash
27
+ end
28
+
29
+ def initialize(domain = nil,
30
+ email = nil)
31
+ @domain = domain
32
+ @email = email
33
+ end
34
+
35
+ # Creates an instance of the object from a hash.
36
+ def self.from_hash(hash)
37
+ return nil unless hash
38
+
39
+ # Extract variables from the hash.
40
+ domain = hash['domain']
41
+ email = hash['email']
42
+
43
+ # Create object from extracted values.
44
+ RemoveEmailOrDomainToSuppressionList.new(domain,
45
+ email)
46
+ end
47
+ end
48
+ end