landslider 0.5.7 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG.markdown → HISTORY.md} +4 -0
- data/README.md +108 -0
- data/VERSION.yml +1 -1
- data/bin/generate_api_key.rb +1 -1
- data/landslider.gemspec +41 -5
- data/lib/landslider/entities/ws_account.rb +32 -0
- data/lib/landslider/entities/ws_account_note.rb +13 -0
- data/lib/landslider/entities/ws_account_note_search.rb +23 -0
- data/lib/landslider/entities/ws_address.rb +17 -0
- data/lib/landslider/entities/ws_contact.rb +38 -0
- data/lib/landslider/entities/ws_contact_note.rb +13 -0
- data/lib/landslider/entities/ws_contact_note_search.rb +23 -0
- data/lib/landslider/entities/ws_contact_search.rb +28 -0
- data/lib/landslider/entities/ws_employee.rb +23 -0
- data/lib/landslider/entities/ws_entity.rb +15 -0
- data/lib/landslider/entities/ws_lead.rb +35 -0
- data/lib/landslider/entities/ws_lead_contact.rb +14 -0
- data/lib/landslider/entities/ws_lead_note.rb +14 -0
- data/lib/landslider/entities/ws_lead_note_search.rb +24 -0
- data/lib/landslider/entities/ws_lead_search.rb +31 -0
- data/lib/landslider/entities/ws_my_list.rb +20 -0
- data/lib/landslider/entities/ws_note.rb +21 -0
- data/lib/landslider/entities/ws_opportunity.rb +38 -0
- data/lib/landslider/entities/ws_opportunity_note.rb +13 -0
- data/lib/landslider/entities/ws_opportunity_note_search.rb +23 -0
- data/lib/landslider/entities/ws_opportunity_status.rb +17 -0
- data/lib/landslider/entities/ws_payment_term.rb +17 -0
- data/lib/landslider/entities/ws_pick_list_item.rb +14 -0
- data/lib/landslider/entities/ws_primary_entity.rb +11 -0
- data/lib/landslider/entities/ws_product.rb +35 -0
- data/lib/landslider/entities/ws_product_family.rb +17 -0
- data/lib/landslider/entities/ws_product_result.rb +12 -0
- data/lib/landslider/entities/ws_record_upsert_result.rb +13 -0
- data/lib/landslider/entities/ws_result.rb +16 -0
- data/lib/landslider/entities/ws_search.rb +55 -0
- data/lib/landslider/entities/ws_search_criterion.rb +121 -0
- data/lib/landslider/entities/ws_search_operator.rb +59 -0
- data/lib/landslider/entities/ws_selling_process.rb +17 -0
- data/lib/landslider/entities/ws_user.rb +10 -0
- data/lib/landslider/entities/ws_user_search.rb +20 -0
- data/lib/landslider/entities.rb +46 -0
- data/lib/landslider.rb +71 -116
- data/test/ws_search_test.rb +13 -0
- metadata +41 -5
- data/README.rdoc +0 -77
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
class Landslider
|
3
|
+
|
4
|
+
class WsOpportunityStatus < WsEntity
|
5
|
+
|
6
|
+
# @return [Integer]
|
7
|
+
attr_reader :opportunity_status_id
|
8
|
+
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :opportunity_status
|
11
|
+
|
12
|
+
# @return [WsOpportunityStatus]
|
13
|
+
attr_reader :parent_opportunity_status
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Landslider
|
2
|
+
|
3
|
+
class WsProduct < WsEntity
|
4
|
+
|
5
|
+
# @return [Integer]
|
6
|
+
attr_reader :product_id
|
7
|
+
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :product_name, :source_id, :description_text, :product_code
|
10
|
+
|
11
|
+
# @return [Integer]
|
12
|
+
attr_reader :create_by, :update_by
|
13
|
+
|
14
|
+
# @return [Date]
|
15
|
+
attr_reader :created_on, :updated_on
|
16
|
+
|
17
|
+
# @return [WsDurationType]
|
18
|
+
attr_reader :duration_type
|
19
|
+
|
20
|
+
# @return [WsProduct]
|
21
|
+
attr_reader :parent_product
|
22
|
+
|
23
|
+
# @return [WsProductFamily]
|
24
|
+
attr_reader :product_family
|
25
|
+
|
26
|
+
# @param [Handsoap::XmlMason::Node] msg
|
27
|
+
# @return [Handsoap::XmlMason::Node]
|
28
|
+
def soapify_for(msg)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
class Landslider
|
3
|
+
|
4
|
+
class WsProductFamily < WsEntity
|
5
|
+
|
6
|
+
# @return [Integer]
|
7
|
+
attr_reader :product_family_id, :parent_product_family_id
|
8
|
+
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :product_family, :description, :parent_product_family
|
11
|
+
|
12
|
+
# @return [Date]
|
13
|
+
attr_reader :archived_on
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
|
2
|
+
class Landslider
|
3
|
+
|
4
|
+
class WsSearch
|
5
|
+
|
6
|
+
# @param [Hash] params
|
7
|
+
# An optional Hash to specify first_result_position and total_results_requested
|
8
|
+
def initialize(params={})
|
9
|
+
@first_result_position = params.fetch(:first_result_position) if params.key?(:first_result_position)
|
10
|
+
@total_results_requested = params.fetch(:total_results_requested) if params.key?(:total_results_requested)
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [Integer] value num
|
14
|
+
# Sets the starting index of records you want to retrieve. defaults to 1
|
15
|
+
attr_writer :first_result_position
|
16
|
+
|
17
|
+
# @param [Integer] value num
|
18
|
+
# Sets the maximum number of records to retrieve. defaults to 25
|
19
|
+
attr_writer :total_results_requested
|
20
|
+
|
21
|
+
# @param [String] value date
|
22
|
+
# Sets a Date to search records updated on or after
|
23
|
+
attr_writer :updated_on
|
24
|
+
|
25
|
+
# @param [String] value
|
26
|
+
# system source id search?
|
27
|
+
attr_writer :source_id
|
28
|
+
|
29
|
+
# @param [Boolean] value
|
30
|
+
attr_writer :return_deleted_records, :allow_duplicate_criterion
|
31
|
+
|
32
|
+
# @param [WsSearchCriterion] value
|
33
|
+
# WsSearchCriterion is only documented to work with these APIs
|
34
|
+
# * getAccounts
|
35
|
+
# * getOpportunities
|
36
|
+
# * getProductFamilies
|
37
|
+
# * GetDurationTypes
|
38
|
+
attr_writer :search_criteria
|
39
|
+
|
40
|
+
# Adds the search xml
|
41
|
+
# @param [Handsoap::XmlMason::Node] msg
|
42
|
+
# @return [Handsoap::XmlMason::Node]
|
43
|
+
def soapify_for(msg)
|
44
|
+
msg.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
|
45
|
+
msg.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
|
46
|
+
msg.add 'updatedOn', @updated_on unless @updated_on.nil?
|
47
|
+
unless @search_criteria.nil?
|
48
|
+
@search_criteria.soapify_for(msg)
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
class Landslider
|
2
|
+
|
3
|
+
class WsSearchCriterion
|
4
|
+
|
5
|
+
# @return [String]
|
6
|
+
attr_reader :field_id, :operator
|
7
|
+
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :query_value
|
10
|
+
|
11
|
+
# @param [String] field_id
|
12
|
+
#
|
13
|
+
# Currently Searchable Account Fields:
|
14
|
+
# * AccountId
|
15
|
+
# * AccountName
|
16
|
+
# * AccountNumber
|
17
|
+
# * AccountShortName
|
18
|
+
# * AccountType
|
19
|
+
# * AccountTypeId
|
20
|
+
# * ArchivedOn
|
21
|
+
# * BillingAddressCity
|
22
|
+
# * BillingAddressCountry
|
23
|
+
# * BillingAddressState
|
24
|
+
# * BillingAddressStreet
|
25
|
+
# * BillingAddressZip
|
26
|
+
# * CreatedById
|
27
|
+
# * CreatedDate
|
28
|
+
# * Division
|
29
|
+
# * Fax
|
30
|
+
# * LastUpdatedById
|
31
|
+
# * LastUpdatedDate
|
32
|
+
# * MainAddressCity
|
33
|
+
# * MainAddressCountry
|
34
|
+
# * MainAddressState
|
35
|
+
# * MainAddressStreet
|
36
|
+
# * MainAddressZip
|
37
|
+
# * NewsKeywords
|
38
|
+
# * OwnerId
|
39
|
+
# * ParentAccount
|
40
|
+
# * ParentAccountId
|
41
|
+
# * Phone
|
42
|
+
# * PrimaryContactId,
|
43
|
+
# * QuickbooksLastSynced
|
44
|
+
# * ShippingAddressCity
|
45
|
+
# * ShippingAddressCountry
|
46
|
+
# * ShippingAddressState
|
47
|
+
# * ShippingAddressStreet
|
48
|
+
# * ShippingAddressZip
|
49
|
+
# * SourceSystemId
|
50
|
+
# * SyncWithQuickBooks
|
51
|
+
# * Ticker
|
52
|
+
# * Url
|
53
|
+
#
|
54
|
+
# Currently Searchable Opportunity Fields:
|
55
|
+
# * AccountId
|
56
|
+
# * AccountName
|
57
|
+
# * ArchivedOn, ClosedDate
|
58
|
+
# * ComputedConfidence
|
59
|
+
# * ComputedForecastDate
|
60
|
+
# * CreatedById
|
61
|
+
# * CreatedDate
|
62
|
+
# * CurrentPhaseId
|
63
|
+
# * CurrentPhaseName
|
64
|
+
# * DealValue
|
65
|
+
# * Description
|
66
|
+
# * IsHot
|
67
|
+
# * LastUpdatedById,
|
68
|
+
# * LastUpdatedDate
|
69
|
+
# * LeadSource
|
70
|
+
# * LeadSourceId
|
71
|
+
# * Name, OpportunityId
|
72
|
+
# * OverriddenConfidence
|
73
|
+
# * OverriddenForecastDate
|
74
|
+
# * OverrideComments
|
75
|
+
# * OwnerId
|
76
|
+
# * PaymentTerms
|
77
|
+
# * PaymentTermsId
|
78
|
+
# * QuickbooksLastSyncedQuickbooksTransactionType
|
79
|
+
# * SellingProcess
|
80
|
+
# * SellingProcessId
|
81
|
+
# * SourceSystemId
|
82
|
+
# * StartDate
|
83
|
+
# * Status
|
84
|
+
# * StatusId
|
85
|
+
# * StatusReason
|
86
|
+
# * StatusReasonId
|
87
|
+
# * SuspendedDate
|
88
|
+
#
|
89
|
+
# Currently Searchable Duration Type Fields:
|
90
|
+
# * DurationType
|
91
|
+
# * DurationTypeId
|
92
|
+
#
|
93
|
+
# Currently Searchable Product Family Fields:
|
94
|
+
# * Description
|
95
|
+
# * ParentProductFamily
|
96
|
+
# * ParentProductFamilyId
|
97
|
+
# * ProductFamily
|
98
|
+
# * ProductFamilyId
|
99
|
+
# @param [String, WsSearchOperator] operator Contains,SoundsLike,Equals,NotEquals
|
100
|
+
# LessThan,LessThanOrEqual,GreaterThan,GreaterThanOrEqual
|
101
|
+
# Empty,NotEmpty,True,False,In,NotIn
|
102
|
+
# @param [String, WsSearchOperator] query_value string to search for
|
103
|
+
def initialize(field_id, operator, query_value)
|
104
|
+
@field_id = field_id
|
105
|
+
@operator = operator
|
106
|
+
@query_value = query_value
|
107
|
+
end
|
108
|
+
|
109
|
+
# Adds the search criteria xml
|
110
|
+
# @param [Handsoap::XmlMason::Node] msg xml node
|
111
|
+
# @return [Handsoap::XmlMason::Node]
|
112
|
+
def soapify_for(msg)
|
113
|
+
msg.add('searchCriteria') { |crit|
|
114
|
+
crit.add 'fieldId', @field_id
|
115
|
+
crit.add 'operator', @operator
|
116
|
+
crit.add 'queryValue', @query_value unless @query_value.nil?
|
117
|
+
}
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
|
2
|
+
class Landslider
|
3
|
+
|
4
|
+
# A list of operators that can be used with WsSearchCriterion
|
5
|
+
class WsSearchOperator
|
6
|
+
|
7
|
+
# returns values that contain the given search string
|
8
|
+
CONTAINS='Contains'
|
9
|
+
|
10
|
+
# returns values that "sound like" the given search string (smythe = smith)
|
11
|
+
SOUNDS_LIKE='SoundsLike'
|
12
|
+
|
13
|
+
# returns values that start with the given search string
|
14
|
+
STARTS_WITH='StartsWith'
|
15
|
+
|
16
|
+
# returns values that end with the given search string
|
17
|
+
ENDS_WITH='EndsWith'
|
18
|
+
|
19
|
+
# returns values that do not contain the given search string
|
20
|
+
DOES_NOT_CONTAIN='DoesNotContain'
|
21
|
+
|
22
|
+
# returns values that are identically equal (case-insensitive) the given search value
|
23
|
+
EQUALS='Equals'
|
24
|
+
|
25
|
+
# returns values that are not equal (case-insensitive) the given search value
|
26
|
+
NOT_EQUALS='NotEquals'
|
27
|
+
|
28
|
+
# returns values that are less than the given search value
|
29
|
+
LESS_THAN='LessThan'
|
30
|
+
|
31
|
+
# returns values that are less than or equal to the given search value
|
32
|
+
LESS_THAN_OR_EQUAL='LessThanOrEqual'
|
33
|
+
|
34
|
+
# returns values that are greater than the given search value
|
35
|
+
GREATER_THAN='GreaterThan'
|
36
|
+
|
37
|
+
# returns values that are greater than or equal to the given search value
|
38
|
+
GREATER_THAN_OR_EQUAL='GreaterThanOrEqual'
|
39
|
+
|
40
|
+
# returns values that are empty (null)
|
41
|
+
EMPTY='Empty'
|
42
|
+
|
43
|
+
# returns values that are not empty (not null)
|
44
|
+
NOT_EMPTY='NotEmpty'
|
45
|
+
|
46
|
+
# returns values that are logically True
|
47
|
+
TRUE='True'
|
48
|
+
|
49
|
+
# returns values that are logically False
|
50
|
+
FALSE='False'
|
51
|
+
|
52
|
+
# returns values that are in the specified list
|
53
|
+
IN='In'
|
54
|
+
|
55
|
+
# returns values that are not in the specified list
|
56
|
+
NOT_IN='NotIn'
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Landslider
|
2
|
+
|
3
|
+
class WsUserSearch < WsSearch
|
4
|
+
|
5
|
+
# @return [String]
|
6
|
+
attr_reader :user_name
|
7
|
+
|
8
|
+
# @param [String] user_name a user name
|
9
|
+
def initialize(user_name)
|
10
|
+
@user_name = user_name
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [Handsoap::XmlMason::Node] msg
|
14
|
+
# @return [Handsoap::XmlMason::Node]
|
15
|
+
def soapify_for(msg)
|
16
|
+
raise 'not implemented'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'landslider/entities/ws_entity'
|
2
|
+
require 'landslider/entities/ws_result'
|
3
|
+
require 'landslider/entities/ws_primary_entity'
|
4
|
+
|
5
|
+
require 'landslider/entities/ws_search'
|
6
|
+
require 'landslider/entities/ws_search_criterion'
|
7
|
+
require 'landslider/entities/ws_search_operator'
|
8
|
+
|
9
|
+
require 'landslider/entities/ws_account'
|
10
|
+
require 'landslider/entities/ws_account_note'
|
11
|
+
require 'landslider/entities/ws_account_note_search'
|
12
|
+
require 'landslider/entities/ws_address'
|
13
|
+
|
14
|
+
require 'landslider/entities/ws_contact'
|
15
|
+
require 'landslider/entities/ws_contact_note'
|
16
|
+
require 'landslider/entities/ws_contact_note_search'
|
17
|
+
require 'landslider/entities/ws_contact_search'
|
18
|
+
require 'landslider/entities/ws_employee'
|
19
|
+
|
20
|
+
require 'landslider/entities/ws_lead'
|
21
|
+
require 'landslider/entities/ws_lead_contact'
|
22
|
+
require 'landslider/entities/ws_lead_note'
|
23
|
+
require 'landslider/entities/ws_lead_note_search'
|
24
|
+
require 'landslider/entities/ws_lead_search'
|
25
|
+
|
26
|
+
require 'landslider/entities/ws_my_list'
|
27
|
+
require 'landslider/entities/ws_note'
|
28
|
+
require 'landslider/entities/ws_opportunity'
|
29
|
+
require 'landslider/entities/ws_opportunity_note'
|
30
|
+
require 'landslider/entities/ws_opportunity_note_search'
|
31
|
+
require 'landslider/entities/ws_opportunity_status'
|
32
|
+
|
33
|
+
require 'landslider/entities/ws_payment_term'
|
34
|
+
|
35
|
+
require 'landslider/entities/ws_pick_list_item'
|
36
|
+
require 'landslider/entities/ws_product'
|
37
|
+
require 'landslider/entities/ws_product_family'
|
38
|
+
require 'landslider/entities/ws_product_result'
|
39
|
+
|
40
|
+
|
41
|
+
require 'landslider/entities/ws_search'
|
42
|
+
require 'landslider/entities/ws_selling_process'
|
43
|
+
require 'landslider/entities/ws_user'
|
44
|
+
|
45
|
+
|
46
|
+
|