pepipost_sdk_ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +25 -0
- data/README.md +49 -0
- data/lib/pepipost_sdk_ruby.rb +20 -0
- data/lib/pepipost_sdk_ruby/api_exception.rb +21 -0
- data/lib/pepipost_sdk_ruby/api_helper.rb +76 -0
- data/lib/pepipost_sdk_ruby/configuration.rb +14 -0
- data/lib/pepipost_sdk_ruby/controllers/email_controller.rb +113 -0
- data/lib/pepipost_sdk_ruby/models/attributes.rb +31 -0
- data/lib/pepipost_sdk_ruby/models/email_details.rb +51 -0
- data/lib/pepipost_sdk_ruby/models/emailv_1.rb +56 -0
- data/lib/pepipost_sdk_ruby/models/files.rb +26 -0
- data/lib/pepipost_sdk_ruby/models/settings.rb +63 -0
- data/lib/pepipost_sdk_ruby/pepipost_sdk_ruby_client.rb +16 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d372b00fe45332db359c58409f8a356b2e444707
|
4
|
+
data.tar.gz: 1e4dc84377829bf80a20e0c6fa4c1006da8ce1a4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 347b59c6b1a3d5a608aedc2e7b0b18f600a8feab9ea94eb6b0b0d1666be8b654205271ee474d4ea5edea55c84a4abbf0a5e82bfc4471a1ba7b2773087fd52b5d
|
7
|
+
data.tar.gz: d59b2e7800c54910a6eb71ddf43bbdd0103325ad974c87c108ae193db2741015301235a72921fe520722e1a1d4a071a6185711bdbd8ce0e024caddce075392b8
|
data/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
License:
|
2
|
+
========
|
3
|
+
The MIT License (MIT)
|
4
|
+
http://opensource.org/licenses/MIT
|
5
|
+
|
6
|
+
Copyright (c) 2014 - 2016 Pepipost
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
10
|
+
in the Software without restriction, including without limitation the rights
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
13
|
+
furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
16
|
+
all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
THE SOFTWARE.
|
25
|
+
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
Pepipost SDK - Ruby
|
2
|
+
=================
|
3
|
+
This is the official Pepipost SDK for Ruby.
|
4
|
+
|
5
|
+
It requires Ruby 2+
|
6
|
+
|
7
|
+
This SDK requires the Unirest library.
|
8
|
+
|
9
|
+
Installation:
|
10
|
+
=============
|
11
|
+
Run the build command
|
12
|
+
|
13
|
+
```
|
14
|
+
gem build pepipost_apiv_10.gemspec
|
15
|
+
```
|
16
|
+
|
17
|
+
Run the install command
|
18
|
+
```
|
19
|
+
gem install ./pepipost_apiv_10-1.0.0.gem
|
20
|
+
```
|
21
|
+
Usage:
|
22
|
+
===========
|
23
|
+
```ruby
|
24
|
+
require 'pepipost_apiv_10'
|
25
|
+
|
26
|
+
data = {
|
27
|
+
"api_key"=>"yoursecretapikey",
|
28
|
+
"recipients"=> ["recipient1@example.com","recipient2@example.com"],
|
29
|
+
"email_details" => {
|
30
|
+
"fromname" => "sender name",
|
31
|
+
"subject" => "This is a test email sent usig Pepipost SDK for Ruby",
|
32
|
+
"from" => "from@example.com",
|
33
|
+
"content" => "<p>This is a test email sent using Pepipost SDK for Ruby</p>",
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
email = PepipostApiv10::Email.new
|
39
|
+
response = email.send data
|
40
|
+
|
41
|
+
print response
|
42
|
+
|
43
|
+
```
|
44
|
+
|
45
|
+
## Author
|
46
|
+
|
47
|
+
[Tabby/Pepipost Devs](http://github.com/itabrezshaikh)
|
48
|
+
|
49
|
+
This SDK was semi-automatically generated by APIMATIC v2.0. Thanks to [APIMATIC](http://apimatic.io/)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
require 'openssl'
|
3
|
+
require 'json'
|
4
|
+
require 'unirest'
|
5
|
+
|
6
|
+
# APIMATIC Helper Files
|
7
|
+
require 'pepipost_sdk_ruby/api_helper.rb'
|
8
|
+
require 'pepipost_sdk_ruby/api_exception.rb'
|
9
|
+
require 'pepipost_sdk_ruby/configuration.rb'
|
10
|
+
require 'pepipost_sdk_ruby/pepipost_sdk_ruby_client.rb'
|
11
|
+
|
12
|
+
# Controllers
|
13
|
+
require 'pepipost_sdk_ruby/controllers/email_controller.rb'
|
14
|
+
|
15
|
+
# Models
|
16
|
+
require 'pepipost_sdk_ruby/models/attributes.rb'
|
17
|
+
require 'pepipost_sdk_ruby/models/files.rb'
|
18
|
+
require 'pepipost_sdk_ruby/models/emailv_1.rb'
|
19
|
+
require 'pepipost_sdk_ruby/models/email_details.rb'
|
20
|
+
require 'pepipost_sdk_ruby/models/settings.rb'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class APIException < StandardError
|
5
|
+
# value store
|
6
|
+
attr_reader :response_code
|
7
|
+
|
8
|
+
# value store
|
9
|
+
attr_reader :response_body
|
10
|
+
|
11
|
+
# The HTTP response code from the API request
|
12
|
+
# @param [String] the reason for raising an exception
|
13
|
+
# @param [Numeric] the HTTP response code from the API request
|
14
|
+
# @param [Object] the HTTP unprased response from the API request
|
15
|
+
def initialize(reason, response_code, response_body)
|
16
|
+
super(reason)
|
17
|
+
@response_code = response_code
|
18
|
+
@response_body = response_body
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class APIHelper
|
5
|
+
# Replaces template parameters in the given url
|
6
|
+
# @param [String] The query string builder to replace the template parameters
|
7
|
+
# @param [Array] The parameters to replace in the url
|
8
|
+
def self.append_url_with_template_parameters(query_builder, parameters)
|
9
|
+
# perform parameter validation
|
10
|
+
raise ArgumentError, 'Given value for parameter \"query_builder\" is invalid.' unless query_builder.is_a? String
|
11
|
+
|
12
|
+
# return if there are no parameters to replace
|
13
|
+
abort('no parameters to append') if parameters.nil?
|
14
|
+
|
15
|
+
# iterate and append parameters
|
16
|
+
parameters.map do |key, value|
|
17
|
+
replace_value = ''
|
18
|
+
|
19
|
+
if value.nil?
|
20
|
+
replace_value = ''
|
21
|
+
elsif value.is_a? Enumerable
|
22
|
+
replace_value = value.join('/')
|
23
|
+
else
|
24
|
+
replace_value = value.to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
# find the template parameter and replace it with its value
|
28
|
+
query_builder = query_builder.gsub('{' + key.to_s + '}', replace_value)
|
29
|
+
end
|
30
|
+
|
31
|
+
query_builder
|
32
|
+
end
|
33
|
+
|
34
|
+
# Appends the given set of parameters to the given query string
|
35
|
+
# @param [String] The query string builder to replace the template parameters
|
36
|
+
# @param [Array] The parameters to append
|
37
|
+
def self.append_url_with_query_parameters(query_builder, parameters)
|
38
|
+
# perform parameter validation
|
39
|
+
raise ArgumentError, 'Given value for parameter \"query_builder\" is invalid.' unless query_builder.is_a? String
|
40
|
+
|
41
|
+
# return if there are no parameters to replace
|
42
|
+
abort('no parameters to append') if parameters.nil?
|
43
|
+
|
44
|
+
# remove any nil values
|
45
|
+
parameters = parameters.reject { |_key, value| value.nil? }
|
46
|
+
|
47
|
+
# does the query string already has parameters
|
48
|
+
has_params = query_builder.include? '?'
|
49
|
+
separator = has_params ? '&' : '?'
|
50
|
+
|
51
|
+
# append query with separator and parameters
|
52
|
+
query_builder << separator << URI.unescape(URI.encode_www_form(parameters))
|
53
|
+
end
|
54
|
+
|
55
|
+
# Validates and processes the given Url
|
56
|
+
# @param [String] The given Url to process
|
57
|
+
# @return [String] Pre-processed Url as string
|
58
|
+
def self.clean_url(url)
|
59
|
+
# perform parameter validation
|
60
|
+
raise ArgumentError, 'Invalid Url.' unless url.is_a? String
|
61
|
+
|
62
|
+
# ensure that the urls are absolute
|
63
|
+
matches = url.match(%r{^(https?:\/\/[^\/]+)})
|
64
|
+
raise ArgumentError, 'Invalid Url format.' if matches.nil?
|
65
|
+
|
66
|
+
# get the http protocol match
|
67
|
+
protocol = matches[1]
|
68
|
+
|
69
|
+
# remove redundant forward slashes
|
70
|
+
query = url[protocol.length..-1].gsub(%r{\/\/+}, '/')
|
71
|
+
|
72
|
+
# return process url
|
73
|
+
protocol + query
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Configuration
|
5
|
+
# The base Uri for API calls
|
6
|
+
@base_uri = 'https://api.pepipost.com'
|
7
|
+
|
8
|
+
# create the getters and setters
|
9
|
+
class << self
|
10
|
+
attr_accessor :base_uri
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Email
|
5
|
+
@@instance = Email.new
|
6
|
+
# Singleton instance of the controller class
|
7
|
+
def self.instance
|
8
|
+
@@instance
|
9
|
+
end
|
10
|
+
|
11
|
+
# `Sending Mails` – This API is used for sending emails. Pepipost supports REST as well JSON formats for the input
|
12
|
+
# @param [String] api_key Required parameter: Your API Key
|
13
|
+
# @param [String] content Required parameter: Email body in html (to use attributes to display dynamic values such as name, account number, etc. for ex. [% NAME %] for ATT_NAME , [% AGE %] for ATT_AGE etc.)
|
14
|
+
# @param [String] from Required parameter: From email address
|
15
|
+
# @param [String] recipients Required parameter: Email addresses for recipients (multiple values allowed)
|
16
|
+
# @param [String] subject Required parameter: Subject of the Email
|
17
|
+
# @param [String] att_name Optional parameter: Specify attributes followed by ATT_ for recipient to personalized email for ex. ATT_NAME for name, ATT_AGE for age etc. (Multiple attributes are allowed)
|
18
|
+
# @param [String] attachmentid Optional parameter: specify uploaded attachments id (Multiple attachments are allowed)
|
19
|
+
# @param [String] bcc Optional parameter: Email address for bcc
|
20
|
+
# @param [Boolean] clicktrack Optional parameter: set ‘0’ or ‘1’ in-order to disable or enable the click-track
|
21
|
+
# @param [Boolean] footer Optional parameter: Set '0' or '1' in order to include footer or not
|
22
|
+
# @param [String] fromname Optional parameter: Email Sender name
|
23
|
+
# @param [Boolean] opentrack Optional parameter: set open-track value to ‘0’ or ‘1’ in-order to disable or enable
|
24
|
+
# @param [String] replytoid Optional parameter: Reply to email address
|
25
|
+
# @param [String] tags Optional parameter: To relate each message. Useful for reports.
|
26
|
+
# @param [Numeric] template Optional parameter: Email template ID
|
27
|
+
# @param [String] x_apiheader Optional parameter: Your defined unique identifier
|
28
|
+
# @return mixed response from the API call
|
29
|
+
def get_api_web_send_rest(api_key, content, from, recipients, subject, att_name = nil, attachmentid = nil, bcc = nil, clicktrack = true, footer = true, fromname = nil, opentrack = true, replytoid = nil, tags = nil, template = nil, x_apiheader = nil)
|
30
|
+
# the base uri for api requests
|
31
|
+
query_builder = Configuration.base_uri.dup
|
32
|
+
|
33
|
+
# prepare query string for API call
|
34
|
+
query_builder << '/api/web.send.rest'
|
35
|
+
|
36
|
+
# process optional query parameters
|
37
|
+
query_builder = APIHelper.append_url_with_query_parameters query_builder, {
|
38
|
+
'api_key' => api_key,
|
39
|
+
'content' => content,
|
40
|
+
'from' => from,
|
41
|
+
'recipients' => recipients,
|
42
|
+
'subject' => subject,
|
43
|
+
'ATT_NAME' => att_name,
|
44
|
+
'attachmentid' => attachmentid,
|
45
|
+
'bcc' => bcc,
|
46
|
+
'clicktrack' => if clicktrack.nil? then true else clicktrack end,
|
47
|
+
'footer' => if footer.nil? then true else footer end,
|
48
|
+
'fromname' => fromname,
|
49
|
+
'opentrack' => if opentrack.nil? then true else opentrack end,
|
50
|
+
'replytoid' => replytoid,
|
51
|
+
'tags' => tags,
|
52
|
+
'template' => template,
|
53
|
+
'X-APIHEADER' => x_apiheader
|
54
|
+
}
|
55
|
+
|
56
|
+
# validate and preprocess url
|
57
|
+
query_url = APIHelper.clean_url query_builder
|
58
|
+
|
59
|
+
# prepare headers
|
60
|
+
headers = {
|
61
|
+
'user-agent' => 'pepipost-sdk-ruby',
|
62
|
+
'accept' => 'application/json'
|
63
|
+
}
|
64
|
+
|
65
|
+
# invoke the API call request to fetch the response
|
66
|
+
response = Unirest.get query_url, headers: headers
|
67
|
+
|
68
|
+
#Error handling using HTTP status codes
|
69
|
+
if !response.code.between?(200, 206) # [200,206] = HTTP OK
|
70
|
+
raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body
|
71
|
+
end
|
72
|
+
|
73
|
+
response.body
|
74
|
+
end
|
75
|
+
|
76
|
+
# This is a common function send email using Pepipost API
|
77
|
+
def send(data)
|
78
|
+
response = self.create_api_web_send_json(data)
|
79
|
+
return response
|
80
|
+
end
|
81
|
+
|
82
|
+
# `Sending Mails` – This API is used for sending emails. Pepipost supports REST as well JSON formats for the input. This is JSON API.
|
83
|
+
# @param [Emailv1] data Required parameter: Data in JSON format
|
84
|
+
# @return mixed response from the API call
|
85
|
+
def create_api_web_send_json(data)
|
86
|
+
# the base uri for api requests
|
87
|
+
query_builder = Configuration.base_uri.dup
|
88
|
+
|
89
|
+
# prepare query string for API call
|
90
|
+
query_builder << '/api/web.send.json'
|
91
|
+
|
92
|
+
# validate and preprocess url
|
93
|
+
query_url = APIHelper.clean_url query_builder
|
94
|
+
|
95
|
+
# prepare headers
|
96
|
+
headers = {
|
97
|
+
'user-agent' => 'pepipost-sdk-ruby',
|
98
|
+
'accept' => 'application/json',
|
99
|
+
'content-type' => 'application/json; charset=utf-8'
|
100
|
+
}
|
101
|
+
|
102
|
+
# invoke the API call request to fetch the response
|
103
|
+
response = Unirest.post query_url, headers: headers, parameters: data.to_json
|
104
|
+
|
105
|
+
#Error handling using HTTP status codes
|
106
|
+
if !response.code.between?(200, 206) # [200,206] = HTTP OK
|
107
|
+
raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body
|
108
|
+
end
|
109
|
+
|
110
|
+
response.body
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Attributes
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [Array<String>]
|
7
|
+
attr_accessor :name
|
8
|
+
|
9
|
+
# TODO: Write general description for this method
|
10
|
+
# @return [Array<String>]
|
11
|
+
attr_accessor :regid
|
12
|
+
|
13
|
+
def method_missing(method_name)
|
14
|
+
puts "there's no method called '#{method_name}'"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Creates JSON of the curent object
|
18
|
+
def to_json
|
19
|
+
hash = key_map
|
20
|
+
hash.to_json
|
21
|
+
end
|
22
|
+
|
23
|
+
# Defines the key map for json serialization
|
24
|
+
def key_map
|
25
|
+
hash = {}
|
26
|
+
hash['NAME'] = name
|
27
|
+
hash['REGID'] = regid
|
28
|
+
hash
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class EmailDetails
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :fromname
|
8
|
+
|
9
|
+
# TODO: Write general description for this method
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :subject
|
12
|
+
|
13
|
+
# TODO: Write general description for this method
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :from
|
16
|
+
|
17
|
+
# TODO: Write general description for this method
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :replytoid
|
20
|
+
|
21
|
+
# TODO: Write general description for this method
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :tags
|
24
|
+
|
25
|
+
# TODO: Write general description for this method
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :content
|
28
|
+
|
29
|
+
def method_missing(method_name)
|
30
|
+
puts "there's no method called '#{method_name}'"
|
31
|
+
end
|
32
|
+
|
33
|
+
# Creates JSON of the curent object
|
34
|
+
def to_json
|
35
|
+
hash = key_map
|
36
|
+
hash.to_json
|
37
|
+
end
|
38
|
+
|
39
|
+
# Defines the key map for json serialization
|
40
|
+
def key_map
|
41
|
+
hash = {}
|
42
|
+
hash['fromname'] = fromname
|
43
|
+
hash['subject'] = subject
|
44
|
+
hash['from'] = from
|
45
|
+
hash['replytoid'] = replytoid
|
46
|
+
hash['tags'] = tags
|
47
|
+
hash['content'] = content
|
48
|
+
hash
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Emailv1
|
5
|
+
# Your secret API Key
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :api_key
|
8
|
+
|
9
|
+
# TODO: Write general description for this method
|
10
|
+
# @return [EmailDetails]
|
11
|
+
attr_accessor :email_details
|
12
|
+
|
13
|
+
# TODO: Write general description for this method
|
14
|
+
# @return [Array<String>]
|
15
|
+
attr_accessor :x_apiheader
|
16
|
+
|
17
|
+
# TODO: Write general description for this method
|
18
|
+
# @return [Settings]
|
19
|
+
attr_accessor :settings
|
20
|
+
|
21
|
+
# TODO: Write general description for this method
|
22
|
+
# @return [Array<String>]
|
23
|
+
attr_accessor :recipients
|
24
|
+
|
25
|
+
# TODO: Write general description for this method
|
26
|
+
# @return [Attributes]
|
27
|
+
attr_accessor :attributes
|
28
|
+
|
29
|
+
# TODO: Write general description for this method
|
30
|
+
# @return [Files]
|
31
|
+
attr_accessor :files
|
32
|
+
|
33
|
+
def method_missing(method_name)
|
34
|
+
puts "there's no method called '#{method_name}'"
|
35
|
+
end
|
36
|
+
|
37
|
+
# Creates JSON of the curent object
|
38
|
+
def to_json
|
39
|
+
hash = key_map
|
40
|
+
hash.to_json
|
41
|
+
end
|
42
|
+
|
43
|
+
# Defines the key map for json serialization
|
44
|
+
def key_map
|
45
|
+
hash = {}
|
46
|
+
hash['api_key'] = api_key
|
47
|
+
hash['email_details'] = email_details
|
48
|
+
hash['X-APIHEADER'] = x_apiheader
|
49
|
+
hash['settings'] = settings
|
50
|
+
hash['recipients'] = recipients
|
51
|
+
hash['attributes'] = attributes
|
52
|
+
hash['files'] = files
|
53
|
+
hash
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Files
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :example_attachment_1_txt
|
8
|
+
|
9
|
+
def method_missing(method_name)
|
10
|
+
puts "there's no method called '#{method_name}'"
|
11
|
+
end
|
12
|
+
|
13
|
+
# Creates JSON of the curent object
|
14
|
+
def to_json
|
15
|
+
hash = key_map
|
16
|
+
hash.to_json
|
17
|
+
end
|
18
|
+
|
19
|
+
# Defines the key map for json serialization
|
20
|
+
def key_map
|
21
|
+
hash = {}
|
22
|
+
hash['example_attachment1.txt'] = example_attachment_1_txt
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
module PepipostSdkRuby
|
4
|
+
class Settings
|
5
|
+
# TODO: Write general description for this method
|
6
|
+
# @return [Boolean]
|
7
|
+
attr_accessor :footer
|
8
|
+
|
9
|
+
# TODO: Write general description for this method
|
10
|
+
# @return [Boolean]
|
11
|
+
attr_accessor :clicktrack
|
12
|
+
|
13
|
+
# TODO: Write general description for this method
|
14
|
+
# @return [Boolean]
|
15
|
+
attr_accessor :opentrack
|
16
|
+
|
17
|
+
# TODO: Write general description for this method
|
18
|
+
# @return [Boolean]
|
19
|
+
attr_accessor :unsubscribe
|
20
|
+
|
21
|
+
# TODO: Write general description for this method
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :bcc
|
24
|
+
|
25
|
+
# TODO: Write general description for this method
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :attachmentid
|
28
|
+
|
29
|
+
# TODO: Write general description for this method
|
30
|
+
# @return [Numeric]
|
31
|
+
attr_accessor :template
|
32
|
+
|
33
|
+
def initialize
|
34
|
+
@footer = true
|
35
|
+
@clicktrack = true
|
36
|
+
@opentrack = true
|
37
|
+
@unsubscribe = true
|
38
|
+
end
|
39
|
+
|
40
|
+
def method_missing(method_name)
|
41
|
+
puts "there's no method called '#{method_name}'"
|
42
|
+
end
|
43
|
+
|
44
|
+
# Creates JSON of the curent object
|
45
|
+
def to_json
|
46
|
+
hash = key_map
|
47
|
+
hash.to_json
|
48
|
+
end
|
49
|
+
|
50
|
+
# Defines the key map for json serialization
|
51
|
+
def key_map
|
52
|
+
hash = {}
|
53
|
+
hash['footer'] = footer
|
54
|
+
hash['clicktrack'] = clicktrack
|
55
|
+
hash['opentrack'] = opentrack
|
56
|
+
hash['unsubscribe'] = unsubscribe
|
57
|
+
hash['bcc'] = bcc
|
58
|
+
hash['attachmentid'] = attachmentid
|
59
|
+
hash['template'] = template
|
60
|
+
hash
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0 on 04/15/2016
|
2
|
+
|
3
|
+
# Require controllers
|
4
|
+
#require '/var/lib/gems/2.2.0/gems/pepipost_apiv_10-1.0.0/lib/pepipost_apiv_10/controllers/email_controller.rb'
|
5
|
+
require 'pepipost_sdk_ruby/controllers/email_controller.rb'
|
6
|
+
|
7
|
+
module PepipostSdkRuby
|
8
|
+
class PepipostSdkRubyClient
|
9
|
+
# Singleton access to email controller
|
10
|
+
# @return [EmailController] Returns the controller instance
|
11
|
+
def email
|
12
|
+
EmailController.instance
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pepipost_sdk_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tabrez Shaikh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: unirest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.2
|
27
|
+
description: This is the Official Pepipost SDK for Ruby
|
28
|
+
email: tabrez@pepipost.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- LICENSE
|
34
|
+
- README.md
|
35
|
+
- lib/pepipost_sdk_ruby.rb
|
36
|
+
- lib/pepipost_sdk_ruby/api_exception.rb
|
37
|
+
- lib/pepipost_sdk_ruby/api_helper.rb
|
38
|
+
- lib/pepipost_sdk_ruby/configuration.rb
|
39
|
+
- lib/pepipost_sdk_ruby/controllers/email_controller.rb
|
40
|
+
- lib/pepipost_sdk_ruby/models/attributes.rb
|
41
|
+
- lib/pepipost_sdk_ruby/models/email_details.rb
|
42
|
+
- lib/pepipost_sdk_ruby/models/emailv_1.rb
|
43
|
+
- lib/pepipost_sdk_ruby/models/files.rb
|
44
|
+
- lib/pepipost_sdk_ruby/models/settings.rb
|
45
|
+
- lib/pepipost_sdk_ruby/pepipost_sdk_ruby_client.rb
|
46
|
+
homepage: http://pepipost.com/
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '2.0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 2.4.5.1
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: pepipost_sdk_ruby
|
70
|
+
test_files: []
|