teamleader 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGQyMTAwMDhlN2Y2YmMzYzZlNmQwOTBlNzhjYzgxZTBmZmY1MDc5Yw==
4
+ YTRiMTIxOTIwNTY4MjQ4NjQ3Mzc3MTQwZTY5NjFmZmMyNmVjZjExNg==
5
5
  data.tar.gz: !binary |-
6
- OGI5YjhhZDU2OThkOTI2MjU5ODkyNmMyMzgyOWIxMjdkYmY5YmQ5Ng==
6
+ ZjUyNDlmZjk5MmFjMDY0OTYzODEwNDhjODFjNzNkNTE4OWUxMjNlNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjhjNjg3Mzk0YTQwZGRlNTBkNjQ4NzAzYmViZTgxMWI4ODZiZDQ4MDJlMGEz
10
- NWFiYjYwMWVkYWZhM2M1ZWZiMmJlZDAwZDliMDMxMzljYzYwM2I3ZTE0NDNm
11
- MGU2ODgxZjU1YTVlYWI0NDc2MDRlNDczMzcwMzRmM2U5YzI5Yjg=
9
+ MWE3NDk2MmUyYzljZGVhOTA0YTNkOTZjZjM1MjFjYWY0NTFlY2NiODhlNzM2
10
+ YTM1YTkxNjM5Mjg5YTgyMDMwMTgzZWE2ZTVhNjQ5YWI0YTA2ZTQyNmRiZDAy
11
+ YWM3MTczNDkwMjhkM2I1MjVjZTBhNGQ5ODRhMTI5YTM3NDc4NGY=
12
12
  data.tar.gz: !binary |-
13
- YWI1MTcxNDk2NDZkYjkwNGE5M2VjMmY3ODFkYTUwNWRiYWFjN2U5NmI2ZWM0
14
- NmUyNTJkNmU4ZDViODk5MWIyNWRjZTgyZTZiZTQ2YmJmNGVkZGNhYjFlNzRm
15
- YzQ3NTllZjY5MGRiNTc5YWUyYTA4OWMzNGI2MWNkOTc5Y2VmMjg=
13
+ YzNjZDA1ODY5NGM1ZWZhMmQ3OGQ5ZWJhZDM0MTA3ODUxNmRmOTMyNGQyMjNj
14
+ ZjJkOGFhMzhiOWJiNjE1ODRiZGIxZWIzMDk0NGVjZDlhMTFjMjUwN2ViMzg0
15
+ ZTBmYmFmYWNlZjYwM2I5NGRmY2JiYTIzMWZmYWY2YTVjN2Y2ZDA=
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.5.0] - 2017-10-16
5
+ ### Added
6
+ - Add methods for manipulating Tickets
7
+
4
8
  ## [0.4.0] - 2017-09-28
5
9
  ### Added
6
10
  - Add support for getting bookkeeping accounts (cfr `get_bookkeeping_accounts` method)
data/README.md CHANGED
@@ -94,7 +94,9 @@ teamleader.get_product({:product_id => 123})
94
94
  teamleader.delete_product({:product_id => 123})
95
95
  teamleader.get_products({:amount => 100, :pageno => 0}) # Pagination starts at 0
96
96
  ```
97
+ ### Tickets
97
98
 
99
+ Supported methods are: `add_ticket`, `update_ticket`, `add_ticket_message`, `get_tickets`, `get_ticket`, `get_ticket_messages`, `get_ticket_message`, `get_ticket_cloud_url`.
98
100
 
99
101
  ## License
100
102
  The Teamleader GEM is released under the MIT License.
@@ -155,6 +155,51 @@ module Teamleader
155
155
  request "/getProducts.php", params
156
156
  end
157
157
 
158
+ def add_ticket(params={})
159
+ raise "client_email is required" if params[:client_email].nil?
160
+ raise "client_name is required" if params[:client_name].nil?
161
+ raise "subject is required" if params[:subject].nil?
162
+ request "/addTicket.php", params
163
+ end
164
+
165
+ def update_ticket(params={})
166
+ raise "ticket_id is required" if params[:ticket_id].nil?
167
+ request "/updateTicket.php", params
168
+ end
169
+
170
+ def add_ticket_message(params={})
171
+ raise "ticket_id is required" if params[:ticket_id].nil?
172
+ raise "message is required" if params[:message].nil?
173
+ request "/addTicketMessage.php", params
174
+ end
175
+
176
+ def get_tickets(params={})
177
+ raise "type is required" if params[:type].nil?
178
+ request "/getTickets.php", params
179
+ end
180
+
181
+ def get_ticket(params={})
182
+ raise "ticket_id is required" if params[:ticket_id].nil?
183
+ request "/getTickets.php", params
184
+ end
185
+
186
+ def get_ticket_messages(params={})
187
+ raise "ticket_id is required" if params[:ticket_id].nil?
188
+ raise "include_internal_message is required" if params[:include_internal_message].nil?
189
+ raise "include_third_party_message is required" if params[:include_third_party_message].nil?
190
+ request "/getTicketMessages.php", params
191
+ end
192
+
193
+ def get_ticket_message(params={})
194
+ raise "message_id is required" if params[:message_id].nil?
195
+ request "/getTicketMessage.php", params
196
+ end
197
+
198
+ def get_ticket_cloud_url(params={})
199
+ raise "ticket_id is required" if params[:ticket_id].nil?
200
+ request "/getTicketCloudURL.php", params
201
+ end
202
+
158
203
  private
159
204
  def request(path, data={})
160
205
  headers = {
@@ -1,3 +1,3 @@
1
1
  module Teamleader
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamleader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Yves Orban
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-28 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler