issue_centre 0.0.4 → 0.0.5

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: 6c94dcde5985cb97145e1717d6f56bc486a697cf
4
- data.tar.gz: c361fb55e576469ff3ad530866824978aa81fa50
3
+ metadata.gz: 70636ce468d0f6fcbb1c65cedc00f47bf5da9bac
4
+ data.tar.gz: 058b320fc07c35b7c10aad0c74d6ec61d11ce046
5
5
  SHA512:
6
- metadata.gz: b761c060454d0eb712c4d19ca38c186aa3dab5cdcfe4057adcc6f04ae62c279a4df82fe1d5bc8f7b0dc8b267d3a92868a0a0cf6d0b34c19c1b3a47cff4fae33d
7
- data.tar.gz: d851d0d22fcc1c2a65042a72424f0f380a747bef308f659b84e495f8fe5ff6e217d78b2aa595b417d4cb169cfb3f23936107ad446237355bce488e0822a9ced3
6
+ metadata.gz: 961e1fc792d9e4070334001afb9f8434c427c39a21d2e56cc24a175bf0341110fe2fd723a19114b82bd1bf2a9cc7f2fd84351bdac820b51819836214f12b60b8
7
+ data.tar.gz: 52a2ae27df46ef2c426cd83fa5d797102024acedd145f789382d7f9f7aa681d43098346c6444a58096d316743880446d263f7e61f208466a15f45fc1822bb774
data/.gitignore CHANGED
@@ -14,3 +14,5 @@
14
14
  mkmf.log
15
15
 
16
16
  *~
