limdesk_api 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b58d9f9d9ce153802a41c857a2c905a74b7c194
4
- data.tar.gz: 643182b25201d65cc108380e9ad2c6994307f413
3
+ metadata.gz: 800d4902fe2217aaa4c98a37c194f0266e22dbe9
4
+ data.tar.gz: ec86055042b2ee140d175d18052b30c2dc068d9d
5
5
  SHA512:
6
- metadata.gz: 4ddfa2e3a613b86c1357d92831a5bb70d5342caa6095d12c095bd021ef5e9c8211748dcf46f4e01357dbc00353d60be7b68ce9a817321d0b995e1419573aedd5
7
- data.tar.gz: 971754ad69cc5362a448bbe31d3b2d17374b2ae8a89e85a3743407b2d5e6baaa97358fb79acdb1476afc91da1d0b8db19a7793c27a9c31c64f7539e7994f07bd
6
+ metadata.gz: ebd7b5f0b7e0d13d6867af8c7693eae3d492e7c900decc69a7df58f2c5789d5601b407a458ac4dff18590127ea371aa95ecd378fba6f72494ee945cd9e16ec57
7
+ data.tar.gz: 3f0efcae518bc4fadd4014e19d86e662073f6e0f6dbdff6bc80cc9ecaac650a5ac33b0507d9452c51844a75f34d8110f586cede3152dd41461e5c9262a292c66
data/README.md CHANGED
@@ -136,12 +136,29 @@ sale2 = LimdeskApi::Sale.create client_id: 65464,
136
136
  price: 99.99,
137
137
  amount: 1,
138
138
  sold: "2014-10-20 20:00:00"
139
+ create_ticket: true
139
140
 
140
141
  sale2.client.name
141
142
  "John Smith"
142
143
 
143
144
  ```
144
145
 
146
+ #### Contact Persons
147
+
148
+ ```ruby
149
+
150
+ cp=LimdeskApi::Contactperson.create client_id: 338425,
151
+ name: "Mr Smith",
152
+ email: "ms@example.com",
153
+ phone: "123456789"
154
+
155
+ cp.update email: "ms1@example.com"
156
+
157
+ cp.refresh!
158
+
159
+ cp.delete!
160
+ ```
161
+
145
162
  ## TODO
146
163
 
147
164
  * tests
@@ -0,0 +1,33 @@
1
+ module LimdeskApi
2
+ # ContactPerson
3
+ class Contactperson < LimdeskObject
4
+ NOT_IMPLEMENTED = 'contactperson currently does not support this call'
5
+ # Creates a new contact person
6
+ #
7
+ # @param [Hash] params the options to create a contact person with
8
+ # @option params [String] :name contact person name
9
+ # @option params [String] :phone contact person phone number
10
+ # @option params [String] :email contact person email address
11
+ # @option params [Integer] :client_id client's id (parent)
12
+ #
13
+ # @return [LimdeskApi::Contactperson]
14
+ def self.create(params)
15
+ super
16
+ end
17
+
18
+ # updates a contact person
19
+ #
20
+ # @param [Hash] params new contact person data
21
+ #
22
+ # @return [LimdeskApi::Contactperson]
23
+ def update(params)
24
+ LimdeskApi.put object: object_symbol,
25
+ params: params,
26
+ id: id
27
+ end
28
+
29
+ def all
30
+ fail Activity::NOT_IMPLEMENTED
31
+ end
32
+ end
33
+ end
@@ -21,6 +21,7 @@ module LimdeskApi
21
21
  # @return [LimdeskApi::Ticket]
22
22
  # @return [LimdeskApi::Client]
23
23
  # @return [LimdeskApi::Sale]
24
+ # @return [LimdeskApi::Contactperson]
24
25
  def self.create(params)
25
26
  response = LimdeskApi.create(object: object_symbol, params: params)
26
27
  new response
@@ -47,6 +48,7 @@ module LimdeskApi
47
48
  # @return [LimdeskApi::Ticket]
48
49
  # @return [LimdeskApi::Client]
49
50
  # @return [LimdeskApi::Sale]
51
+ # @return [LimdeskApi::Contactperson]
50
52
  def refresh!
51
53
  marshal_load(self.class.get(self['id']).marshal_dump)
52
54
  end
@@ -9,7 +9,7 @@ module LimdeskApi
9
9
  # @option params [Float] :price price of one item
10
10
  # @option params [DateTime] :sold sales date
11
11
  # @option params [DateTime] :expire expiration date (time-limted services)
12
- #
12
+ # @option params [Boolean] :create_ticket create a new ticket with this sale
13
13
  # @return [LimdeskApi::Sale]
14
14
  def self.create(params)
15
15
  super
@@ -1,3 +1,3 @@
1
1
  module LimdeskApi
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/lib/limdesk_api.rb CHANGED
@@ -8,6 +8,7 @@ require 'limdesk_api/client'
8
8
  require 'limdesk_api/activity'
9
9
  require 'limdesk_api/ticket'
10
10
  require 'limdesk_api/sale'
11
+ require 'limdesk_api/contactperson'
11
12
 
12
13
  # LideskAPI Warapper
13
14
  # Limdesk.com is a multichannel, web-based customer support solution.
@@ -20,7 +21,8 @@ module LimdeskApi
20
21
  ticket: :tickets,
21
22
  activity: :activities,
22
23
  client: :clients,
23
- sale: :sales
24
+ sale: :sales,
25
+ contactperson: :contactpersons
24
26
  }
25
27
 
26
28
  # @example configure API access
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limdesk_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Siehień
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,6 +134,7 @@ files:
134
134
  - lib/limdesk_api.rb
135
135
  - lib/limdesk_api/activity.rb
136
136
  - lib/limdesk_api/client.rb
137
+ - lib/limdesk_api/contactperson.rb
137
138
  - lib/limdesk_api/limdesk_object.rb
138
139
  - lib/limdesk_api/sale.rb
139
140
  - lib/limdesk_api/ticket.rb