wes-data-api 13.2.0 → 13.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: 216745e1db883987f71432db1fb99366a152e95f
4
- data.tar.gz: 9c3b086739a967f5656dafc11b1624685fc1e853
3
+ metadata.gz: 79633b945affda90482abfc6acd3daca44e71f6d
4
+ data.tar.gz: 1ee2aedccde953a1db3f1222cf01c8c133fa09ef
5
5
  SHA512:
6
- metadata.gz: 93765bdbd2c2421ba26a9da9579b26a99b4390e73abd10f14cd4aaaf12307acac83ce42c53366acc7b6c44ea39dc67f77b180a1ba46f38d87068458e495feb9f
7
- data.tar.gz: 33678f39b4d67d1a50f1d7fb79f067da477ff8c5c16681116b8edf4f968fe132a84f16600a93446cd55904ed4d734d1dd723b84909b5aa2ee682a06653563d63
6
+ metadata.gz: 662bdd524b4542ab71e4cbc68c7064cfa709ab4d679151c4c7a88904b1756e43651e6b73bfe295ce08279b703c47706de2027a564e9a7eea1b995d5c367a8739
7
+ data.tar.gz: 117115b1b824995346c645eee7d13930966a8116c4c57d42c5d45e8a6b27039c29f8f3a0ce85db95a0b7cd870b23c563b76285064f5d06c90a6a592aa93702e2
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 = '13.2.0'.freeze
8
+ VERSION = '13.3.0'.freeze
9
9
  end
10
10
  end
11
11
  end
@@ -3,6 +3,7 @@ require 'wes/data/api/model/brief_rewards'
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/briefing_answer'
6
7
  require 'wes/data/api/model/transaction'
7
8
  require 'wes/data/api/model/video_partner_asset'
8
9
 
@@ -22,6 +23,13 @@ module Wes
22
23
  client.post(answers_route, answers)
23
24
  end
24
25
 
26
+ def briefing_answers
27
+ records = client.get(briefing_answers_route)
28
+ map_objects(
29
+ records, Wes::Data::API::Model::BriefingAnswer
30
+ )
31
+ end
32
+
25
33
  def create_rewards(data)
26
34
  route = [routes.brief, id, routes.brief_rewards].join('/')
27
35
  records = client.post(route, data)
@@ -95,6 +103,10 @@ module Wes
95
103
  [routes.brief, id, routes.answers].join('/')
96
104
  end
97
105
 
106
+ def briefing_answers_route
107
+ [routes.briefing, id, routes.answers].join('/')
108
+ end
109
+
98
110
  def fetch_brief_rewards
99
111
  route = [routes.brief, id, routes.brief_rewards].join('/')
100
112
  client.get(route)
@@ -0,0 +1,36 @@
1
+ require 'wes/data/api/model/base'
2
+ require 'wes/data/api/model/briefing_question'
3
+
4
+ module Wes
5
+ module Data
6
+ module API
7
+ module Model
8
+ class BriefingAnswer < Base
9
+ def id
10
+ ids_set? ? id_hash : nil
11
+ end
12
+
13
+ def question
14
+ map_objects(
15
+ @attributes.question,
16
+ Wes::Data::API::Model::BriefingQuestion
17
+ ).first
18
+ end
19
+
20
+ private
21
+
22
+ def ids_set?
23
+ !@attributes.brief_id.nil? && !@attributes.question_id.nil?
24
+ end
25
+
26
+ def id_hash
27
+ {
28
+ 'brief_id' => @attributes.brief_id,
29
+ 'question_id' => @attributes.question_id
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,12 @@
1
+ require 'wes/data/api/model/base'
2
+
3
+ module Wes
4
+ module Data
5
+ module API
6
+ module Model
7
+ class BriefingQuestion < Base
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -10,6 +10,7 @@ module Wes
10
10
  brand_user: 'brand-user',
11
11
  brands: 'brands',
12
12
  brief: 'brief',
13
+ briefing: 'briefing',
13
14
  brief_rewards: 'rewards',
14
15
  briefs: 'briefs',
15
16
  collectives: 'collectives',
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: 13.2.0
4
+ version: 13.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-05 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,6 +137,8 @@ files:
137
137
  - lib/wes/data/api/model/brief_answer.rb
138
138
  - lib/wes/data/api/model/brief_question.rb
139
139
  - lib/wes/data/api/model/brief_rewards.rb
140
+ - lib/wes/data/api/model/briefing_answer.rb
141
+ - lib/wes/data/api/model/briefing_question.rb
140
142
  - lib/wes/data/api/model/collective.rb
141
143
  - lib/wes/data/api/model/creator_user.rb
142
144
  - lib/wes/data/api/model/showcase.rb