landslider 0.5.24 → 0.5.26
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.
- data/VERSION.yml +1 -1
- data/landslider.gemspec +5 -2
- data/lib/landslider/entities/ws_account_contact_search.rb +23 -0
- data/lib/landslider/entities.rb +1 -0
- data/lib/landslider.rb +23 -23
- data/test/get_accounts_test.rb +2 -2
- data/test/ws_account_contact_search_test.rb +29 -0
- data/test/ws_search_test.rb +3 -3
- metadata +5 -2
data/VERSION.yml
CHANGED
data/landslider.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{landslider}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.26"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jay Prall"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-10-11}
|
13
13
|
s.description = %q{Landslider is a ruby interface to the Landslide SOAP-based API}
|
14
14
|
s.email = %q{jay@j4y.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
"lib/landslider.rb",
|
30
30
|
"lib/landslider/entities.rb",
|
31
31
|
"lib/landslider/entities/ws_account.rb",
|
32
|
+
"lib/landslider/entities/ws_account_contact_search.rb",
|
32
33
|
"lib/landslider/entities/ws_account_note.rb",
|
33
34
|
"lib/landslider/entities/ws_account_note_search.rb",
|
34
35
|
"lib/landslider/entities/ws_account_search.rb",
|
@@ -72,6 +73,7 @@ Gem::Specification.new do |s|
|
|
72
73
|
"test/landslider_test.rb",
|
73
74
|
"test/run_mylist_by_id_test.rb",
|
74
75
|
"test/test_helper.rb",
|
76
|
+
"test/ws_account_contact_search_test.rb",
|
75
77
|
"test/ws_account_note_search_test.rb",
|
76
78
|
"test/ws_contact_note_search_test.rb",
|
77
79
|
"test/ws_lead_note_search_test.rb",
|
@@ -90,6 +92,7 @@ Gem::Specification.new do |s|
|
|
90
92
|
"test/landslider_test.rb",
|
91
93
|
"test/run_mylist_by_id_test.rb",
|
92
94
|
"test/test_helper.rb",
|
95
|
+
"test/ws_account_contact_search_test.rb",
|
93
96
|
"test/ws_account_note_search_test.rb",
|
94
97
|
"test/ws_contact_note_search_test.rb",
|
95
98
|
"test/ws_lead_note_search_test.rb",
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Landslider
|
2
|
+
|
3
|
+
class WsAccountContactSearch < WsSearch
|
4
|
+
|
5
|
+
# @return [Integer]
|
6
|
+
attr_reader :account_id
|
7
|
+
|
8
|
+
# @param [Integer] account_id an account id
|
9
|
+
def initialize(account_id)
|
10
|
+
@account_id = account_id
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [Handsoap::XmlMason::Node] msg
|
14
|
+
# @return [Handsoap::XmlMason::Node]
|
15
|
+
def soapify_for(msg)
|
16
|
+
msg.add('accountContactSearch') { |crit|
|
17
|
+
crit.add 'accountId', @account_id
|
18
|
+
super(crit)
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/lib/landslider/entities.rb
CHANGED
@@ -7,6 +7,7 @@ require 'landslider/entities/ws_search_criterion'
|
|
7
7
|
require 'landslider/entities/ws_search_operator'
|
8
8
|
|
9
9
|
require 'landslider/entities/ws_account'
|
10
|
+
require 'landslider/entities/ws_account_contact_search'
|
10
11
|
require 'landslider/entities/ws_account_note'
|
11
12
|
require 'landslider/entities/ws_account_note_search'
|
12
13
|
require 'landslider/entities/ws_address'
|
data/lib/landslider.rb
CHANGED
@@ -41,7 +41,7 @@ class Landslider < Handsoap::Service
|
|
41
41
|
# @return [Hash]
|
42
42
|
def login(session_id)
|
43
43
|
self.session_id = session_id
|
44
|
-
response = invoke('login', :soap_action => :none) do |message|
|
44
|
+
response = invoke('urn:login', :soap_action => :none) do |message|
|
45
45
|
message.add('wsUser') { |u|
|
46
46
|
u.add 'username', ::LS_API_USERNAME
|
47
47
|
u.add 'password', ::LS_API_KEY
|
@@ -57,7 +57,7 @@ class Landslider < Handsoap::Service
|
|
57
57
|
# @return [Hash]
|
58
58
|
def get_accounts(session_id, search=WsSearch.new)
|
59
59
|
self.session_id = session_id
|
60
|
-
response = invoke('getAccounts', :soap_action => :none) do |message|
|
60
|
+
response = invoke('urn:getAccounts', :soap_action => :none) do |message|
|
61
61
|
message.add('accountsRequest') { |req|
|
62
62
|
search.soapify_for(req)
|
63
63
|
}
|
@@ -73,7 +73,7 @@ class Landslider < Handsoap::Service
|
|
73
73
|
def get_account_by_id(session_id, account_id)
|
74
74
|
self.session_id = session_id
|
75
75
|
|
76
|
-
response = invoke('getAccountById', :soap_action => :none) do |message|
|
76
|
+
response = invoke('urn:getAccountById', :soap_action => :none) do |message|
|
77
77
|
message.add 'accountId', account_id
|
78
78
|
end
|
79
79
|
|
@@ -87,7 +87,7 @@ class Landslider < Handsoap::Service
|
|
87
87
|
# @return [Hash]
|
88
88
|
def get_account_contacts(session_id, account_id, is_primary=false)
|
89
89
|
self.session_id = session_id
|
90
|
-
response = invoke('getAccountContacts', :soap_action => :none) do |message|
|
90
|
+
response = invoke('urn:getAccountContacts', :soap_action => :none) do |message|
|
91
91
|
message.add 'accountId', account_id
|
92
92
|
message.add 'isPrimary', is_primary
|
93
93
|
end
|
@@ -99,7 +99,7 @@ class Landslider < Handsoap::Service
|
|
99
99
|
# @param [String] session_id
|
100
100
|
# @return [Hash]
|
101
101
|
def get_account_custom_fields(session_id)
|
102
|
-
response = invoke('getAccountCustomFields')
|
102
|
+
response = invoke('urn:getAccountCustomFields')
|
103
103
|
node = response.document.xpath('//ns:getAccountCustomFieldsResponse', ns)
|
104
104
|
parse_get_entity_custom_fields_result(node)
|
105
105
|
end
|
@@ -110,7 +110,7 @@ class Landslider < Handsoap::Service
|
|
110
110
|
def get_account_notes(session_id, search)
|
111
111
|
self.session_id = session_id
|
112
112
|
|
113
|
-
response = invoke('getAccountNotes', :soap_action => :none) do |message|
|
113
|
+
response = invoke('urn:getAccountNotes', :soap_action => :none) do |message|
|
114
114
|
search.soapify_for(message)
|
115
115
|
end
|
116
116
|
node = response.document.xpath('//ns:getAccountNotesResponse', ns)
|
@@ -121,7 +121,7 @@ class Landslider < Handsoap::Service
|
|
121
121
|
# @return [Hash]
|
122
122
|
def get_account_opportunities(session_id, account_id)
|
123
123
|
self.session_id = session_id
|
124
|
-
response = invoke('getAccountOpportunities', :soap_action => :none) do |message|
|
124
|
+
response = invoke('urn:getAccountOpportunities', :soap_action => :none) do |message|
|
125
125
|
message.add 'accountId', account_id
|
126
126
|
end
|
127
127
|
|
@@ -133,7 +133,7 @@ class Landslider < Handsoap::Service
|
|
133
133
|
# @return [Hash]
|
134
134
|
def get_account_types(session_id)
|
135
135
|
self.session_id = session_id
|
136
|
-
response = invoke('getAccountTypes')
|
136
|
+
response = invoke('urn:getAccountTypes')
|
137
137
|
|
138
138
|
node = response.document.xpath('//ns:getAccountTypesResponse', ns)
|
139
139
|
parse_get_account_types_result(node)
|
@@ -144,7 +144,7 @@ class Landslider < Handsoap::Service
|
|
144
144
|
def get_api_version(session_id)
|
145
145
|
self.session_id = session_id
|
146
146
|
|
147
|
-
response = invoke('getApiVersion', :soap_action => :none)
|
147
|
+
response = invoke('urn:getApiVersion', :soap_action => :none)
|
148
148
|
|
149
149
|
node = response.document.xpath('//ns:getApiVersionResponse', ns)
|
150
150
|
parse_api_version_result(node)
|
@@ -156,7 +156,7 @@ class Landslider < Handsoap::Service
|
|
156
156
|
def get_contact_by_id(session_id, contact_id)
|
157
157
|
self.session_id = session_id
|
158
158
|
|
159
|
-
response = invoke('getContactById', :soap_action => :none) do |message|
|
159
|
+
response = invoke('urn:getContactById', :soap_action => :none) do |message|
|
160
160
|
message.add 'contactId', contact_id
|
161
161
|
end
|
162
162
|
|
@@ -171,7 +171,7 @@ class Landslider < Handsoap::Service
|
|
171
171
|
self.session_id = session_id
|
172
172
|
|
173
173
|
# public WsContactResultSet getContacts(WsContactSearch request)
|
174
|
-
response = invoke('getContacts', :soap_action => :none) do |message|
|
174
|
+
response = invoke('urn:getContacts', :soap_action => :none) do |message|
|
175
175
|
message.add('contactsRequest') { |req|
|
176
176
|
search.soapify_for(req)
|
177
177
|
}
|
@@ -185,7 +185,7 @@ class Landslider < Handsoap::Service
|
|
185
185
|
def get_contact_custom_fields(session_id)
|
186
186
|
self.session_id = session_id
|
187
187
|
|
188
|
-
response = invoke('getContactCustomFields')
|
188
|
+
response = invoke('urn:getContactCustomFields')
|
189
189
|
node = response.document.xpath('//ns:getContactCustomFieldsResponse', ns)
|
190
190
|
parse_get_entity_custom_fields_result(node)
|
191
191
|
end
|
@@ -196,7 +196,7 @@ class Landslider < Handsoap::Service
|
|
196
196
|
def get_contact_notes(session_id, search)
|
197
197
|
self.session_id = session_id
|
198
198
|
|
199
|
-
response = invoke('getContactNotes', :soap_action => :none) do |message|
|
199
|
+
response = invoke('urn:getContactNotes', :soap_action => :none) do |message|
|
200
200
|
search.soapify_for(message)
|
201
201
|
end
|
202
202
|
node = response.document.xpath('//ns:getContactNotesResponse', ns)
|
@@ -210,7 +210,7 @@ class Landslider < Handsoap::Service
|
|
210
210
|
def get_instance_information(session_id, user_id)
|
211
211
|
self.session_id = session_id
|
212
212
|
|
213
|
-
response = invoke('getInstanceInformation', :soap_action => :none) do |message|
|
213
|
+
response = invoke('urn:getInstanceInformation', :soap_action => :none) do |message|
|
214
214
|
message.add 'userId', user_id
|
215
215
|
end
|
216
216
|
node = response.document.xpath('//ns:getInstanceInformationResponse', ns)
|
@@ -223,7 +223,7 @@ class Landslider < Handsoap::Service
|
|
223
223
|
def get_leads(session_id, search=WsLeadSearch.new)
|
224
224
|
self.session_id = session_id
|
225
225
|
|
226
|
-
response = invoke('getLeads', :soap_action => :none) do |message|
|
226
|
+
response = invoke('urn:getLeads', :soap_action => :none) do |message|
|
227
227
|
message.add('leadRequest') { |req|
|
228
228
|
search.soapify_for(req)
|
229
229
|
}
|
@@ -236,7 +236,7 @@ class Landslider < Handsoap::Service
|
|
236
236
|
# @param [String] session_id
|
237
237
|
# @return [Hash]
|
238
238
|
def get_lead_custom_fields(session_id)
|
239
|
-
response = invoke('getLeadCustomFields')
|
239
|
+
response = invoke('urn:getLeadCustomFields')
|
240
240
|
node = response.document.xpath('//ns:getLeadCustomFieldsResponse', ns)
|
241
241
|
parse_get_entity_custom_fields_result(node)
|
242
242
|
end
|
@@ -247,7 +247,7 @@ class Landslider < Handsoap::Service
|
|
247
247
|
def get_lead_notes(session_id, search)
|
248
248
|
self.session_id = session_id
|
249
249
|
|
250
|
-
response = invoke('getLeadNotes', :soap_action => :none) do |message|
|
250
|
+
response = invoke('urn:getLeadNotes', :soap_action => :none) do |message|
|
251
251
|
search.soapify_for(message)
|
252
252
|
end
|
253
253
|
node = response.document.xpath('//ns:getLeadNotesResponse', ns)
|
@@ -260,7 +260,7 @@ class Landslider < Handsoap::Service
|
|
260
260
|
def get_opportunities(session_id, search=WsSearch.new)
|
261
261
|
self.session_id = session_id
|
262
262
|
|
263
|
-
response = invoke('getOpportunities', :soap_action => :none) do |message|
|
263
|
+
response = invoke('urn:getOpportunities', :soap_action => :none) do |message|
|
264
264
|
message.add('opportunityRequest') { |req|
|
265
265
|
search.soapify_for(req)
|
266
266
|
}
|
@@ -274,7 +274,7 @@ class Landslider < Handsoap::Service
|
|
274
274
|
def get_opportunity_custom_fields(session_id)
|
275
275
|
self.session_id = session_id
|
276
276
|
|
277
|
-
response = invoke('getOpportunityCustomFields')
|
277
|
+
response = invoke('urn:getOpportunityCustomFields')
|
278
278
|
node = response.document.xpath('//ns:getOpportunityCustomFieldsResponse', ns)
|
279
279
|
parse_get_entity_custom_fields_result(node)
|
280
280
|
end
|
@@ -285,7 +285,7 @@ class Landslider < Handsoap::Service
|
|
285
285
|
def get_opportunity_notes(session_id, search)
|
286
286
|
self.session_id = session_id
|
287
287
|
|
288
|
-
response = invoke('getOpportunityNotes', :soap_action => :none) do |message|
|
288
|
+
response = invoke('urn:getOpportunityNotes', :soap_action => :none) do |message|
|
289
289
|
search.soapify_for(message)
|
290
290
|
end
|
291
291
|
node = response.document.xpath('//ns:getOpportunityNotesResponse', ns)
|
@@ -298,7 +298,7 @@ class Landslider < Handsoap::Service
|
|
298
298
|
def get_user_information(session_id, user_id)
|
299
299
|
|
300
300
|
self.session_id = session_id
|
301
|
-
response = invoke('getUserInformation', :soap_action => :none) do |message|
|
301
|
+
response = invoke('urn:getUserInformation', :soap_action => :none) do |message|
|
302
302
|
message.add 'userId', user_id
|
303
303
|
end
|
304
304
|
node = response.document.xpath('//ns:getUserInformationResponse', ns)
|
@@ -311,7 +311,7 @@ class Landslider < Handsoap::Service
|
|
311
311
|
def get_user_information_by_id(session_id, user_id)
|
312
312
|
self.session_id = session_id
|
313
313
|
|
314
|
-
response = invoke('getUserInformationById', :soap_action => :none) do |message|
|
314
|
+
response = invoke('urn:getUserInformationById', :soap_action => :none) do |message|
|
315
315
|
message.add 'userId', user_id
|
316
316
|
end
|
317
317
|
node = response.document.xpath('//ns:getUserInformationByIdResponse', ns)
|
@@ -324,7 +324,7 @@ class Landslider < Handsoap::Service
|
|
324
324
|
def run_mylist_by_id(session_id, mylist_id)
|
325
325
|
self.session_id = session_id
|
326
326
|
|
327
|
-
response = invoke('runMyListbyId', :soap_action => :none) do |message|
|
327
|
+
response = invoke('urn:runMyListbyId', :soap_action => :none) do |message|
|
328
328
|
message.add 'myListId', mylist_id
|
329
329
|
end
|
330
330
|
node = response.document.xpath('//ns:runMyListbyIdResponse', ns)
|
data/test/get_accounts_test.rb
CHANGED
@@ -16,7 +16,7 @@ class GetAccountsTest < Test::Unit::TestCase
|
|
16
16
|
assert_not_nil result
|
17
17
|
assert_equal false, result[:error]
|
18
18
|
assert_kind_of Array, result[:accounts]
|
19
|
-
assert_equal
|
19
|
+
assert_equal 12, result[:accounts].size
|
20
20
|
|
21
21
|
end
|
22
22
|
|
@@ -40,7 +40,7 @@ class GetAccountsTest < Test::Unit::TestCase
|
|
40
40
|
assert_not_nil result
|
41
41
|
assert_equal false, result[:error]
|
42
42
|
assert_kind_of Array, result[:accounts]
|
43
|
-
assert_equal
|
43
|
+
assert_equal 3, result[:accounts].size
|
44
44
|
assert result[:accounts].all? { |a| a[:account_type_id] == 1539484}, "account type id should match search crit"
|
45
45
|
|
46
46
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
class WsAccountContactSearchTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
Landslider.logger = $stdout
|
8
|
+
$sess4 ||= Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)[:session_id]
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_ws_account_contact_search
|
12
|
+
search = Landslider::WsAccountContactSearch.new(55647822)
|
13
|
+
|
14
|
+
result = Landslider.get_account_contacts($sess4, search)
|
15
|
+
|
16
|
+
assert_equal false, result[:error]
|
17
|
+
# assert_equal 2, result[:results_returned]
|
18
|
+
end
|
19
|
+
|
20
|
+
# def test_contact_note_search_limit_by_results_requested
|
21
|
+
# search = Landslider::WsContactNoteSearch.new(62813411)
|
22
|
+
# search.total_results_requested = 1
|
23
|
+
# result = Landslider.get_contact_notes($sid4, search)
|
24
|
+
#
|
25
|
+
# assert_equal false, result[:error]
|
26
|
+
# assert_equal 1, result[:results_returned]
|
27
|
+
# end
|
28
|
+
|
29
|
+
end
|
data/test/ws_search_test.rb
CHANGED
@@ -19,7 +19,7 @@ class WsSearchTest < Test::Unit::TestCase
|
|
19
19
|
result = Landslider.get_accounts($sid2)
|
20
20
|
|
21
21
|
assert_equal false, result[:error]
|
22
|
-
assert_equal
|
22
|
+
assert_equal 12, result[:results_returned]
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_get_accounts_with_search_criteria
|
@@ -46,7 +46,7 @@ class WsSearchTest < Test::Unit::TestCase
|
|
46
46
|
result = Landslider.get_opportunities($sid2)
|
47
47
|
|
48
48
|
assert_equal false, result[:error]
|
49
|
-
assert_equal
|
49
|
+
assert_equal 7, result[:results_returned]
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_get_opportunities_with_search_criteria
|
@@ -56,7 +56,7 @@ class WsSearchTest < Test::Unit::TestCase
|
|
56
56
|
result = Landslider.get_opportunities($sid2, search)
|
57
57
|
|
58
58
|
assert_equal false, result[:error]
|
59
|
-
assert_equal
|
59
|
+
assert_equal 6, result[:results_returned]
|
60
60
|
assert_equal target_phase_name, result[:opportunities][0][:current_phase_name]
|
61
61
|
assert_equal target_phase_name, result[:opportunities][1][:current_phase_name]
|
62
62
|
assert_equal target_phase_name, result[:opportunities][2][:current_phase_name]
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: landslider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.26
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jay Prall
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-10-11 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- lib/landslider.rb
|
91
91
|
- lib/landslider/entities.rb
|
92
92
|
- lib/landslider/entities/ws_account.rb
|
93
|
+
- lib/landslider/entities/ws_account_contact_search.rb
|
93
94
|
- lib/landslider/entities/ws_account_note.rb
|
94
95
|
- lib/landslider/entities/ws_account_note_search.rb
|
95
96
|
- lib/landslider/entities/ws_account_search.rb
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- test/landslider_test.rb
|
134
135
|
- test/run_mylist_by_id_test.rb
|
135
136
|
- test/test_helper.rb
|
137
|
+
- test/ws_account_contact_search_test.rb
|
136
138
|
- test/ws_account_note_search_test.rb
|
137
139
|
- test/ws_contact_note_search_test.rb
|
138
140
|
- test/ws_lead_note_search_test.rb
|
@@ -173,6 +175,7 @@ test_files:
|
|
173
175
|
- test/landslider_test.rb
|
174
176
|
- test/run_mylist_by_id_test.rb
|
175
177
|
- test/test_helper.rb
|
178
|
+
- test/ws_account_contact_search_test.rb
|
176
179
|
- test/ws_account_note_search_test.rb
|
177
180
|
- test/ws_contact_note_search_test.rb
|
178
181
|
- test/ws_lead_note_search_test.rb
|