wes-data-api 4.5.0 → 5.0.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/billing.rb +1 -1
- data/lib/wes/data/api/{user.rb → creator_user.rb} +7 -7
- data/lib/wes/data/api/model/challenge.rb +3 -3
- data/lib/wes/data/api/model/{user.rb → creator_user.rb} +5 -5
- data/lib/wes/data/api/routes.rb +14 -14
- data/lib/wes/data/api.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c67880d62666ea6ca69d88e94430de8f25a6bd4
|
4
|
+
data.tar.gz: 022513d831f109c1137ffd238ea31f949a79ca12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f890e1523e211fa7bc867778f2305b3c5872f87a837985f01c84b9e0496d2466a14baaf8198d766a44ccac2c1a6cc6e76c3f9f1d3d3d4640130ca734d5e3fe
|
7
|
+
data.tar.gz: eebb9c47ed65e5dc2b558b55f7e7c70e03cafe44e281e16fd644fcad9cebb78c1a45dd928aa7089b38c92e59fc5b9d1aad256a1567d8643384a838493d447d80
|
data/lib/wes/data/api/billing.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
require "wes/data/api/base"
|
2
|
-
require "wes/data/api/model/
|
2
|
+
require "wes/data/api/model/creator_user"
|
3
3
|
|
4
4
|
module Wes
|
5
5
|
module Data
|
6
6
|
module API
|
7
|
-
class
|
7
|
+
class CreatorUser
|
8
8
|
class << self
|
9
9
|
include Base
|
10
10
|
|
11
11
|
def all
|
12
12
|
map_objects(
|
13
|
-
client.get(routes.
|
13
|
+
client.get(routes.creator_users), model_klass
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
17
|
def create(id)
|
18
|
-
route = [routes.
|
18
|
+
route = [routes.creator_user, id].join("/")
|
19
19
|
attributes = client.post(route).first
|
20
20
|
attributes.nil? ? nil : model_klass.new(attributes)
|
21
21
|
end
|
@@ -30,9 +30,9 @@ module Wes
|
|
30
30
|
def find_route(key, value)
|
31
31
|
case key
|
32
32
|
when :id
|
33
|
-
[routes.
|
33
|
+
[routes.creator_user, value].join("/")
|
34
34
|
else
|
35
|
-
"#{routes.
|
35
|
+
"#{routes.creator_user}?#{key}=#{value}"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -41,7 +41,7 @@ module Wes
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def model_klass
|
44
|
-
Wes::Data::API::Model::
|
44
|
+
Wes::Data::API::Model::CreatorUser
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "wes/data/api/model/base"
|
2
2
|
require "wes/data/api/model/challenge_reward"
|
3
|
-
require "wes/data/api/model/
|
3
|
+
require "wes/data/api/model/creator_user"
|
4
4
|
require "wes/data/api/model/video"
|
5
5
|
|
6
6
|
module Wes
|
@@ -21,10 +21,10 @@ module Wes
|
|
21
21
|
|
22
22
|
def users(state = nil)
|
23
23
|
route = add_state(
|
24
|
-
[routes.challenge, id, routes.
|
24
|
+
[routes.challenge, id, routes.creator_users].join("/"), state
|
25
25
|
)
|
26
26
|
map_objects(
|
27
|
-
client.get(route), Wes::Data::API::Model::
|
27
|
+
client.get(route), Wes::Data::API::Model::CreatorUser
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
@@ -7,10 +7,10 @@ module Wes
|
|
7
7
|
module Data
|
8
8
|
module API
|
9
9
|
module Model
|
10
|
-
class
|
10
|
+
class CreatorUser < Base
|
11
11
|
def submissions(state = nil)
|
12
12
|
route = add_state(
|
13
|
-
[routes.
|
13
|
+
[routes.creator_user, id, routes.submissions].join("/"), state
|
14
14
|
)
|
15
15
|
map_objects(
|
16
16
|
client.get(route), Wes::Data::API::Model::Submission
|
@@ -18,7 +18,7 @@ module Wes
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def update(changes)
|
21
|
-
route = [routes.
|
21
|
+
route = [routes.creator_user, id].join("/")
|
22
22
|
attributes = client.put(
|
23
23
|
route, attributes.to_h.merge(changes)
|
24
24
|
).first
|
@@ -27,7 +27,7 @@ module Wes
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def videos
|
30
|
-
route = [routes.
|
30
|
+
route = [routes.creator_user, id, routes.videos].join("/")
|
31
31
|
map_objects(
|
32
32
|
client.get(route), Wes::Data::API::Model::Video
|
33
33
|
)
|
@@ -43,7 +43,7 @@ module Wes
|
|
43
43
|
|
44
44
|
def create_collectives(collective_ids)
|
45
45
|
client.post(
|
46
|
-
[routes.
|
46
|
+
[routes.creator_user, id, routes.collectives].join("/"),
|
47
47
|
collective_ids
|
48
48
|
)
|
49
49
|
end
|
data/lib/wes/data/api/routes.rb
CHANGED
@@ -5,20 +5,20 @@ module Wes
|
|
5
5
|
class << self
|
6
6
|
def hash
|
7
7
|
OpenStruct.new(
|
8
|
-
:billing
|
9
|
-
:brand
|
10
|
-
:brand_user
|
11
|
-
:brands
|
12
|
-
:challenge
|
13
|
-
:challenges
|
14
|
-
:collectives
|
15
|
-
:creator_user
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:video
|
21
|
-
:videos
|
8
|
+
:billing => "billing",
|
9
|
+
:brand => "brand",
|
10
|
+
:brand_user => "brand-user",
|
11
|
+
:brands => "brands",
|
12
|
+
:challenge => "challenge",
|
13
|
+
:challenges => "challenges",
|
14
|
+
:collectives => "collectives",
|
15
|
+
:creator_user => "creator-user",
|
16
|
+
:creator_users => "creator-users",
|
17
|
+
:rewards => "rewards",
|
18
|
+
:submission => "submission",
|
19
|
+
:submissions => "submissions",
|
20
|
+
:video => "video",
|
21
|
+
:videos => "videos"
|
22
22
|
)
|
23
23
|
end
|
24
24
|
end
|
data/lib/wes/data/api.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- lib/wes/data/api/client.rb
|
126
126
|
- lib/wes/data/api/collective.rb
|
127
127
|
- lib/wes/data/api/configuration.rb
|
128
|
+
- lib/wes/data/api/creator_user.rb
|
128
129
|
- lib/wes/data/api/error/response.rb
|
129
130
|
- lib/wes/data/api/error/unexpected.rb
|
130
131
|
- lib/wes/data/api/model/base.rb
|
@@ -134,14 +135,13 @@ files:
|
|
134
135
|
- lib/wes/data/api/model/challenge.rb
|
135
136
|
- lib/wes/data/api/model/challenge_reward.rb
|
136
137
|
- lib/wes/data/api/model/collective.rb
|
138
|
+
- lib/wes/data/api/model/creator_user.rb
|
137
139
|
- lib/wes/data/api/model/submission.rb
|
138
|
-
- lib/wes/data/api/model/user.rb
|
139
140
|
- lib/wes/data/api/model/video.rb
|
140
141
|
- lib/wes/data/api/request.rb
|
141
142
|
- lib/wes/data/api/response.rb
|
142
143
|
- lib/wes/data/api/routes.rb
|
143
144
|
- lib/wes/data/api/submission.rb
|
144
|
-
- lib/wes/data/api/user.rb
|
145
145
|
- lib/wes/data/api/video.rb
|
146
146
|
- wes-data-api.gemspec
|
147
147
|
homepage: ''
|