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,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# Class for exceptions when there is a network error, status code error, etc.
|
6
8
|
class APIException < StandardError
|
7
9
|
attr_reader :context, :response_code
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# Utility class for custom header authorization.
|
8
|
+
class CustomHeaderAuth
|
9
|
+
# Add custom authentication to the request.
|
10
|
+
# @param [HttpRequest] The HttpRequest object to which authentication will
|
11
|
+
# be added.
|
12
|
+
def self.apply(http_request)
|
13
|
+
http_request.add_header('api_key', Configuration.api_key)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,8 +1,12 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
3
6
|
require 'faraday/http_cache'
|
7
|
+
require 'faraday_middleware'
|
4
8
|
|
5
|
-
module
|
9
|
+
module Pepipost
|
6
10
|
# An implementation of HttpClient.
|
7
11
|
class FaradayClient < HttpClient
|
8
12
|
# The constructor.
|
@@ -10,16 +14,17 @@ module PepipostGem
|
|
10
14
|
max_retries: nil, retry_interval: nil)
|
11
15
|
@connection = Faraday.new do |faraday|
|
12
16
|
faraday.use Faraday::HttpCache, serializer: Marshal if cache
|
17
|
+
faraday.use FaradayMiddleware::FollowRedirects
|
13
18
|
faraday.request :multipart
|
14
19
|
faraday.request :url_encoded
|
15
20
|
faraday.ssl[:ca_file] = Certifi.where
|
16
|
-
faraday.adapter Faraday.default_adapter
|
17
|
-
faraday.options[:params_encoder] = Faraday::FlatParamsEncoder
|
18
|
-
faraday.options[:open_timeout] = timeout if timeout
|
19
21
|
faraday.request :retry, max: max_retries, interval: if max_retries &&
|
20
22
|
retry_interval
|
21
23
|
retry_interval
|
22
24
|
end
|
25
|
+
faraday.adapter Faraday.default_adapter
|
26
|
+
faraday.options[:params_encoder] = Faraday::FlatParamsEncoder
|
27
|
+
faraday.options[:open_timeout] = timeout if timeout
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
@@ -30,7 +35,9 @@ module PepipostGem
|
|
30
35
|
http_request.query_url
|
31
36
|
) do |request|
|
32
37
|
request.headers = http_request.headers
|
33
|
-
|
38
|
+
unless http_request.parameters.empty?
|
39
|
+
request.body = http_request.parameters
|
40
|
+
end
|
34
41
|
end
|
35
42
|
convert_response(response)
|
36
43
|
end
|
@@ -42,7 +49,9 @@ module PepipostGem
|
|
42
49
|
http_request.query_url
|
43
50
|
) do |request|
|
44
51
|
request.headers = http_request.headers
|
45
|
-
|
52
|
+
unless http_request.parameters.empty?
|
53
|
+
request.body = http_request.parameters
|
54
|
+
end
|
46
55
|
end
|
47
56
|
convert_response(response)
|
48
57
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# HttpCallBack allows defining callables for pre and post API calls.
|
6
8
|
class HttpCallBack
|
7
9
|
# A controller will call this method before making an HTTP Request.
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# An interface for the methods that an HTTP Client must implement.
|
6
8
|
#
|
7
9
|
# This class should not be instantiated but should be used as a base class
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# Represents an Http call in context.
|
6
8
|
class HttpContext
|
7
9
|
attr_accessor :request, :response
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# HTTP Methods Enumeration.
|
6
8
|
class HttpMethodEnum
|
7
9
|
HTTPMETHODENUM = [GET = 'GET'.freeze, POST = 'POST'.freeze,
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# Represents a single Http Request.
|
6
8
|
class HttpRequest
|
7
9
|
attr_accessor :http_method, :query_url, :headers,
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# Http response received.
|
6
8
|
class HttpResponse
|
7
9
|
attr_accessor :status_code, :headers, :raw_body
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# Indicate the action (add or subtract) to be taken.Allowed values increase,
|
8
|
+
# decrease
|
9
|
+
class ActionEnum
|
10
|
+
ACTION_ENUM = [
|
11
|
+
# TODO: Write general description for INCREASE
|
12
|
+
INCREASE = 'increase'.freeze,
|
13
|
+
|
14
|
+
# TODO: Write general description for DECREASE
|
15
|
+
DECREASE = 'decrease'.freeze
|
16
|
+
].freeze
|
17
|
+
end
|
18
|
+
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
|
+
# Add Suppression modal
|
8
|
+
class AddEmailOrDomainToSuppressionList < BaseModel
|
9
|
+
# Add the domain to be suppressed here. We will not deliver emails to
|
10
|
+
# recipients email addresses with this domain.<br>\nComma separate the
|
11
|
+
# values to suppress multiple domains..
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :domain
|
14
|
+
|
15
|
+
# Add an email address to be suppressed here. We will not deliver emails to
|
16
|
+
# this email address.<br>\nComma separate the values to suppress multiple
|
17
|
+
# email 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
|
+
AddEmailOrDomainToSuppressionList.new(domain,
|
45
|
+
email)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# aggregated_by.
|
8
|
+
class AggregatedByEnum
|
9
|
+
AGGREGATED_BY_ENUM = [
|
10
|
+
# TODO: Write general description for DAY
|
11
|
+
DAY = 'day'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for WEEK
|
14
|
+
WEEK = 'week'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for MONTH
|
17
|
+
MONTH = 'month'.freeze
|
18
|
+
].freeze
|
19
|
+
end
|
20
|
+
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
|
+
# Attachments
|
8
|
+
class Attachments < BaseModel
|
9
|
+
# Base64 encoded value of the attached file
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :content
|
12
|
+
|
13
|
+
# filename of attachments
|
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['content'] = 'content'
|
21
|
+
@_hash['name'] = 'name'
|
22
|
+
@_hash
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize(content = nil,
|
26
|
+
name = nil)
|
27
|
+
@content = content
|
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
|
+
content = hash['content']
|
37
|
+
name = hash['name']
|
38
|
+
|
39
|
+
# Create object from extracted values.
|
40
|
+
Attachments.new(content,
|
41
|
+
name)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,7 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
3
5
|
|
4
|
-
module
|
6
|
+
module Pepipost
|
5
7
|
# Base model.
|
6
8
|
class BaseModel
|
7
9
|
# Returns a Hash representation of the current object.
|
@@ -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
|
+
# AMP, HTML should be provided
|
8
|
+
class Content < BaseModel
|
9
|
+
# TODO: Write general description for this method
|
10
|
+
# @return [TypeEnum]
|
11
|
+
attr_accessor :type
|
12
|
+
|
13
|
+
# HTML content to be sent in your email
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :value
|
16
|
+
|
17
|
+
# A mapping from model property names to API property names.
|
18
|
+
def self.names
|
19
|
+
@_hash = {} if @_hash.nil?
|
20
|
+
@_hash['type'] = 'type'
|
21
|
+
@_hash['value'] = 'value'
|
22
|
+
@_hash
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize(type = nil,
|
26
|
+
value = nil)
|
27
|
+
@type = type
|
28
|
+
@value = value
|
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
|
+
type = hash['type']
|
37
|
+
value = hash['value']
|
38
|
+
|
39
|
+
# Create object from extracted values.
|
40
|
+
Content.new(type,
|
41
|
+
value)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# CreateSubaccount modal
|
8
|
+
class CreateSubaccount < BaseModel
|
9
|
+
# provide a username for the subaccount
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :username
|
12
|
+
|
13
|
+
# email address to be registered with the account.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :email
|
16
|
+
|
17
|
+
# You can opt to set the password for the subaccount.\nIf set as 1, please
|
18
|
+
# provide a value in password parameter.\nIf set as 0, the email
|
19
|
+
# confirmation link will act as a password reset link.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :setpassword
|
22
|
+
|
23
|
+
# It is required to pass this value, if setpassword is set as 1.\nThe
|
24
|
+
# password must comprise minimum of 8 characters and include one uppercase
|
25
|
+
# character, one lowercase character, one numeric character.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :password
|
28
|
+
|
29
|
+
# Allowed values one_time_credit or unlimited by default, all subaccounts
|
30
|
+
# are created with credit type as unlimited.
|
31
|
+
# @return [String]
|
32
|
+
attr_accessor :credit_type
|
33
|
+
|
34
|
+
# A mapping from model property names to API property names.
|
35
|
+
def self.names
|
36
|
+
@_hash = {} if @_hash.nil?
|
37
|
+
@_hash['username'] = 'username'
|
38
|
+
@_hash['email'] = 'email'
|
39
|
+
@_hash['setpassword'] = 'setpassword'
|
40
|
+
@_hash['password'] = 'password'
|
41
|
+
@_hash['credit_type'] = 'credit_type'
|
42
|
+
@_hash
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(username = nil,
|
46
|
+
email = nil,
|
47
|
+
setpassword = nil,
|
48
|
+
password = nil,
|
49
|
+
credit_type = nil)
|
50
|
+
@username = username
|
51
|
+
@email = email
|
52
|
+
@setpassword = setpassword
|
53
|
+
@password = password
|
54
|
+
@credit_type = credit_type
|
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
|
+
username = hash['username']
|
63
|
+
email = hash['email']
|
64
|
+
setpassword = hash['setpassword']
|
65
|
+
password = hash['password']
|
66
|
+
credit_type = hash['credit_type']
|
67
|
+
|
68
|
+
# Create object from extracted values.
|
69
|
+
CreateSubaccount.new(username,
|
70
|
+
email,
|
71
|
+
setpassword,
|
72
|
+
password,
|
73
|
+
credit_type)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -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
|
+
# delete domain modal
|
8
|
+
class DeleteDomain < BaseModel
|
9
|
+
# Name of the domain
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :domain
|
12
|
+
|
13
|
+
# A mapping from model property names to API property names.
|
14
|
+
def self.names
|
15
|
+
@_hash = {} if @_hash.nil?
|
16
|
+
@_hash['domain'] = 'domain'
|
17
|
+
@_hash
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize(domain = nil)
|
21
|
+
@domain = domain
|
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
|
+
domain = hash['domain']
|
30
|
+
|
31
|
+
# Create object from extracted values.
|
32
|
+
DeleteDomain.new(domain)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|