17
+ TAGS
18
+ tags
data/README.md CHANGED
@@ -66,7 +66,7 @@ closed_tickets = ticket_conn.get_closed_tickets( session_key, companies.first[:i
66
66
  # Grab a list of events for the specified ticket
67
67
  events = ticket_conn.get_events_for_ticket( session_key, closed_tickets.last[:id])
68
68
 
69
-
69
+ # And many more... (don't forget to check the docs for a full list!)
70
70
  ```
71
71
 
72
72
  ## Contributing
data/Rakefile CHANGED
@@ -1,12 +1,35 @@
1
1
  require 'yard'
2
2
 
3
3
  YARD::Rake::YardocTask.new do |t|
4
+ puts 'Refreshing YARD docs...'
4
5
  end
5
6
 
6
- desc "Generate yard documentation to release process"
7
- task "release", [:remote] => ["yard"] do
7
+ # Update TAGS file
8
+ desc 'Refresh Emacs tags'
9
+ task 'ctags' do
10
+ exclude = %w{
11
+ .git
12
+ app/views/
13
+ coverage
14
+ test/coverage
15
+ db
16
+ doc
17
+ features
18
+ log
19
+ tmp
20
+ }
21
+ exclude_options = exclude.map{ |e| "--exclude=#{e}"}.join(' ')
22
+ puts 'Refreshing TAGS...'
23
+ system("/usr/local/bin/ctags -e -R --extra=+fq #{exclude_options} . $(rvm gemdir)/gems")
8
24
  end
9
-
25
+
26
+ # Run ctags followed by yard docs prior to the release steps defined
27
+ # in gem_tasks below...
28
+ #
29
+ desc 'Generate TAGS and YARD docs prior to release'
30
+ task 'release', [:remote] => ['yard', 'ctags'] do
31
+ end
32
+
10
33
  require 'bundler/gem_tasks'
11
34
 
12
35
  require 'rake/testtask'
@@ -0,0 +1,154 @@
1
+ module IssueCentre
2
+ class ContractConnection < GenericConnection
3
+
4
+ # Connection client for authenticating and retrieving contract
5
+ # information from IssueCentre
6
+ #
7
+ # @param [String] customer_url IssueCentre endpoint url (e.g.
8
+ # {https://support.callclosed.net/issuecentre/Contract})
9
+ #
10
+ # @param [String] session_key SessionKey for this session
11
+ #
12
+ # @param [Hash] options Other options to pass to the constructors
13
+ #
14
+ # @return [CustomerConnection] Instance of CustomerConnection client
15
+ #
16
+ def initialize( customer_url, session_key, options = {})
17
+ # @session_key = session_key
18
+ super( customer_url, options)
19
+ end
20
+
21
+
22
+ # Return all agents from IssueCentre for this contract
23
+ #
24
+ # @param [String] session_key SessionKey object
25
+ #
26
+ # @param [Integer] agent_id Agent ID for the contract (0 returns all)
27
+ #
28
+ # @return [Array] An array of events and details as hashes
29
+ #
30
+ def get_agents( session_key, agent_id)
31
+ response_xml = self.call( :get_agents, message: {
32
+ arg0: session_key,
33
+ arg1: agent_id
34
+ })
35
+ response = IssueCentre::Response.parse( response_xml)
36
+ end
37
+
38
+
39
+ # Return all error types from IssueCentre for this contract
40
+ #
41
+ # @param [String] session_key SessionKey object
42
+ #
43
+ # @return [Array] An array of error types and details as hashes
44
+ #
45
+ def get_error_types( session_key)
46
+ response_xml = self.call( :get_error_types, message: {
47
+ arg0: session_key
48
+ })
49
+ response = IssueCentre::Response.parse( response_xml)
50
+ end
51
+
52
+
53
+ # Return all event types from IssueCentre for this contract
54
+ #
55
+ # @param [String] session_key SessionKey object
56
+ #
57
+ # @return [Array] An array of events and details as hashes
58
+ #
59
+ def get_event_types( session_key)
60
+ response_xml = self.call( :get_event_types, message: {
61
+ arg0: session_key
62
+ })
63
+ response = IssueCentre::Response.parse( response_xml)
64
+ end
65
+
66
+
67
+ # Return all priorities from IssueCentre for this contract
68
+ #
69
+ # @param [String] session_key SessionKey object
70
+ #
71
+ # @return [Array] An array of priorities and details as hashes
72
+ #
73
+ def get_priorities( session_key)
74
+ response_xml = self.call( :get_error_types, message: {
75
+ arg0: session_key
76
+ })
77
+ response = IssueCentre::Response.parse( response_xml)
78
+ end
79
+
80
+
81
+ # Return all products from IssueCentre for this contract
82
+ #
83
+ # @param [String] session_key SessionKey object
84
+ #
85
+ # @return [Array] An array of products and details as hashes
86
+ #
87
+ def get_products( session_key)
88
+ response_xml = self.call( :get_products, message: {
89
+ arg0: session_key
90
+ })
91
+ response = IssueCentre::Response.parse( response_xml)
92
+ end
93
+
94
+
95
+ # Return all vendors from IssueCentre for this contract
96
+ #
97
+ # @param [String] session_key SessionKey object
98
+ #
99
+ # @return [Array] An array of vendors and details as hashes
100
+ #
101
+ def get_vendors( session_key)
102
+ response_xml = self.call( :get_vendors, message: {
103
+ arg0: session_key
104
+ })
105
+ response = IssueCentre::Response.parse( response_xml)
106
+ end
107
+
108
+
109
+ # Return all status types from IssueCentre for this contract
110
+ #
111
+ # @param [String] session_key SessionKey object
112
+ #
113
+ # @return [Array] An array of statuses and details as hashes
114
+ #
115
+ def get_status_types( session_key)
116
+ response_xml = self.call( :get_status_types, message: {
117
+ arg0: session_key
118
+ })
119
+ response = IssueCentre::Response.parse( response_xml)
120
+ end
121
+
122
+
123
+ # Return all 'received by' methods from IssueCentre for this contract
124
+ #
125
+ # @param [String] session_key SessionKey object
126
+ #
127
+ # @return [Array] An array of 'received by' methods and details as hashes
128
+ #
129
+ def get_received_bymethods( session_key)
130
+ response_xml = self.call( :get_received_bymethods, message: {
131
+ arg0: session_key
132
+ })
133
+ response = IssueCentre::Response.parse( response_xml)
134
+ end
135
+
136
+
137
+ # Return ticket summary details from IssueCentre for this contract
138
+ #
139
+ # @param [String] session_key SessionKey object
140
+ #
141
+ # @return [Array] An array of summary details as hashes
142
+ #
143
+ def get_summary_details( session_key)
144
+ response_xml = self.call( :get_summary_details, message: {
145
+ arg0: session_key
146
+ })
147
+ response = IssueCentre::Response.parse( response_xml)
148
+ end
149
+
150
+ # @todo Not implemented yet: create_contract,
151
+
152
+ end
153
+ end
154
+
@@ -73,5 +73,9 @@ module IssueCentre
73
73
  })
74
74
  response = IssueCentre::Response.parse( response_xml)
75
75
  end
76
+
77
+ # @todo Not implemented yet: createContact, createCompany,
78
+ # updateContact, updateCompany
79
+
76
80
  end
77
81
  end
@@ -72,7 +72,7 @@ module IssueCentre
72
72
  obj[ :country_id] = attr.value
73
73
  when 'isDefault'
74
74
  obj[ :is_default] = attr.value == "1"
75
- when 'ticketCount', 'changeType', 'supportType'
75
+ when 'ticketCount', 'changeType', 'supportType', 'totalrecords'
76
76
  # skip (we don't need summaries)
77
77
  else
78
78
  obj[ attr.name.underscore.to_sym] = attr.value
@@ -87,9 +87,118 @@ module IssueCentre
87
87
 
88
88
 
89
89
 
90
- # TODO:
91
- # :get_all_tags, :get_attachment,
92
- # :get_recently_updated_tickets, :get_ticket_details,
93
- # :get_ticket_fix_group, :search_tickets,
90
+ # Return all details from IssueCentre for this ticket
91
+ #
92
+ # @param [String] session_key SessionKey object
93
+ #
94
+ # @param [Integer] ticket_id Ticket ID for the required ticket
95
+ #
96
+ # @return [Array] An array of details as hashes
97
+ #
98
+ def get_ticket_details( session_key, ticket_id)
99
+ response_xml = self.call( :get_ticket_details, message: {
100
+ api_key: session_key,
101
+ ticket: ticket_id
102
+ })
103
+ response = IssueCentre::Response.parse( response_xml)
104
+ end
105
+
106
+
107
+
108
+ # Return all tickets from IssueCentre that match these search parameters
109
+ #
110
+ # @param session_key [String] SessionKey object
111
+ #
112
+ # @param [Integer] company_id Company ID to search for (0 returns
113
+ # tickets for all companies)
114
+ #
115
+ # @param [Integer] contact_id Contact ID to search for (0 returns
116
+ # tickets for all contacts)
117
+ #
118
+ # @param [Integer] vendor_id Vendor ID to search for (0 returns
119
+ # tickets for all vendors)
120
+ #
121
+ # @param [Integer] product_id Product ID to search for (0 returns
122
+ # tickets for all products)
123
+ #
124
+ # @param [Symbol] status Ticket status to search for (:open, :closed, :both)
125
+ #
126
+ # @param [String] ticket_reference Ticket reference to search for
127
+ # ("" returns tickets for all references)
128
+ #
129
+ # @param [Integer] owner_id Ticket Owner ID to limit search by
130
+ # (0 returns tickets for all references)
131
+ #
132
+ # @param [String] client_reference Client reference to search for
133
+ # ("" returns tickets for all references)
134
+ #
135
+ # @param [String] supplier_reference Ticket reference to search for
136
+ # ("" returns tickets for all references)
137
+ #
138
+ # @param [String] company_reference Ticket reference to search for
139
+ # ("" returns tickets for all references)
140
+ #
141
+ # @param [Time] date_from Date and time to search from (based on
142
+ # ticket creation date)
143
+ #
144
+ # @param [Time] date_to Date and time to search until (based on
145
+ # ticket creation date)
146
+ #
147
+ # @param [Integer] ticket_status The ticket status code to search for
148
+ # (0 returns all status codes)
149
+ #
150
+ # @param [Integer] priority The ticket priority code to search for
151
+ # (0 returns all priority codes)
152
+ #
153
+ # @param [String] free_text Text to search for within the tickets
154
+ #
155
+ # @param [Integer] page_size The number of tickets to be returned per page.
156
+ #
157
+ # @param [Integer] page_num Which page number [1+] to return tickets for.
158
+ #
159
+ # @param [String] tags Which tags to limit the search to
160
+ #
161
+ # @return [Array] An array of tickets and details as hashes
162
+ #
163
+ def search_tickets( session_key, company_id, contact_id,
164
+ vendor_id, product_id, status, owner_id,
165
+ ticket_reference, client_reference,
166
+ supplier_reference, company_reference,
167
+ date_from, date_to, ticket_status, priority, free_text,
168
+ page_size, page_num, tags)
169
+
170
+ response_xml = self.call( :search_tickets, message: {
171
+ arg0: session_key,
172
+ arg1: company_id,
173
+ arg2: contact_id,
174
+ arg3: vendor_id,
175
+ arg4: product_id,
176
+ arg5: status,
177
+ arg6: owner_id,
178
+ arg7: ticket_reference,
179
+ arg8: client_reference,
180
+ arg9: supplier_reference,
181
+ arg10: company_reference,
182
+ arg11: date_from,
183
+ arg12: date_to,
184
+ arg13: ticket_status,
185
+ arg14: priority,
186
+ arg15: free_text,
187
+ arg16: page_size,
188
+ arg17: page_num,
189
+ arg18: tags
190
+ })
191
+ response = IssueCentre::Response.parse( response_xml)
192
+ end
193
+
194
+ # @todo Not implemented yet: add_event_to_ticket,
195
+ # add_reminder_to_ticket, create_ticket, get_all_tags,
196
+ # get_attachment, get_recently_updated_tickets,
197
+ # get_ticket_fix_group, send_email_response_from_ticket,
198
+ # set_ticket_fix_group, toggle_notification_for_ticket,
199
+ # update_custom_field_value, upload_encoded_file_to_ticket,
200
+ # upload_file_to_ticket
201
+
94
202
  end
95
203
  end
204
+
@@ -1,3 +1,3 @@
1
1
  module IssueCentre
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/issue_centre.rb CHANGED
@@ -10,6 +10,7 @@ require 'issue_centre/exception'
10
10
  require 'issue_centre/generic_connection'
11
11
  require 'issue_centre/auth_connection'
12
12
  require 'issue_centre/customer_connection'
13
+ require 'issue_centre/contract_connection'
13
14
  require 'issue_centre/ticket_connection'
14
15
  require 'issue_centre/response'
15
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: issue_centre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Holloway
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-28 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,6 +156,7 @@ files:
156
156
  - issue_centre.gemspec
157
157
  - lib/issue_centre.rb
158
158
  - lib/issue_centre/auth_connection.rb
159
+ - lib/issue_centre/contract_connection.rb
159
160
  - lib/issue_centre/customer_connection.rb
160
161
  - lib/issue_centre/exception.rb
161
162
  - lib/issue_centre/generic_connection.rb
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
187
  version: '0'
187
188
  requirements: []
188
189
  rubyforge_project:
189
- rubygems_version: 2.6.6
190
+ rubygems_version: 2.5.1
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Gem to wrap the IssueCentre API, as published at www.issuecentre.com by First