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.
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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b7d3643dbb6d993e1cb1a312c1ea16c036782e7
4
- data.tar.gz: d4212c3932c2a138dc45bfd76985ac579c1e3fe0
3
+ metadata.gz: ffbd1f3d8c521640487d030257c4ca12e2706dcb
4
+ data.tar.gz: f5128832bc126caf75fc4b1a16c096385ada50f0
5
5
  SHA512:
6
- metadata.gz: 2c255f736b76d2e5337efc58c8e322801c4ebd3648e146c48b13c508d16c572fe3c608669cc8f072abc6a04eb35402f1e09455aea7a23a1c18065d0839e3d63e
7
- data.tar.gz: c7c9a87fe5b4f7da863c41a69859d1304ea0e6b9f004f1b475e9b91b6bcac6854504a08c1d20a2a3861092365fa92028523f965bedd16a33e2532ab93b7f016c
6
+ metadata.gz: 6c716c649ee1991e028ad64b1fcd1fdda292e5cc86e416c663fac577a3859d3b249beb767c0b44631de0e8a7f92808af6e8c6cf526e393c05b00dc12009181c7
7
+ data.tar.gz: 03680023eca0b81f64e95cc7330a295c925da65019c654949e4c3d2b9d2a9a7055f2bb52acb3714737a14ae4c9558fe275fc23f46fb6c7aed3c6a1883a6a379d
data/LICENSE CHANGED
@@ -1,9 +1,6 @@
1
- License:
2
- ========
3
- The MIT License (MIT)
4
- http://opensource.org/licenses/MIT
1
+ MIT License
5
2
 
6
- Copyright (c) 2014 - 2016 APIMATIC Limited
3
+ Copyright (c) 2018 Pepipost
7
4
 
8
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
6
  of this software and associated documentation files (the "Software"), to deal
@@ -12,17 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
9
  copies of the Software, and to permit persons to whom the Software is
13
10
  furnished to do so, subject to the following conditions:
14
11
 
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
17
14
 
18
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
19
  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
