wes-data-api 11.2.1 → 11.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wes/data/api/model/base.rb +14 -0
- data/lib/wes/data/api/model/brief.rb +13 -0
- data/lib/wes/data/api/model/creator_user.rb +13 -0
- data/lib/wes/data/api/model/transaction.rb +15 -0
- data/lib/wes/data/api/routes.rb +2 -1
- data/lib/wes/data/api.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: cdedabd47215b662434a0143e9f7fcc585228a29
|
4
|
+
data.tar.gz: 29561ca971eb389b7cbcbe9169ef8f4cd6492e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da6369b37e707e772b072fe7af2921825a5f433d36822f4c88bdf64e5b0ba0e864f683805118b2d4ecea8338a8c7f2bb8eafea981319e8a37ce483b77c422889
|
7
|
+
data.tar.gz: 61ddd784dca9b326f3b607981060cc3d60b1a1a0e8b84ef7d249163bc680b2e2ffcfec699a4f1fdbe2f7821b09901b5e5cb2589e55f86c76cf6535c62600b283
|
@@ -46,6 +46,20 @@ module Wes
|
|
46
46
|
configuration.routes
|
47
47
|
end
|
48
48
|
|
49
|
+
def apply_pagination(route, limit, offset)
|
50
|
+
delimiter = route.include?("?") ? '&' : '?'
|
51
|
+
route = format(
|
52
|
+
'%s%slimit=%s',
|
53
|
+
route, delimiter, limit
|
54
|
+
)
|
55
|
+
|
56
|
+
if offset != nil
|
57
|
+
route = format('%s&offset=%s', route, offset)
|
58
|
+
end
|
59
|
+
|
60
|
+
route
|
61
|
+
end
|
62
|
+
|
49
63
|
private
|
50
64
|
|
51
65
|
def id_set?
|
@@ -3,6 +3,7 @@ require 'wes/data/api/model/reward'
|
|
3
3
|
require 'wes/data/api/model/creator_user'
|
4
4
|
require 'wes/data/api/model/video'
|
5
5
|
require 'wes/data/api/model/brief_answer'
|
6
|
+
require 'wes/data/api/model/transaction'
|
6
7
|
|
7
8
|
module Wes
|
8
9
|
module Data
|
@@ -66,6 +67,18 @@ module Wes
|
|
66
67
|
JSON.parse(data)
|
67
68
|
end
|
68
69
|
|
70
|
+
def transactions(limit = 50, offset = nil)
|
71
|
+
route = apply_pagination(
|
72
|
+
[routes.brief, id, routes.transactions].join('/'),
|
73
|
+
limit,
|
74
|
+
offset
|
75
|
+
)
|
76
|
+
records = client.get(route)
|
77
|
+
map_objects(
|
78
|
+
records, Wes::Data::API::Model::Transaction
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
69
82
|
private
|
70
83
|
|
71
84
|
def insight_data(type)
|
@@ -3,6 +3,7 @@ require 'wes/data/api/model/collective'
|
|
3
3
|
require 'wes/data/api/model/submission'
|
4
4
|
require 'wes/data/api/model/address'
|
5
5
|
require 'wes/data/api/model/video'
|
6
|
+
require 'wes/data/api/model/transaction'
|
6
7
|
|
7
8
|
module Wes
|
8
9
|
module Data
|
@@ -54,6 +55,18 @@ module Wes
|
|
54
55
|
map_objects(records, Wes::Data::API::Model::Video)
|
55
56
|
end
|
56
57
|
|
58
|
+
def transactions(limit = 50, offset = nil)
|
59
|
+
route = apply_pagination(
|
60
|
+
[routes.creator_user, id, routes.transactions].join('/'),
|
61
|
+
limit,
|
62
|
+
offset
|
63
|
+
)
|
64
|
+
records = client.get(route)
|
65
|
+
map_objects(
|
66
|
+
records, Wes::Data::API::Model::Transaction
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
57
70
|
protected
|
58
71
|
|
59
72
|
def create_collectives(collective_ids)
|
data/lib/wes/data/api/routes.rb
CHANGED
data/lib/wes/data/api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.
|
4
|
+
version: 11.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/wes/data/api/model/submission.rb
|
143
143
|
- lib/wes/data/api/model/tag.rb
|
144
144
|
- lib/wes/data/api/model/tag_video_version.rb
|
145
|
+
- lib/wes/data/api/model/transaction.rb
|
145
146
|
- lib/wes/data/api/model/video.rb
|
146
147
|
- lib/wes/data/api/model/video_transcoding_state.rb
|
147
148
|
- lib/wes/data/api/model/video_version.rb
|