securevideo-api 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/securevideo/api.rb +1 -0
- data/lib/securevideo/api/response.rb +37 -0
- data/lib/securevideo/api/session.rb +11 -4
- data/lib/securevideo/api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ee485b92afaf9dacb01c1e3c91b6bdce40316a1
|
4
|
+
data.tar.gz: 0edace78fb53dfe7c80ba058d2d6ff668f90dd25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a81f3cff1f30cfd410ff49078706027907d367871386c34ad081617837c698eb7220774ead08519b94387c4c3697c41154ecb2e0eed5346670b1289544a20a9
|
7
|
+
data.tar.gz: 93ace387f66e0bd0f67bddeda081077d81bdf848cbd6ea9d222f567c8f4a6c754ce4a93c9bac86ccc909c85fa4d8606f9983d23f9c526e6d499caab7c46e07df
|
data/lib/securevideo/api.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
module Securevideo
|
2
|
+
module Api
|
3
|
+
class Response
|
4
|
+
attr_reader :response
|
5
|
+
def initialize(response)
|
6
|
+
@response = response
|
7
|
+
end
|
8
|
+
|
9
|
+
def success?
|
10
|
+
status == :ok
|
11
|
+
end
|
12
|
+
|
13
|
+
def status
|
14
|
+
if !response.respond_to?(:Message) || response.Message.nil?
|
15
|
+
:ok
|
16
|
+
else
|
17
|
+
:error
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def error_message
|
22
|
+
response.Message
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_details
|
26
|
+
response.MessageDetail
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_s
|
30
|
+
"status:#{status} message:#{success? ? '' : error_message}"
|
31
|
+
end
|
32
|
+
def inspect
|
33
|
+
"#{self.class.name} - #{to_s}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -4,7 +4,7 @@ module Securevideo
|
|
4
4
|
include Her::Model
|
5
5
|
uses_api Securevideo::Api.api
|
6
6
|
primary_key :SessionId
|
7
|
-
collection_path
|
7
|
+
collection_path 'session/:UserId'
|
8
8
|
|
9
9
|
attributes :UserId, :ScheduleTs, :Participants
|
10
10
|
validates :UserId, presence: true
|
@@ -12,15 +12,22 @@ module Securevideo
|
|
12
12
|
validates :Participants, presence: true
|
13
13
|
|
14
14
|
def reschedule(schedule_ts)
|
15
|
-
self.class.
|
15
|
+
self.class.reschedule(id, schedule_ts)
|
16
16
|
end
|
17
17
|
|
18
18
|
def destroy
|
19
|
-
self.class.
|
20
|
-
nil
|
19
|
+
self.class.cancel(id)
|
21
20
|
end
|
22
21
|
|
23
22
|
class << self
|
23
|
+
def cancel(session_id)
|
24
|
+
Response.new(delete("session/#{session_id}"))
|
25
|
+
end
|
26
|
+
|
27
|
+
def reschedule(session_id, schedule_ts)
|
28
|
+
Response.new(put("session/#{session_id}", 'ScheduleTs' => schedule_ts))
|
29
|
+
end
|
30
|
+
|
24
31
|
#
|
25
32
|
# @params month - 2014-01-01
|
26
33
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: securevideo-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -244,6 +244,7 @@ files:
|
|
244
244
|
- bin/setup
|
245
245
|
- lib/securevideo/api.rb
|
246
246
|
- lib/securevideo/api/participant.rb
|
247
|
+
- lib/securevideo/api/response.rb
|
247
248
|
- lib/securevideo/api/session.rb
|
248
249
|
- lib/securevideo/api/time_zones.rb
|
249
250
|
- lib/securevideo/api/user.rb
|