-
26
- Trade Mark:
27
- ==========
28
- APIMATIC is a trade mark for APIMATIC Limited
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,141 +1,187 @@
1
- # Getting started
2
-
3
- Pepipost is a cloud-based SMTP relay service that delivers highly personalised transactional emails to the inbox within seconds of your customer’s transaction
1
+ ![pepipostlogo](https://pepipost.com/wp-content/uploads/2017/07/P_LOGO.png)
4
2
 
5
- ## How to Build
3
+ [![Gem Version](https://badge.fury.io/rb/pepipost_gem.svg)](https://badge.fury.io/rb/pepipost_gem)
4
+ [![Open Source Helpers](https://www.codetriage.com/pepipost/pepipost-sdk-ruby/badges/users.svg)](https://www.codetriage.com/pepipost/pepipost-sdk-ruby)
5
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
6
+ [![Twitter Follow](https://img.shields.io/twitter/follow/pepi_post.svg?style=social&label=Follow)](https://twitter.com/pepi_post)
6
7
 
7
- This client library is a Ruby gem which can be compiled and used in your Ruby and Ruby on Rails project. This library requires a few gems from the RubyGems repository.
8
+ # Ruby SDK :gem: for [Pepipost](http://www.pepipost.com/?utm_campaign=GitHubSDK&utm_medium=GithubSDK&utm_source=GithubSDK)
8
9
 
9
- 1. Open the command line interface or the terminal and navigate to the folder containing the source code.
10
- 2. Run ``` gem build pepipost_gem.gemspec ``` to build the gem.
11
- 3. Once built, the gem can be installed on the current work environment using ``` gem install pepipost_gem-2.5.0.gem ```
10
+ This gem contains methods for easily interacting with the Pepipost Email Sending API to send emails within few seconds.
12
11
 
13
- ![Building Gem](https://apidocs.io/illustration/ruby?step=buildSDK&workspaceFolder=pepipost_gem-Ruby&workspaceName=pepipost_gem-Ruby&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
12
+ We are trying to make our libraries a Community Driven. To help us building right things in proper order we would request you to help us by sharing comments, creating new issues or pull request.
14
13
 
15
- ## How to Use
14
+ ## Table of Content
15
+ * [Installation](#installation)
16
+ * [Quick Start](#quickstart)
17
+ * [Sample Example](#steps)
18
+ * [Announcements](#announcements)
19
+ * [Roadmap](#roadmap)
20
+ * [About](#about)
21
+ * [License](#license)
16
22
 
17
- The following section explains how to use the PepipostGem Ruby Gem in a new Rails project using RubyMine™. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
18
23
 
19
- ### 1. Starting a new project
24
+ <a name="installation"></a>
25
+ ## Installation
20
26
 
21
- Close any existing projects in RubyMine&trade; by selecting ``` File -> Close Project ```. Next, click on ``` Create New Project ``` to create a new project from scratch.
27
+ ### Manually generate your own pepipost gem
22
28
 
23
- ![Create a new project in RubyMine](https://apidocs.io/illustration/ruby?step=createNewProject0&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
29
+ This client library is a Ruby gem which can be compiled and used in your Ruby on Rails project. This library requires a few gems from the RubyGems repository.
24
30
 
25
- Next, provide ``` TestApp ``` as the project name, choose ``` Rails Application ``` as the project type, and click ``` OK ```.
31
+ * Open the command line interface/terminal and navigate to the folder of your choice and run the below commands to download and navigate to the downloaded folder:
32
+ ``` git clone https://github.com/pepipost/pepipost-sdk-ruby.git ```
33
+ * ``` cd pepipost-sdk-ruby ```
26
34
 
27
- ![Create a new Rails Application in RubyMine - step 1](https://apidocs.io/illustration/ruby?step=createNewProject1&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
35
+ * ``` gem build pepipost.gemspec ``` to build the gem.
36
+ * ``` gem install pepipost-5.0.0.gem ``` to install pepipost gem
28
37
 
29
- In the next dialog make sure that correct *Ruby SDK* is being used (minimum 2.0.0) and click ``` OK ```.
38
+ ![Building Gem](https://apidocs.io/illustration/ruby?step=buildSDK&workspaceFolder=pepipost-Ruby&workspaceName=pepipost-Ruby&projectName=pepipost_gem&gemName=pepipost&gemVer=5.0.0)
30
39
 
31
- ![Create a new Rails Application in RubyMine - step 2](https://apidocs.io/illustration/ruby?step=createNewProject2&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
40
+ Once pepipost_gem is installed, use the sample example to [send test email](#steps).
32
41
 
33
- This will create a new Rails Application project with an existing set of files and folder.
42
+ <a name="quickstart"></a>
43
+ ## Quickstart
34
44
 
35
- ### 2. Add reference of the gem
45
+ The following section explains how to use the Pepipost Gem in a new Rails project using RubyMine.
36
46
 
37
- In order to use the PepipostGem gem in the new project we must add a gem reference. Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: ``` gem 'pepipost_gem', '~> 2.5.0' ```
47
+ The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
38
48
 
39
- ![Add references of the Gemfile](https://apidocs.io/illustration/ruby?step=addReference&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
49
+ 1. Starting a new project
40
50
 
41
- ### 3. Adding a new Rails Controller
51
+ Close any existing projects in RubyMine by selecting:
42
52
 
43
- Once the ``` TestApp ``` project is created, a folder named ``` controllers ``` will be visible in the *Project Explorer* under the following path: ``` TestApp > app > controllers ```. Right click on this folder and select ``` New -> Run Rails Generator... ```.
53
+ * ``` File -> Close Project ```
54
+ * Next, click on ``` Create New Project ``` to create a new project from scratch.
44
55
 
45
- ![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?step=addCode0&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
56
+ ![Create a new project in RubyMine](https://apidocs.io/illustration/ruby?step=createNewProject0&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
46
57
 
47
- Selecting the said option will popup a small window where the generator names are displayed. Here, select the ``` controller ``` template.
58
+ * Next, provide ``` TestApp ``` as the project name.
59
+ * Choose ``` Rails Application ``` as the project type.
60
+ * Click ``` OK ```.
48
61
 
49
- ![Create a new Controller](https://apidocs.io/illustration/ruby?step=addCode1&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
62
+ ![Create a new Rails Application in RubyMine - step 1](https://apidocs.io/illustration/ruby?step=createNewProject1&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
50
63
 
51
- Next, a popup window will ask you for a Controller name and included Actions. For controller name provide ``` Hello ``` and include an action named ``` Index ``` and click ``` OK ```.
64
+ In the next dialog make sure that correct *Ruby SDK* is being used (minimum 2.0.0)
65
+ * click ``` OK ```.
52
66
 
53
- ![Add a new Controller](https://apidocs.io/illustration/ruby?step=addCode2&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
67
+ ![Create a new Rails Application in RubyMine - step 2](https://apidocs.io/illustration/ruby?step=createNewProject2&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
54
68
 
55
- A new controller class anmed ``` HelloController ``` will be created in a file named ``` hello_controller.rb ``` containing a method named ``` Index ```. In this method, add code for initialization and a sample for its usage.
69
+ This will create a new Rails Application project with an existing set of files and folder.
56
70
 
57
- ![Initialize the library](https://apidocs.io/illustration/ruby?step=addCode3&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
71
+ 2. Add reference of the gem
72
+
73
+ * In order to use the Pepipost gem in the new project, add a gem reference.
74
+ * Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node.
75
+ * The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line:
76
+ ``` gem 'pepipost_gem', '~> 2.5.0' ```
58
77
 
59
- ## How to Test
78
+ ![Add references of the Gemfile](https://apidocs.io/illustration/ruby?step=addReference&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
60
79
 
61
- You can test the generated SDK and the server with automatically generated test
62
- cases as follows:
80
+ 3. Adding a new Rails Controller
63
81
 
64
- 1. From terminal/cmd navigate to the root directory of the SDK.
65
- 2. Invoke: `bundle exec rake`
82
+ * Once the ``` TestApp ``` project is created.
83
+ * Folder named ``` controllers ``` will be visible in the *Project Explorer* under the following path:
84
+ ``` TestApp > app > controllers ```.
85
+ * Right click on this folder.
86
+ * select ``` New -> Run Rails Generator ```.
66
87
 
67
- ## Initialization
88
+ ![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?step=addCode0&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
68
89
 
69
- ###
90
+ * Selecting the said option will popup a small window where the generator names are displayed.
91
+ * select the ``` controller ``` template.
70
92
 
71
- API client can be initialized as following.
93
+ ![Create a new Controller](https://apidocs.io/illustration/ruby?step=addCode1&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
72
94
 
73
- ```ruby
74
-
75
- client = PepipostGem::PepipostGemClient.new
76
- ```
95
+ * A popup window will ask you for a Controller name and included Actions.
96
+ * For controller name provide ``` Hello ```.
97
+ * Include an action named ``` Index ```.
98
+ * Click ``` OK ```.
77
99
 
78
- The added initlization code can be debugged by putting a breakpoint in the ``` Index ``` method and running the project in debug mode by selecting ``` Run -> Debug 'Development: TestApp' ```.
100
+ ![Add a new Controller](https://apidocs.io/illustration/ruby?step=addCode2&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
79
101
 
80
- ![Debug the TestApp](https://apidocs.io/illustration/ruby?step=addCode4&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0&initLine=client%2520%253D%2520PepipostGemClient.new)
102
+ * A new controller class anmed ``` HelloController ``` will be created in a file named ``` hello_controller.rb ``` containing a method named ``` Index ```.
103
+ * In this method, copy [sample example](#steps).
104
+ * Run your project.
81
105
 
106
+ ![Initialize the library](https://apidocs.io/illustration/ruby?step=addCode3&workspaceFolder=pepipost_gem-Ruby&workspaceName=PepipostGem&projectName=pepipost_gem&gemName=pepipost_gem&gemVer=2.5.0)
82
107
 
108
+ <a name="steps"></a>
109
+ ## Usage
83
110
 
84
- # Class Reference
85
-
86
- ## <a name="list_of_controllers"></a>List of Controllers
111
+ ```ruby
112
+ require 'pepipost'
113
+ require 'json'
87
114
 
88
- * [EmailController](#email_controller)
115
+ include Pepipost
89
116
 
90
- ## <a name="email_controller"></a>![Class: ](https://apidocs.io/img/class.png ".EmailController") EmailController
117
+ api_key = 'Your api_key here'
91
118
 
92
- ### Get singleton instance
119
+ client = PepipostClient.new(api_key: api_key)
93
120
 
94
- The singleton instance of the ``` EmailController ``` class can be accessed from the API Client.
121
+ mail_send_controller = client.mail_send
95
122
 
96
- ```ruby
97
- email_controller = client.email
98
- ```
123
+ body = Send.new
99
124
 
100
- ### <a name="create_send_email"></a>![Method: ](https://apidocs.io/img/method.png ".EmailController.create_send_email") create_send_email
125
+ body.from = From.new
101
126
 
102
- > *Tags:* ``` Skips Authentication ```
127
+ body.from.email = 'hello@your-register-domain-with-pepipost'
128
+ body.from.name = 'Example Pepi'
129
+ body.subject = 'Emailing with Pepipost is easy'
130
+ body.content = []
103
131
 
104
- > This Endpoint sends emails with the credentials passed.
132
+ body.content[0] = Content.new
105
133
 
134
+ body.content[0].type = TypeEnum::HTML
135
+ body.content[0].value = '<html><body>Hey,<br><br>Do you know integration is even simpler in Pepipost, <br>with Ruby <br> Happy Mailing ! <br><br>Pepipost </body></html>'
106
136
 
107
- ```ruby
108
- def create_send_email(api_key = nil,
109
- body = nil); end
110
- ```
111
137
 
112
- #### Parameters
138
+ body.personalizations = []
113
139
 
114
- | Parameter | Tags | Description |
115
- |-----------|------|-------------|
116
- | api_key | ``` Optional ``` | Generated header parameter. Example value ='5ce7096ed4bf2b39dfa932ff5fa84ed9ed8' |
117
- | body | ``` Optional ``` | The body passed will be json format. |
140
+ body.personalizations[0] = Personalizations.new
118
141
 
142
+ body.personalizations[0].to = []
119
143
 
120
- #### Example Usage
144
+ body.personalizations[0].to[0] = EmailStruct.new
121
145
 
122
- ```ruby
123
- api_key = 'api_key'
124
- body = EmailBody.new
146
+ body.personalizations[0].to[0].name = 'random-1'
147
+ body.personalizations[0].to[0].email = 'random-1@mydomain.name'
125
148
 
126
- result = email_controller.create_send_email(api_key, body)
149
+ begin
150
+ result = mail_send_controller.create_generatethemailsendrequest(body)
151
+ puts (result)
152
+ rescue APIException => ex
153
+ puts "Caught APIException: #{ex.message}"
154
+ end
127
155
 
128
156
  ```
129
157
 
130
- #### Errors
158
+ * Change your api-key and sending domain respectively
159
+ * **apikey** will be available under Login to Pepipost -> Settings -> Integration
160
+ * **Sending Domain** will be available under Login to Pepiost -> Settings -> Sending Domains
161
+
162
+ ```
163
+ *Note :: Domains showing with Active status on Sending Domain dashboard are only allowed to send any sort of emails.* In case there are no Sending Domain added under your account, then first add the domain, get the DNS (SPF/DKIM) settings done and get it reviewed by our compliance team for approval. Once the domain is approved, it will be in ACTIVE status and will be ready to send any sort of emails.
164
+ ```
165
+ * Save above file as sendEmail.rb
166
+ * run ``` ruby sendEmail.rb ```
131
167
 
132
- | Error Code | Error Description |
133
- |------------|-------------------|
134
- | 405 | Method not allowed |
168
+ <a name="announcements"></a>
169
+ # Announcements
135
170
 
171
+ v5.0 has been released! Please see the [release notes](https://github.com/pepipost/pepipost-sdk-ruby/releases/) for details.
136
172
 
173
+ All updates to this library are documented in our [releases](https://github.com/pepipost/pepipost-sdk-ruby/releases). For any queries, feel free to reach out us at dx@pepipost.com
137
174
 
138
- [Back to List of Controllers](#list_of_controllers)
175
+ <a name="roadmap"></a>
176
+ ## Roadmap
139
177
 
178
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/pepipost/pepipost-sdk-ruby/issues) and [pull requests](https://github.com/pepipost/pepipost-sdk-ruby/pulls). We would love to hear your feedback.
140
179
 
180
+ <a name="about"></a>
181
+ ## About
182
+ pepipost-sdk-ruby library is guided and supported by the [Pepipost Developer Experience Team](https://github.com/orgs/pepipost/teams/pepis/members) .
183
+ This pepipost gem is maintained and funded by Pepipost Ltd. The names and logos for pepipost gem are trademarks of Pepipost Ltd.
141
184
 
185
+ <a name="license"></a>
186
+ ## License
187
+ This code library was semi-automatically generated by APIMATIC v2.0 and licensed under The MIT License (MIT).
@@ -0,0 +1,74 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ require 'date'
7
+ require 'json'
8
+ require 'faraday'
9
+ require 'certifi'
10
+ require 'logging'
11
+
12
+ require_relative 'pepipost/api_helper.rb'
13
+ require_relative 'pepipost/pepipost_client.rb'
14
+
15
+ # Http
16
+ require_relative 'pepipost/http/http_call_back.rb'
17
+ require_relative 'pepipost/http/http_client.rb'
18
+ require_relative 'pepipost/http/http_method_enum.rb'
19
+ require_relative 'pepipost/http/http_request.rb'
20
+ require_relative 'pepipost/http/http_response.rb'
21
+ require_relative 'pepipost/http/http_context.rb'
22
+ require_relative 'pepipost/http/faraday_client.rb'
23
+ require_relative 'pepipost/http/auth/custom_header_auth.rb'
24
+
25
+ # Models
26
+ require_relative 'pepipost/models/base_model.rb'
27
+ require_relative 'pepipost/models/content.rb'
28
+ require_relative 'pepipost/models/personalizations.rb'
29
+ require_relative 'pepipost/models/from.rb'
30
+ require_relative 'pepipost/models/settings.rb'
31
+ require_relative 'pepipost/models/email_struct.rb'
32
+ require_relative 'pepipost/models/attachments.rb'
33
+ require_relative 'pepipost/models/send.rb'
34
+ require_relative 'pepipost/models/domain_struct.rb'
35
+ require_relative 'pepipost/models/delete_domain.rb'
36
+ require_relative 'pepipost/models/add_email_or_domain_to_suppression_list.rb'
37
+ require_relative 'pepipost/models/remove_email_or_domain_to_suppression_list.rb'
38
+ require_relative 'pepipost/models/create_subaccount.rb'
39
+ require_relative 'pepipost/models/update_subaccount.rb'
40
+ require_relative 'pepipost/models/update_credis_of_subaccount.rb'
41
+ require_relative 'pepipost/models/update_recurring_credis_of_subaccount.rb'
42
+ require_relative 'pepipost/models/delete_subacoount.rb'
43
+ require_relative 'pepipost/models/enable_or_disable_subacoount.rb'
44
+ require_relative 'pepipost/models/type_enum.rb'
45
+ require_relative 'pepipost/models/action_enum.rb'
46
+ require_relative 'pepipost/models/aggregated_by_enum.rb'
47
+ require_relative 'pepipost/models/events_enum.rb'
48
+ require_relative 'pepipost/models/sort_enum.rb'
49
+ require_relative 'pepipost/models/timeperiod_enum.rb'
50
+
51
+ # Exceptions
52
+ require_relative 'pepipost/exceptions/api_exception.rb'
53
+
54
+ require_relative 'pepipost/configuration.rb'
55
+
56
+ # Controllers
57
+ require_relative 'pepipost/controllers/base_controller.rb'
58
+ require_relative 'pepipost/controllers/mail_send_controller.rb'
59
+ require_relative 'pepipost/controllers/events_controller.rb'
60
+ require_relative 'pepipost/controllers/stats_controller.rb'
61
+ require_relative 'pepipost/controllers/subaccounts_controller.rb'
62
+ require_relative 'pepipost/controllers/subaccounts_delete_controller.rb'
63
+ require_relative 'pepipost/controllers/subaccounts_get_sub_accounts' \
64
+ '_controller.rb'
65
+ require_relative 'pepipost/controllers/setrecurringcreditddetails_controller.rb'
66
+ require_relative 'pepipost/controllers/subaccounts_setsubaccountcredit' \
67
+ '_controller.rb'
68
+ require_relative 'pepipost/controllers/subaccounts_update_subaccount' \
69
+ '_controller.rb'
70
+ require_relative 'pepipost/controllers/subaccounts_create_subaccount' \
71
+ '_controller.rb'
72
+ require_relative 'pepipost/controllers/suppression_controller.rb'
73
+ require_relative 'pepipost/controllers/domain_delete_controller.rb'
74
+ require_relative 'pepipost/controllers/domain_controller.rb'
@@ -1,7 +1,9 @@
1
- # This file was automatically generated by APIMATIC v2.0
2
- # ( https://apimatic.io ).
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
3
5
 
4
- module PepipostGem
6
+ module Pepipost
5
7
  # API utility class
6
8
  class APIHelper
7
9
  # Serializes an array parameter (creates key value pairs).
@@ -0,0 +1,24 @@
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
5
+
6
+ # CohesityManagementSdk
7
+ module Pepipost
8
+ # All configuration including auth info and base URI for the API access
9
+ # are configured in this class.
10
+ class Configuration
11
+ # The base Uri for API calls
12
+ @base_uri = 'https://api.pepipost.com/v5'
13
+
14
+ # Your Pepipost API Key. You will find the api key in the Pepipost application in Integrations.
15
+ @api_key = 'TODO: Replace'
16
+
17
+ # The attribute accessors for public properties.
18
+ class << self
19
+ attr_accessor :array_serialization
20
+ attr_accessor :base_uri
21
+ attr_accessor :api_key
22
+ end
23
+ end
24
+ end
@@ -1,7 +1,9 @@
1
- # This file was automatically generated by APIMATIC v2.0
2
- # ( https://apimatic.io ).
1
+ # pepipost
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0 (
4
+ # https://apimatic.io ).
3
5
 
4
- module PepipostGem
6
+ module Pepipost
5
7
  # Base controller.
6
8
  class BaseController
7
9
  attr_accessor :http_client, :http_call_back
@@ -42,8 +44,11 @@ module PepipostGem
42
44
  end
43
45
 
44
46
  def validate_response(context)
45
- # raise APIException.new 'HTTP Response Not OK', context unless
46
- # context.response.status_code.between?(200, 208) # [200,208] = HTTP OK
47
+ if context.response.status_code == 400 || context.response.status_code == 401 || context.response.status_code == 403
48
+ return 1
49
+ end
50
+ raise APIException.new 'HTTP Response Not OK', context unless
51
+ context.response.status_code.between?(200, 208) # [200,208] = HTTP OK
47
52
  end
48
53
  end
49
54
  end