pepipost_gem 2.5.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +6 -13
- data/README.md +123 -77
- data/lib/pepipost.rb +74 -0
- data/lib/{pepipost_gem → pepipost}/api_helper.rb +5 -3
- data/lib/pepipost/configuration.rb +24 -0
- data/lib/{pepipost_gem → pepipost}/controllers/base_controller.rb +10 -5
- data/lib/pepipost/controllers/domain_controller.rb +68 -0
- data/lib/pepipost/controllers/domain_delete_controller.rb +67 -0
- data/lib/pepipost/controllers/events_controller.rb +104 -0
- data/lib/pepipost/controllers/mail_send_controller.rb +54 -0
- data/lib/pepipost/controllers/setrecurringcreditddetails_controller.rb +68 -0
- data/lib/pepipost/controllers/stats_controller.rb +82 -0
- data/lib/pepipost/controllers/subaccounts_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_create_subaccount_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_delete_controller.rb +67 -0
- data/lib/pepipost/controllers/subaccounts_get_sub_accounts_controller.rb +71 -0
- data/lib/pepipost/controllers/subaccounts_setsubaccountcredit_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_update_subaccount_controller.rb +67 -0
- data/lib/pepipost/controllers/suppression_controller.rb +121 -0
- data/lib/{pepipost_gem → pepipost}/exceptions/api_exception.rb +5 -3
- data/lib/pepipost/http/auth/custom_header_auth.rb +16 -0
- data/lib/{pepipost_gem → pepipost}/http/faraday_client.rb +17 -8
- data/lib/{pepipost_gem → pepipost}/http/http_call_back.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_client.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_context.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_method_enum.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_request.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_response.rb +5 -3
- data/lib/pepipost/models/action_enum.rb +18 -0
- data/lib/pepipost/models/add_email_or_domain_to_suppression_list.rb +48 -0
- data/lib/pepipost/models/aggregated_by_enum.rb +20 -0
- data/lib/pepipost/models/attachments.rb +44 -0
- data/lib/{pepipost_gem → pepipost}/models/base_model.rb +5 -3
- data/lib/pepipost/models/content.rb +44 -0
- data/lib/pepipost/models/create_subaccount.rb +76 -0
- data/lib/pepipost/models/delete_domain.rb +35 -0
- data/lib/pepipost/models/delete_subacoount.rb +35 -0
- data/lib/pepipost/models/domain_struct.rb +45 -0
- data/lib/pepipost/models/email_struct.rb +44 -0
- data/lib/pepipost/models/enable_or_disable_subacoount.rb +44 -0
- data/lib/pepipost/models/events_enum.rb +44 -0
- data/lib/pepipost/models/from.rb +44 -0
- data/lib/pepipost/models/personalizations.rb +135 -0
- data/lib/pepipost/models/remove_email_or_domain_to_suppression_list.rb +48 -0
- data/lib/pepipost/models/send.rb +164 -0
- data/lib/pepipost/models/settings.rb +71 -0
- data/lib/pepipost/models/sort_enum.rb +17 -0
- data/lib/pepipost/models/timeperiod_enum.rb +20 -0
- data/lib/pepipost/models/type_enum.rb +17 -0
- data/lib/pepipost/models/update_credis_of_subaccount.rb +54 -0
- data/lib/pepipost/models/update_recurring_credis_of_subaccount.rb +80 -0
- data/lib/pepipost/models/update_subaccount.rb +72 -0
- data/lib/pepipost/pepipost_client.rb +99 -0
- metadata +98 -54
- data/lib/pepipost_gem.rb +0 -40
- data/lib/pepipost_gem/configuration.rb +0 -17
- data/lib/pepipost_gem/controllers/email_controller.rb +0 -59
- data/lib/pepipost_gem/models/attachments.rb +0 -42
- data/lib/pepipost_gem/models/attribute.rb +0 -42
- data/lib/pepipost_gem/models/email_body.rb +0 -119
- data/lib/pepipost_gem/models/email_body_attachments.rb +0 -42
- data/lib/pepipost_gem/models/from.rb +0 -42
- data/lib/pepipost_gem/models/personalizations.rb +0 -85
- data/lib/pepipost_gem/models/send_email_error.rb +0 -42
- data/lib/pepipost_gem/models/send_email_response.rb +0 -52
- data/lib/pepipost_gem/models/settings.rb +0 -69
- data/lib/pepipost_gem/pepipost_gem_client.rb +0 -19
@@ -1,42 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# Attachments Model.
|
6
|
-
class Attachments < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :file_content
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :file_name
|
14
|
-
|
15
|
-
# A mapping from model property names to API property names.
|
16
|
-
def self.names
|
17
|
-
@_hash = {} if @_hash.nil?
|
18
|
-
@_hash['file_content'] = 'fileContent'
|
19
|
-
@_hash['file_name'] = 'fileName'
|
20
|
-
@_hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(file_content = nil,
|
24
|
-
file_name = nil)
|
25
|
-
@file_content = file_content
|
26
|
-
@file_name = file_name
|
27
|
-
end
|
28
|
-
|
29
|
-
# Creates an instance of the object from a hash.
|
30
|
-
def self.from_hash(hash)
|
31
|
-
return nil unless hash
|
32
|
-
|
33
|
-
# Extract variables from the hash.
|
34
|
-
file_content = hash['fileContent']
|
35
|
-
file_name = hash['fileName']
|
36
|
-
|
37
|
-
# Create object from extracted values.
|
38
|
-
Attachments.new(file_content,
|
39
|
-
file_name)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# Attribute Model.
|
6
|
-
class Attribute < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :myname
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :age
|
14
|
-
|
15
|
-
# A mapping from model property names to API property names.
|
16
|
-
def self.names
|
17
|
-
@_hash = {} if @_hash.nil?
|
18
|
-
@_hash['myname'] = 'myname'
|
19
|
-
@_hash['age'] = 'age'
|
20
|
-
@_hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(myname = nil,
|
24
|
-
age = nil)
|
25
|
-
@myname = myname
|
26
|
-
@age = age
|
27
|
-
end
|
28
|
-
|
29
|
-
# Creates an instance of the object from a hash.
|
30
|
-
def self.from_hash(hash)
|
31
|
-
return nil unless hash
|
32
|
-
|
33
|
-
# Extract variables from the hash.
|
34
|
-
myname = hash['myname']
|
35
|
-
age = hash['age']
|
36
|
-
|
37
|
-
# Create object from extracted values.
|
38
|
-
Attribute.new(myname,
|
39
|
-
age)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,119 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# Mail Body which will be passed as json in apicall.
|
6
|
-
class EmailBody < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [List of Personalizations]
|
9
|
-
attr_accessor :personalizations
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :tags
|
14
|
-
|
15
|
-
# TODO: Write general description for this method
|
16
|
-
# @return [From]
|
17
|
-
attr_accessor :from
|
18
|
-
|
19
|
-
# TODO: Write general description for this method
|
20
|
-
# @return [String]
|
21
|
-
attr_accessor :subject
|
22
|
-
|
23
|
-
# TODO: Write general description for this method
|
24
|
-
# @return [String]
|
25
|
-
attr_accessor :content
|
26
|
-
|
27
|
-
# TODO: Write general description for this method
|
28
|
-
# @return [List of EmailBodyAttachments]
|
29
|
-
attr_accessor :attachments
|
30
|
-
|
31
|
-
# TODO: Write general description for this method
|
32
|
-
# @return [Settings]
|
33
|
-
attr_accessor :settings
|
34
|
-
|
35
|
-
# TODO: Write general description for this method
|
36
|
-
# @return [String]
|
37
|
-
attr_accessor :reply_to_id
|
38
|
-
|
39
|
-
# TODO: Write general description for this method
|
40
|
-
# @return [Integer]
|
41
|
-
attr_accessor :template_id
|
42
|
-
|
43
|
-
# A mapping from model property names to API property names.
|
44
|
-
def self.names
|
45
|
-
@_hash = {} if @_hash.nil?
|
46
|
-
@_hash['personalizations'] = 'personalizations'
|
47
|
-
@_hash['tags'] = 'tags'
|
48
|
-
@_hash['from'] = 'from'
|
49
|
-
@_hash['subject'] = 'subject'
|
50
|
-
@_hash['content'] = 'content'
|
51
|
-
@_hash['attachments'] = 'attachments'
|
52
|
-
@_hash['settings'] = 'settings'
|
53
|
-
@_hash['reply_to_id'] = 'replyToId'
|
54
|
-
@_hash['template_id'] = 'templateId'
|
55
|
-
@_hash
|
56
|
-
end
|
57
|
-
|
58
|
-
def initialize(personalizations = nil,
|
59
|
-
tags = nil,
|
60
|
-
from = nil,
|
61
|
-
subject = nil,
|
62
|
-
content = nil,
|
63
|
-
attachments = nil,
|
64
|
-
settings = nil,
|
65
|
-
reply_to_id = nil,
|
66
|
-
template_id = nil)
|
67
|
-
@personalizations = personalizations
|
68
|
-
@tags = tags
|
69
|
-
@from = from
|
70
|
-
@subject = subject
|
71
|
-
@content = content
|
72
|
-
@attachments = attachments
|
73
|
-
@settings = settings
|
74
|
-
@reply_to_id = reply_to_id
|
75
|
-
@template_id = template_id
|
76
|
-
end
|
77
|
-
|
78
|
-
# Creates an instance of the object from a hash.
|
79
|
-
def self.from_hash(hash)
|
80
|
-
return nil unless hash
|
81
|
-
|
82
|
-
# Extract variables from the hash.
|
83
|
-
# Parameter is an array, so we need to iterate through it
|
84
|
-
personalizations = nil
|
85
|
-
unless hash['personalizations'].nil?
|
86
|
-
personalizations = []
|
87
|
-
hash['personalizations'].each do |structure|
|
88
|
-
personalizations << (Personalizations.from_hash(structure) if structure)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
tags = hash['tags']
|
92
|
-
from = From.from_hash(hash['from']) if hash['from']
|
93
|
-
subject = hash['subject']
|
94
|
-
content = hash['content']
|
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 << (EmailBodyAttachments.from_hash(structure) if structure)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
settings = Settings.from_hash(hash['settings']) if hash['settings']
|
104
|
-
reply_to_id = hash['replyToId']
|
105
|
-
template_id = hash['templateId']
|
106
|
-
|
107
|
-
# Create object from extracted values.
|
108
|
-
EmailBody.new(personalizations,
|
109
|
-
tags,
|
110
|
-
from,
|
111
|
-
subject,
|
112
|
-
content,
|
113
|
-
attachments,
|
114
|
-
settings,
|
115
|
-
reply_to_id,
|
116
|
-
template_id)
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# EmailBodyAttachments Model.
|
6
|
-
class EmailBodyAttachments < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :file_content
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :file_name
|
14
|
-
|
15
|
-
# A mapping from model property names to API property names.
|
16
|
-
def self.names
|
17
|
-
@_hash = {} if @_hash.nil?
|
18
|
-
@_hash['file_content'] = 'fileContent'
|
19
|
-
@_hash['file_name'] = 'fileName'
|
20
|
-
@_hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(file_content = nil,
|
24
|
-
file_name = nil)
|
25
|
-
@file_content = file_content
|
26
|
-
@file_name = file_name
|
27
|
-
end
|
28
|
-
|
29
|
-
# Creates an instance of the object from a hash.
|
30
|
-
def self.from_hash(hash)
|
31
|
-
return nil unless hash
|
32
|
-
|
33
|
-
# Extract variables from the hash.
|
34
|
-
file_content = hash['fileContent']
|
35
|
-
file_name = hash['fileName']
|
36
|
-
|
37
|
-
# Create object from extracted values.
|
38
|
-
EmailBodyAttachments.new(file_content,
|
39
|
-
file_name)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# From Model.
|
6
|
-
class From < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :from_email
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :from_name
|
14
|
-
|
15
|
-
# A mapping from model property names to API property names.
|
16
|
-
def self.names
|
17
|
-
@_hash = {} if @_hash.nil?
|
18
|
-
@_hash['from_email'] = 'fromEmail'
|
19
|
-
@_hash['from_name'] = 'fromName'
|
20
|
-
@_hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(from_email = nil,
|
24
|
-
from_name = nil)
|
25
|
-
@from_email = from_email
|
26
|
-
@from_name = from_name
|
27
|
-
end
|
28
|
-
|
29
|
-
# Creates an instance of the object from a hash.
|
30
|
-
def self.from_hash(hash)
|
31
|
-
return nil unless hash
|
32
|
-
|
33
|
-
# Extract variables from the hash.
|
34
|
-
from_email = hash['fromEmail']
|
35
|
-
from_name = hash['fromName']
|
36
|
-
|
37
|
-
# Create object from extracted values.
|
38
|
-
From.new(from_email,
|
39
|
-
from_name)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# This consits of personlized attachments with recipient,recipient_cc,etc.
|
6
|
-
class Personalizations < BaseModel
|
7
|
-
# Emails to be passed in Apicall
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :recipient
|
10
|
-
|
11
|
-
# Emails to be passed in Apicall
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :x_apiheader_cc
|
14
|
-
|
15
|
-
# Emails to be passed in Apicall
|
16
|
-
# @return [String]
|
17
|
-
attr_accessor :x_apiheader
|
18
|
-
|
19
|
-
# Emails to be passed in Apicall
|
20
|
-
# @return [Object]
|
21
|
-
attr_accessor :attributes
|
22
|
-
|
23
|
-
# Emails to be passed in Apicall
|
24
|
-
# @return [List of Attachments]
|
25
|
-
attr_accessor :attachments
|
26
|
-
|
27
|
-
# Emails to be passed in Apicall
|
28
|
-
# @return [List of String]
|
29
|
-
attr_accessor :recipient_cc
|
30
|
-
|
31
|
-
# A mapping from model property names to API property names.
|
32
|
-
def self.names
|
33
|
-
@_hash = {} if @_hash.nil?
|
34
|
-
@_hash['recipient'] = 'recipient'
|
35
|
-
@_hash['x_apiheader_cc'] = 'x-apiheader_cc'
|
36
|
-
@_hash['x_apiheader'] = 'x-apiheader'
|
37
|
-
@_hash['attributes'] = 'attributes'
|
38
|
-
@_hash['attachments'] = 'attachments'
|
39
|
-
@_hash['recipient_cc'] = 'recipient_cc'
|
40
|
-
@_hash
|
41
|
-
end
|
42
|
-
|
43
|
-
def initialize(recipient = nil,
|
44
|
-
x_apiheader_cc = nil,
|
45
|
-
x_apiheader = nil,
|
46
|
-
attributes = nil,
|
47
|
-
attachments = nil,
|
48
|
-
recipient_cc = nil)
|
49
|
-
@recipient = recipient
|
50
|
-
@x_apiheader_cc = x_apiheader_cc
|
51
|
-
@x_apiheader = x_apiheader
|
52
|
-
@attributes = attributes
|
53
|
-
@attachments = attachments
|
54
|
-
@recipient_cc = recipient_cc
|
55
|
-
end
|
56
|
-
|
57
|
-
# Creates an instance of the object from a hash.
|
58
|
-
def self.from_hash(hash)
|
59
|
-
return nil unless hash
|
60
|
-
|
61
|
-
# Extract variables from the hash.
|
62
|
-
recipient = hash['recipient']
|
63
|
-
x_apiheader_cc = hash['x-apiheader_cc']
|
64
|
-
x_apiheader = hash['x-apiheader']
|
65
|
-
attributes = hash['attributes']
|
66
|
-
# Parameter is an array, so we need to iterate through it
|
67
|
-
attachments = nil
|
68
|
-
unless hash['attachments'].nil?
|
69
|
-
attachments = []
|
70
|
-
hash['attachments'].each do |structure|
|
71
|
-
attachments << (Attachments.from_hash(structure) if structure)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
recipient_cc = hash['recipient_cc']
|
75
|
-
|
76
|
-
# Create object from extracted values.
|
77
|
-
Personalizations.new(recipient,
|
78
|
-
x_apiheader_cc,
|
79
|
-
x_apiheader,
|
80
|
-
attributes,
|
81
|
-
attachments,
|
82
|
-
recipient_cc)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# SendEmailError Model.
|
6
|
-
class SendEmailError < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [String]
|
9
|
-
attr_accessor :error_message
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [Integer]
|
13
|
-
attr_accessor :error_code
|
14
|
-
|
15
|
-
# A mapping from model property names to API property names.
|
16
|
-
def self.names
|
17
|
-
@_hash = {} if @_hash.nil?
|
18
|
-
@_hash['error_message'] = 'error_message'
|
19
|
-
@_hash['error_code'] = 'error_code'
|
20
|
-
@_hash
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(error_message = nil,
|
24
|
-
error_code = nil)
|
25
|
-
@error_message = error_message
|
26
|
-
@error_code = error_code
|
27
|
-
end
|
28
|
-
|
29
|
-
# Creates an instance of the object from a hash.
|
30
|
-
def self.from_hash(hash)
|
31
|
-
return nil unless hash
|
32
|
-
|
33
|
-
# Extract variables from the hash.
|
34
|
-
error_message = hash['error_message']
|
35
|
-
error_code = hash['error_code']
|
36
|
-
|
37
|
-
# Create object from extracted values.
|
38
|
-
SendEmailError.new(error_message,
|
39
|
-
error_code)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# This file was automatically generated by APIMATIC v2.0
|
2
|
-
# ( https://apimatic.io ).
|
3
|
-
|
4
|
-
module PepipostGem
|
5
|
-
# Response of the email
|
6
|
-
class SendEmailResponse < BaseModel
|
7
|
-
# TODO: Write general description for this method
|
8
|
-
# @return [Object]
|
9
|
-
attr_accessor :data
|
10
|
-
|
11
|
-
# TODO: Write general description for this method
|
12
|
-
# @return [String]
|
13
|
-
attr_reader :message
|
14
|
-
|
15
|
-
# TODO: Write general description for this method
|
16
|
-
# @return [SendEmailError]
|
17
|
-
attr_accessor :error_info
|
18
|
-
|
19
|
-
# A mapping from model property names to API property names.
|
20
|
-
def self.names
|
21
|
-
@_hash = {} if @_hash.nil?
|
22
|
-
@_hash['data'] = 'data'
|
23
|
-
@_hash['message'] = 'message'
|
24
|
-
@_hash['error_info'] = 'error_info'
|
25
|
-
@_hash
|
26
|
-
end
|
27
|
-
|
28
|
-
def initialize(data = nil,
|
29
|
-
message = nil,
|
30
|
-
error_info = nil)
|
31
|
-
@data = data
|
32
|
-
@message = message
|
33
|
-
@error_info = error_info
|
34
|
-
end
|
35
|
-
|
36
|
-
# Creates an instance of the object from a hash.
|
37
|
-
def self.from_hash(hash)
|
38
|
-
return nil unless hash
|
39
|
-
|
40
|
-
# Extract variables from the hash.
|
41
|
-
data = hash['data']
|
42
|
-
message = hash['message']
|
43
|
-
error_info = SendEmailError.from_hash(hash['error_info']) if
|
44
|
-
hash['error_info']
|
45
|
-
|
46
|
-
# Create object from extracted values.
|
47
|
-
SendEmailResponse.new(data,
|
48
|
-
message,
|
49
|
-
error_info)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|