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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f94f4d3ef30177c2c73c99a6eac23d02b5d5dbd
4
- data.tar.gz: 4d60e0e3b484699c9a6a0507ea639630a5a85b86
3
+ metadata.gz: 9c67880d62666ea6ca69d88e94430de8f25a6bd4
4
+ data.tar.gz: 022513d831f109c1137ffd238ea31f949a79ca12
5
5
  SHA512:
6
- metadata.gz: 804404336bf089b5e9330c1baf7fd2b54b8dad120966fd961c32aa971b9c341df1d96e6b49a94b182e5ae20a7a8ccbdef95ec88f9b150e558baec32fbee0c371
7
- data.tar.gz: 7987296d3a0b47696440276b6ae86caa393a09ca886f325066c203bb722a41f7ee77bababbf1881cf30d95dbb3c2b477d5f99acd1b0aa069f742917bd0e2c193
6
+ metadata.gz: 50f890e1523e211fa7bc867778f2305b3c5872f87a837985f01c84b9e0496d2466a14baaf8198d766a44ccac2c1a6cc6e76c3f9f1d3d3d4640130ca734d5e3fe
7
+ data.tar.gz: eebb9c47ed65e5dc2b558b55f7e7c70e03cafe44e281e16fd644fcad9cebb78c1a45dd928aa7089b38c92e59fc5b9d1aad256a1567d8643384a838493d447d80
@@ -25,7 +25,7 @@ module Wes
25
25
  when :id
26
26
  [routes.billing, value].join("/")
27
27
  when :user_id
28
- [routes.user, value, routes.billing].join("/")
28
+ [routes.creator_user, value, routes.billing].join("/")
29
29
  end
30
30
  end
31
31
 
@@ -1,21 +1,21 @@
1
1
  require "wes/data/api/base"
2
- require "wes/data/api/model/user"
2
+ require "wes/data/api/model/creator_user"
3
3
 
4
4
  module Wes
5
5
  module Data
6
6
  module API
7
- class User
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.users), model_klass
13
+ client.get(routes.creator_users), model_klass
14
14
  )
15
15
  end
16
16
 
17
17
  def create(id)
18
- route = [routes.user, id].join("/")
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.user, value].join("/")
33
+ [routes.creator_user, value].join("/")
34
34
  else
35
- "#{routes.user}?#{key}=#{value}"
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::User
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/user"
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.users].join("/"), state
24
+ [routes.challenge, id, routes.creator_users].join("/"), state
25
25
  )
26
26
  map_objects(
27
- client.get(route), Wes::Data::API::Model::User
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 User < Base
10
+ class CreatorUser < Base
11
11
  def submissions(state = nil)
12
12
  route = add_state(
13
- [routes.user, id, routes.submissions].join("/"), state
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.user, id].join("/")
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.user, id, routes.videos].join("/")
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.user, id, routes.collectives].join("/"),
46
+ [routes.creator_user, id, routes.collectives].join("/"),
47
47
  collective_ids
48
48
  )
49
49
  end
@@ -5,20 +5,20 @@ module Wes
5
5
  class << self
6
6
  def hash
7
7
  OpenStruct.new(
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
- :rewards => "rewards",
17
- :submission => "submission",
18
- :submissions => "submissions",
19
- :users => "users",
20
- :video => "video",
21
- :videos => "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
@@ -5,7 +5,7 @@ require "wes/data/api/configuration"
5
5
  module Wes
6
6
  module Data
7
7
  module API
8
- VERSION = "4.5.0".freeze
8
+ VERSION = "5.0.0".freeze
9
9
  end
10
10
  end
11
11
  end
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.5.0
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: ''