xcal-parktronic 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1daf819502ce921740c2c563961f2d61fb51382
4
- data.tar.gz: bbcdcf236efc8cd55f1bdd782f0607056180e75e
3
+ metadata.gz: d420daedd5a7fe7d9a637412cb721d5caed39840
4
+ data.tar.gz: 3275a06cd027c399ce4c3c1b2e9942bf85dbaf53
5
5
  SHA512:
6
- metadata.gz: d0d0d2f6913f3712fedcc262510d19c4b37bfb81c9ecaaf88b42128b82e41b8b2cd3ad6b986224170c4b5f197d92a435679fdac12db0583acf3f3383f0ef1825
7
- data.tar.gz: 9e5476341e9251d358574ac731a44210c2112a4491b096ec4655c46bc128b973ecc54fe76cd8553d055db36e0f1d731744a54cf7f5aeaedf63865c27823ee0b9
6
+ metadata.gz: ee2602fc17f9c90d65aa364bff5903608590405f69786e60b0a52aed5a3328b16b4514a3b07ad2a8c3d7a69c098d7eb4efc99dbfc4339e83a06bbdb48f29a151
7
+ data.tar.gz: 879c94f91e4a317d3e5cc6db5bcb52980057ceaca1bee52f6b635bd45b6559fefd79e74bea393c11aa04545ff5cffb5cc78005c3613b85fadadf2700ae62538c
data/README.md CHANGED
@@ -76,6 +76,9 @@ api.search_events(search: {subject: 'test event', incident_ticket_id: '23'})
76
76
  api.search_events(scopes: {tagged_with: 'test event tag', general_filter: 'ticketed'})
77
77
  api.search_events(where: {event_status: 'Critical', incident_ticket_id: 'IFS-23'})
78
78
  api.search_events(extends: ['alarm_impact_level'])
79
+
80
+ api.status_update_events(incident_sor: 'brouha', incident_id: 1, incident_status: 'Resolved')
81
+ api.status_update_events(incident_sor: 'tp', incident_id: ['ifs-1', 'ifs-2'], incident_status: 'In Progress')
79
82
  ```
80
83
 
81
84
  ### Events history
@@ -90,6 +90,24 @@ module Xcal
90
90
  generic_response = Xcal::Parktronic::GenericResponse.new(response.body)
91
91
  response.code == '200' && generic_response.has_key?(:events) ? generic_response.events.map(&:event) : generic_response
92
92
  end
93
+
94
+ # Bulk update events with incident status for specified ticket SOR and incident ticket id
95
+ #
96
+ # ==== Parameters
97
+ # * +incident_sor+ incident ticket SOR
98
+ # * +incident_id+ incident ticket id(s)
99
+ # * +incident_status+ incident status
100
+ #
101
+ # ==== Examples
102
+ # api.status_update_events(incident_sor: 'brouha', incident_id: 1, incident_status: 'Resolved')
103
+ # api.status_update_events(incident_sor: 'tp', incident_id: ['ifs-1', 'ifs-2'], incident_status: 'In Progress')
104
+ def status_update_events(args = {})
105
+ request = Net::HTTP::Post.new("/#{api_version}/events/bulk_status_update", 'Content-Type' => 'application/json')
106
+ request.body = args.merge(access_token: access_token).to_json
107
+
108
+ response = http.start { |net| net.request(request) }
109
+ Xcal::Parktronic::GenericResponse.new(response.body)
110
+ end
93
111
  end
94
112
 
95
113
  end
@@ -1,5 +1,5 @@
1
1
  module Xcal
2
2
  module Parktronic
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
@@ -35,6 +35,15 @@ describe Xcal::Parktronic::ApiClient do
35
35
  expect(events).to be_a Array
36
36
  end
37
37
  end
38
+
39
+ describe '#status_update_events' do
40
+ let(:status_update_params) { {incident_sor: 'tp', incident_id: ['IFS-1', 'IFS-2'], incident_status: 'Resolved'} }
41
+ it 'responds to status_update_events' do
42
+ events_message = nil
43
+ expect { events_message = api_http_client.status_update_events(status_update_params) }.not_to raise_error
44
+ expect(events_message.message).to match(/10 events updated/)
45
+ end
46
+ end
38
47
  end
39
48
 
40
49
  end
@@ -144,6 +144,10 @@ class ApiMock < Sinatra::Base
144
144
  json_response 201, 'event.json'
145
145
  end
146
146
 
147
+ post '/:version/events/bulk_status_update' do
148
+ json_response 200, 'event_status_update.json'
149
+ end
150
+
147
151
  # Outages
148
152
 
149
153
  get '/:version/outages' do
@@ -0,0 +1,3 @@
1
+ {
2
+ "message":"10 events updated!"
3
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcal-parktronic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaliy Omelchenko
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-11 00:00:00.000000000 Z
13
+ date: 2015-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hashie
@@ -183,6 +183,7 @@ files:
183
183
  - spec/support/fixtures/responses/command_notification.json
184
184
  - spec/support/fixtures/responses/command_notifications.json
185
185
  - spec/support/fixtures/responses/event.json
186
+ - spec/support/fixtures/responses/event_status_update.json
186
187
  - spec/support/fixtures/responses/event_tags.json
187
188
  - spec/support/fixtures/responses/events_history_page_1.json
188
189
  - spec/support/fixtures/responses/events_history_page_2.json
@@ -253,6 +254,7 @@ test_files:
253
254
  - spec/support/fixtures/responses/command_notification.json
254
255
  - spec/support/fixtures/responses/command_notifications.json
255
256
  - spec/support/fixtures/responses/event.json
257
+ - spec/support/fixtures/responses/event_status_update.json
256
258
  - spec/support/fixtures/responses/event_tags.json
257
259
  - spec/support/fixtures/responses/events_history_page_1.json
258
260
  - spec/support/fixtures/responses/events_history_page_2.json