trailer_vote-media_types 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -12
  3. data/.rubocop.yml +29 -29
  4. data/.travis.yml +19 -19
  5. data/CHANGELOG.md +82 -82
  6. data/Gemfile +6 -6
  7. data/Gemfile.lock +51 -51
  8. data/README.md +118 -118
  9. data/Rakefile +12 -12
  10. data/bin/console +16 -16
  11. data/bin/setup +8 -8
  12. data/lib/trailer_vote/media_types.rb +35 -33
  13. data/lib/trailer_vote/media_types/audio_fragment.rb +108 -108
  14. data/lib/trailer_vote/media_types/base_text.rb +22 -22
  15. data/lib/trailer_vote/media_types/carousel.rb +42 -42
  16. data/lib/trailer_vote/media_types/client_configuration.rb +35 -35
  17. data/lib/trailer_vote/media_types/configuration.rb +82 -61
  18. data/lib/trailer_vote/media_types/errors.rb +31 -31
  19. data/lib/trailer_vote/media_types/feedback.rb +50 -50
  20. data/lib/trailer_vote/media_types/feedback_listing.rb +49 -49
  21. data/lib/trailer_vote/media_types/fingerprint_binary.rb +67 -67
  22. data/lib/trailer_vote/media_types/interactive_player.rb +33 -33
  23. data/lib/trailer_vote/media_types/issue.rb +64 -64
  24. data/lib/trailer_vote/media_types/partials/image_links.rb +30 -30
  25. data/lib/trailer_vote/media_types/persona.rb +38 -38
  26. data/lib/trailer_vote/media_types/place.rb +106 -106
  27. data/lib/trailer_vote/media_types/product.rb +191 -191
  28. data/lib/trailer_vote/media_types/product_image.rb +96 -96
  29. data/lib/trailer_vote/media_types/product_lookup.rb +37 -37
  30. data/lib/trailer_vote/media_types/product_place_link.rb +36 -36
  31. data/lib/trailer_vote/media_types/product_video.rb +100 -100
  32. data/lib/trailer_vote/media_types/products_listing.rb +43 -43
  33. data/lib/trailer_vote/media_types/push_manifest.rb +33 -0
  34. data/lib/trailer_vote/media_types/push_trivial_campaign.rb +32 -0
  35. data/lib/trailer_vote/media_types/sentiment_feedback.rb +100 -100
  36. data/lib/trailer_vote/media_types/types/boolean.rb +15 -15
  37. data/lib/trailer_vote/media_types/types/formatted_url.rb +51 -51
  38. data/lib/trailer_vote/media_types/types/http_url.rb +23 -23
  39. data/lib/trailer_vote/media_types/types/influx_db_connection_url.rb +10 -10
  40. data/lib/trailer_vote/media_types/types/iso8601.rb +10 -10
  41. data/lib/trailer_vote/media_types/types/product_data_type.rb +15 -15
  42. data/lib/trailer_vote/media_types/types/product_image_type.rb +25 -25
  43. data/lib/trailer_vote/media_types/types/product_movie_handler.rb +16 -16
  44. data/lib/trailer_vote/media_types/types/product_movie_type.rb +17 -17
  45. data/lib/trailer_vote/media_types/types/uuid_v4.rb +10 -10
  46. data/lib/trailer_vote/media_types/types/vote_value.rb +17 -17
  47. data/lib/trailer_vote/media_types/version.rb +7 -7
  48. data/trailer_vote-media_types.gemspec +41 -41
  49. metadata +8 -5
@@ -1,106 +1,106 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/uuid_v4'
5
- require_relative 'types/iso8601'
6
-
7
- module TrailerVote
8
- module MediaTypes
9
-
10
- ##
11
- # Media Types for places
12
- #
13
- # Each set of credentials has a Place associated to it. A place might be the HQ of an enterprise, or a physical
14
- # location on the map. You can always access all the data of your place and all the children, as the places in our
15
- # system are configured to be a tree.
16
- #
17
- class Place < BaseText
18
- media_type 'place', defaults: { suffix: :json, version: 2 }
19
-
20
- validations do
21
- index_scheme = ::MediaTypes::Scheme.new do
22
- attribute :places do
23
- collection :_index, allow_empty: true do
24
- attribute :href, String
25
- not_strict
26
- end
27
-
28
- not_strict
29
- end
30
- end
31
-
32
- version 2 do
33
- version_2_base = ::MediaTypes::Scheme.new do
34
- attribute :name, String
35
- attribute :parent_place, AllowNil(Types::UuidV4)
36
- attribute :expires_at, AllowNil(String)
37
- attribute :updated_at, Types::Iso8601
38
-
39
- link :self
40
- link :products_archive
41
- link :parent, allow_nil: true
42
- end
43
-
44
- attribute :place do
45
- merge version_2_base
46
- end
47
-
48
- view 'create' do
49
- attribute :place do
50
- attribute :name, String
51
- attribute :parent_place, String
52
- attribute :expires_at, AllowNil(Types::Iso8601)
53
- end
54
- end
55
-
56
- view 'collection' do
57
- attribute :places do
58
- collection :_embedded, version_2_base
59
- not_strict
60
- end
61
- end
62
-
63
- view 'index' do
64
- merge index_scheme
65
- end
66
- end
67
-
68
- version 1 do
69
- version_1_base = ::MediaTypes::Scheme.new do
70
- attribute :name, String
71
- attribute :parent_place, AllowNil(String)
72
- attribute :expires_at, AllowNil(String)
73
- attribute :updated_at, Types::Iso8601
74
-
75
- link :self
76
- link :products
77
- link :parent, allow_nil: true
78
- end
79
-
80
- attribute :place do
81
- merge version_1_base
82
- end
83
-
84
- view 'collection' do
85
- attribute :places do
86
- collection :_embedded, version_1_base
87
- not_strict
88
- end
89
- end
90
-
91
- view 'index' do
92
- merge index_scheme
93
- end
94
- end
95
- end
96
-
97
- registrations :place do
98
- view 'create', :create_place
99
- view 'index', :place_urls
100
- view 'collection', :places
101
-
102
- versions 1, 2
103
- end
104
- end
105
- end
106
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/uuid_v4'
5
+ require_relative 'types/iso8601'
6
+
7
+ module TrailerVote
8
+ module MediaTypes
9
+
10
+ ##
11
+ # Media Types for places
12
+ #
13
+ # Each set of credentials has a Place associated to it. A place might be the HQ of an enterprise, or a physical
14
+ # location on the map. You can always access all the data of your place and all the children, as the places in our
15
+ # system are configured to be a tree.
16
+ #
17
+ class Place < BaseText
18
+ media_type 'place', defaults: { suffix: :json, version: 2 }
19
+
20
+ validations do
21
+ index_scheme = ::MediaTypes::Scheme.new do
22
+ attribute :places do
23
+ collection :_index, allow_empty: true do
24
+ attribute :href, String
25
+ not_strict
26
+ end
27
+
28
+ not_strict
29
+ end
30
+ end
31
+
32
+ version 2 do
33
+ version_2_base = ::MediaTypes::Scheme.new do
34
+ attribute :name, String
35
+ attribute :parent_place, AllowNil(Types::UuidV4)
36
+ attribute :expires_at, AllowNil(String)
37
+ attribute :updated_at, Types::Iso8601
38
+
39
+ link :self
40
+ link :products_archive
41
+ link :parent, allow_nil: true
42
+ end
43
+
44
+ attribute :place do
45
+ merge version_2_base
46
+ end
47
+
48
+ view 'create' do
49
+ attribute :place do
50
+ attribute :name, String
51
+ attribute :parent_place, String
52
+ attribute :expires_at, AllowNil(Types::Iso8601)
53
+ end
54
+ end
55
+
56
+ view 'collection' do
57
+ attribute :places do
58
+ collection :_embedded, version_2_base
59
+ not_strict
60
+ end
61
+ end
62
+
63
+ view 'index' do
64
+ merge index_scheme
65
+ end
66
+ end
67
+
68
+ version 1 do
69
+ version_1_base = ::MediaTypes::Scheme.new do
70
+ attribute :name, String
71
+ attribute :parent_place, AllowNil(String)
72
+ attribute :expires_at, AllowNil(String)
73
+ attribute :updated_at, Types::Iso8601
74
+
75
+ link :self
76
+ link :products
77
+ link :parent, allow_nil: true
78
+ end
79
+
80
+ attribute :place do
81
+ merge version_1_base
82
+ end
83
+
84
+ view 'collection' do
85
+ attribute :places do
86
+ collection :_embedded, version_1_base
87
+ not_strict
88
+ end
89
+ end
90
+
91
+ view 'index' do
92
+ merge index_scheme
93
+ end
94
+ end
95
+ end
96
+
97
+ registrations :place do
98
+ view 'create', :create_place
99
+ view 'index', :place_urls
100
+ view 'collection', :places
101
+
102
+ versions 1, 2
103
+ end
104
+ end
105
+ end
106
+ end
@@ -1,191 +1,191 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/product_data_type'
5
- require_relative 'types/iso8601'
6
- require_relative 'types/http_url'
7
-
8
- module TrailerVote
9
- module MediaTypes
10
-
11
- ##
12
- # Media Types for Products
13
- #
14
- # Products are all things that are the subject of Audio Fragments (advertisements, trailers, sound bites). This can
15
- # be a book; a movie; a car; a drink; anything that would be a product in the real world. Recognition is done on the
16
- # audio fragments, not on products directly.
17
- #
18
- # A product has attachments, such as data, {ProductImage}, and recognizable {AudioFragment}.
19
- #
20
- class Product < BaseText
21
- media_type 'product', defaults: { suffix: :json, version: 2 }
22
-
23
- validations do
24
- index_scheme = ::MediaTypes::Scheme.new do
25
- attribute :products do
26
- collection :_index, allow_empty: true do
27
- attribute :href, Types::HttpUrl
28
- not_strict
29
- end
30
-
31
- not_strict
32
- end
33
- end
34
-
35
- version 2 do
36
- version_2_creation = ::MediaTypes::Scheme.new do
37
- attribute :name, String
38
- attribute :description, AllowNil(String)
39
-
40
- collection :product_identifiers do
41
- attribute :authority, String
42
- attribute :identifier, String
43
- end
44
-
45
- attribute :data do
46
- any do
47
- attribute :type, Types::ProductDataType
48
- attribute :type_version, Numeric
49
-
50
- attribute :translations do
51
- any do
52
- attribute :name, AllowNil(String), optional: true
53
- attribute :description, AllowNil(String), optional: true
54
- end
55
- end
56
-
57
- # Movie type properties
58
- collection :genres, String, optional: true, allow_empty: true
59
- attribute :mpaa_rating, AnyOf('G', 'PG', 'PG-13', 'R', 'NC-17', 'NR', NilClass), optional: true
60
- attribute :run_time, AllowNil(Numeric), optional: true
61
- attribute :release_date, AllowNil(Types::Iso8601), optional: true
62
- attribute :default_image_url, AllowNil(String), optional: true
63
-
64
- not_strict
65
- end
66
- end
67
-
68
- attribute :raw_data, optional: true do
69
- # noinspection RubyBlockToMethodReference
70
- not_strict
71
- end
72
- end
73
-
74
- version_2_base = ::MediaTypes::Scheme.new do
75
- attribute :updated_at, Types::Iso8601
76
- attribute :lock_version, Numeric
77
-
78
- merge version_2_creation
79
-
80
- link :self
81
- link :images
82
- link :videos
83
- link :places
84
- link :audio_fragments
85
- end
86
-
87
- attribute :product do
88
- merge version_2_base
89
- end
90
-
91
- view 'create' do
92
- attribute :product do
93
- merge version_2_creation
94
- end
95
- end
96
-
97
- view 'collection' do
98
- attribute :products do
99
- collection :_embedded, version_2_base
100
- not_strict
101
- end
102
- end
103
-
104
- view 'index' do
105
- merge index_scheme
106
- end
107
- end
108
-
109
- version 1 do
110
-
111
- version_1_creation = ::MediaTypes::Scheme.new do
112
- attribute :name, String
113
- attribute :description, AllowNil(String)
114
-
115
- collection :product_identifiers do
116
- attribute :authority, String
117
- attribute :identifier, String
118
- end
119
-
120
- attribute :data do
121
- any do
122
- attribute :type, Types::ProductDataType
123
- attribute :type_version, Numeric
124
- attribute :name, AllowNil(String)
125
- attribute :description, AllowNil(String)
126
-
127
- # Movie type properties
128
- collection :genres, String, optional: true, allow_empty: true
129
- attribute :mpaa_rating, AnyOf('G', 'PG', 'PG-13', 'R', 'NC-17', 'NR', NilClass), optional: true
130
- attribute :run_time, AllowNil(Numeric), optional: true
131
- attribute :release_date, AllowNil(Types::Iso8601), optional: true
132
- attribute :default_image_url, AllowNil(String), optional: true
133
-
134
- not_strict
135
- end
136
- end
137
-
138
- attribute :raw_data, optional: true do
139
- # noinspection RubyBlockToMethodReference
140
- not_strict
141
- end
142
- end
143
-
144
- version_1_base = ::MediaTypes::Scheme.new do
145
- attribute :updated_at, Types::Iso8601
146
- attribute :lock_version, Numeric
147
-
148
- merge version_1_creation
149
-
150
- link :self
151
- link :images
152
- link :videos
153
- link :places
154
- link :audio_fragments
155
- end
156
-
157
- attribute :product do
158
- merge version_1_base
159
- end
160
-
161
- view 'create' do
162
- attribute :product do
163
- merge version_1_creation
164
- end
165
- end
166
-
167
- view 'collection' do
168
- attribute :products do
169
- collection :_embedded, version_1_base
170
- not_strict
171
- end
172
- end
173
-
174
- view 'index' do
175
- merge index_scheme
176
- end
177
- end
178
- end
179
-
180
- registrations :product do
181
- view 'index', :product_urls
182
- view 'collection', :products
183
- view 'create', :create_product
184
-
185
- versions 1, 2
186
-
187
- type_alias 'product.movie'
188
- end
189
- end
190
- end
191
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/product_data_type'
5
+ require_relative 'types/iso8601'
6
+ require_relative 'types/http_url'
7
+
8
+ module TrailerVote
9
+ module MediaTypes
10
+
11
+ ##
12
+ # Media Types for Products
13
+ #
14
+ # Products are all things that are the subject of Audio Fragments (advertisements, trailers, sound bites). This can
15
+ # be a book; a movie; a car; a drink; anything that would be a product in the real world. Recognition is done on the
16
+ # audio fragments, not on products directly.
17
+ #
18
+ # A product has attachments, such as data, {ProductImage}, and recognizable {AudioFragment}.
19
+ #
20
+ class Product < BaseText
21
+ media_type 'product', defaults: { suffix: :json, version: 2 }
22
+
23
+ validations do
24
+ index_scheme = ::MediaTypes::Scheme.new do
25
+ attribute :products do
26
+ collection :_index, allow_empty: true do
27
+ attribute :href, Types::HttpUrl
28
+ not_strict
29
+ end
30
+
31
+ not_strict
32
+ end
33
+ end
34
+
35
+ version 2 do
36
+ version_2_creation = ::MediaTypes::Scheme.new do
37
+ attribute :name, String
38
+ attribute :description, AllowNil(String)
39
+
40
+ collection :product_identifiers do
41
+ attribute :authority, String
42
+ attribute :identifier, String
43
+ end
44
+
45
+ attribute :data do
46
+ any do
47
+ attribute :type, Types::ProductDataType
48
+ attribute :type_version, Numeric
49
+
50
+ attribute :translations do
51
+ any do
52
+ attribute :name, AllowNil(String), optional: true
53
+ attribute :description, AllowNil(String), optional: true
54
+ end
55
+ end
56
+
57
+ # Movie type properties
58
+ collection :genres, String, optional: true, allow_empty: true
59
+ attribute :mpaa_rating, AnyOf('G', 'PG', 'PG-13', 'R', 'NC-17', 'NR', NilClass), optional: true
60
+ attribute :run_time, AllowNil(Numeric), optional: true
61
+ attribute :release_date, AllowNil(Types::Iso8601), optional: true
62
+ attribute :default_image_url, AllowNil(String), optional: true
63
+
64
+ not_strict
65
+ end
66
+ end
67
+
68
+ attribute :raw_data, optional: true do
69
+ # noinspection RubyBlockToMethodReference
70
+ not_strict
71
+ end
72
+ end
73
+
74
+ version_2_base = ::MediaTypes::Scheme.new do
75
+ attribute :updated_at, Types::Iso8601
76
+ attribute :lock_version, Numeric
77
+
78
+ merge version_2_creation
79
+
80
+ link :self
81
+ link :images
82
+ link :videos
83
+ link :places
84
+ link :audio_fragments
85
+ end
86
+
87
+ attribute :product do
88
+ merge version_2_base
89
+ end
90
+
91
+ view 'create' do
92
+ attribute :product do
93
+ merge version_2_creation
94
+ end
95
+ end
96
+
97
+ view 'collection' do
98
+ attribute :products do
99
+ collection :_embedded, version_2_base
100
+ not_strict
101
+ end
102
+ end
103
+
104
+ view 'index' do
105
+ merge index_scheme
106
+ end
107
+ end
108
+
109
+ version 1 do
110
+
111
+ version_1_creation = ::MediaTypes::Scheme.new do
112
+ attribute :name, String
113
+ attribute :description, AllowNil(String)
114
+
115
+ collection :product_identifiers do
116
+ attribute :authority, String
117
+ attribute :identifier, String
118
+ end
119
+
120
+ attribute :data do
121
+ any do
122
+ attribute :type, Types::ProductDataType
123
+ attribute :type_version, Numeric
124
+ attribute :name, AllowNil(String)
125
+ attribute :description, AllowNil(String)
126
+
127
+ # Movie type properties
128
+ collection :genres, String, optional: true, allow_empty: true
129
+ attribute :mpaa_rating, AnyOf('G', 'PG', 'PG-13', 'R', 'NC-17', 'NR', NilClass), optional: true
130
+ attribute :run_time, AllowNil(Numeric), optional: true
131
+ attribute :release_date, AllowNil(Types::Iso8601), optional: true
132
+ attribute :default_image_url, AllowNil(String), optional: true
133
+
134
+ not_strict
135
+ end
136
+ end
137
+
138
+ attribute :raw_data, optional: true do
139
+ # noinspection RubyBlockToMethodReference
140
+ not_strict
141
+ end
142
+ end
143
+
144
+ version_1_base = ::MediaTypes::Scheme.new do
145
+ attribute :updated_at, Types::Iso8601
146
+ attribute :lock_version, Numeric
147
+
148
+ merge version_1_creation
149
+
150
+ link :self
151
+ link :images
152
+ link :videos
153
+ link :places
154
+ link :audio_fragments
155
+ end
156
+
157
+ attribute :product do
158
+ merge version_1_base
159
+ end
160
+
161
+ view 'create' do
162
+ attribute :product do
163
+ merge version_1_creation
164
+ end
165
+ end
166
+
167
+ view 'collection' do
168
+ attribute :products do
169
+ collection :_embedded, version_1_base
170
+ not_strict
171
+ end
172
+ end
173
+
174
+ view 'index' do
175
+ merge index_scheme
176
+ end
177
+ end
178
+ end
179
+
180
+ registrations :product do
181
+ view 'index', :product_urls
182
+ view 'collection', :products
183
+ view 'create', :create_product
184
+
185
+ versions 1, 2
186
+
187
+ type_alias 'product.movie'
188
+ end
189
+ end
190
+ end
191
+ end