trailer_vote-media_types 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -12
  3. data/.rubocop.yml +29 -29
  4. data/.travis.yml +18 -18
  5. data/CHANGELOG.md +82 -82
  6. data/Gemfile +6 -6
  7. data/Gemfile.lock +5 -5
  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/audio_fragment.rb +108 -108
  13. data/lib/trailer_vote/media_types/base_text.rb +22 -22
  14. data/lib/trailer_vote/media_types/carousel.rb +42 -42
  15. data/lib/trailer_vote/media_types/client_configuration.rb +35 -35
  16. data/lib/trailer_vote/media_types/configuration.rb +139 -139
  17. data/lib/trailer_vote/media_types/errors.rb +31 -31
  18. data/lib/trailer_vote/media_types/feedback.rb +50 -50
  19. data/lib/trailer_vote/media_types/feedback_listing.rb +49 -49
  20. data/lib/trailer_vote/media_types/fingerprint_binary.rb +67 -67
  21. data/lib/trailer_vote/media_types/interactive_player.rb +33 -33
  22. data/lib/trailer_vote/media_types/issue.rb +64 -64
  23. data/lib/trailer_vote/media_types/ordered_fragment.rb +35 -35
  24. data/lib/trailer_vote/media_types/partials/image_links.rb +30 -30
  25. data/lib/trailer_vote/media_types/persona.rb +47 -47
  26. data/lib/trailer_vote/media_types/place.rb +143 -143
  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_consent.rb +44 -44
  34. data/lib/trailer_vote/media_types/push_manifest.rb +44 -44
  35. data/lib/trailer_vote/media_types/push_token_android.rb +41 -41
  36. data/lib/trailer_vote/media_types/push_token_index.rb +42 -42
  37. data/lib/trailer_vote/media_types/push_token_ios.rb +41 -41
  38. data/lib/trailer_vote/media_types/push_trivial_campaign.rb +23 -1
  39. data/lib/trailer_vote/media_types/release_push_campaign.rb +29 -2
  40. data/lib/trailer_vote/media_types/sentiment_feedback.rb +100 -100
  41. data/lib/trailer_vote/media_types/types/boolean.rb +15 -15
  42. data/lib/trailer_vote/media_types/types/formatted_url.rb +51 -51
  43. data/lib/trailer_vote/media_types/types/http_url.rb +23 -23
  44. data/lib/trailer_vote/media_types/types/influx_db_connection_url.rb +10 -10
  45. data/lib/trailer_vote/media_types/types/iso8601.rb +10 -10
  46. data/lib/trailer_vote/media_types/types/local_time.rb +11 -11
  47. data/lib/trailer_vote/media_types/types/product_data_type.rb +15 -15
  48. data/lib/trailer_vote/media_types/types/product_image_type.rb +25 -25
  49. data/lib/trailer_vote/media_types/types/product_movie_handler.rb +16 -16
  50. data/lib/trailer_vote/media_types/types/product_movie_type.rb +17 -17
  51. data/lib/trailer_vote/media_types/types/uuid_v4.rb +10 -10
  52. data/lib/trailer_vote/media_types/types/vote_value.rb +17 -17
  53. data/lib/trailer_vote/media_types/version.rb +1 -1
  54. data/trailer_vote-media_types.gemspec +2 -2
  55. metadata +7 -7
@@ -1,33 +1,33 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
-
5
- module TrailerVote
6
- module MediaTypes
7
- class InteractivePlayer < BaseText
8
- media_type 'interactive_player'
9
-
10
- defaults do
11
- suffix :json
12
- version 1
13
- end
14
-
15
- validations do
16
- version 1 do
17
- attribute :interactive_player do
18
- attribute :title, AllowNil(String)
19
-
20
- link :self
21
- link :advert
22
- link :direct
23
- link :product
24
- end
25
- end
26
- end
27
-
28
- registrations :interactive_player do
29
- type_alias 'interactive-player'
30
- end
31
- end
32
- end
33
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+
5
+ module TrailerVote
6
+ module MediaTypes
7
+ class InteractivePlayer < BaseText
8
+ media_type 'interactive_player'
9
+
10
+ defaults do
11
+ suffix :json
12
+ version 1
13
+ end
14
+
15
+ validations do
16
+ version 1 do
17
+ attribute :interactive_player do
18
+ attribute :title, AllowNil(String)
19
+
20
+ link :self
21
+ link :advert
22
+ link :direct
23
+ link :product
24
+ end
25
+ end
26
+ end
27
+
28
+ registrations :interactive_player do
29
+ type_alias 'interactive-player'
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,64 +1,64 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/iso8601'
5
-
6
- module TrailerVote
7
- module MediaTypes
8
- class Issue < BaseText
9
- media_type 'issue', defaults: { suffix: :json, version: 1 }
10
-
11
- validations do
12
- index_scheme = ::MediaTypes::Scheme.new do
13
- attribute :issues do
14
- collection :_index, allow_empty: true do
15
- attribute :href, Types::HttpUrl
16
- not_strict
17
- end
18
-
19
- not_strict
20
- end
21
- end
22
-
23
- version 1 do
24
- version_1_base = ::MediaTypes::Scheme.new do
25
- attribute :error_name, String
26
- attribute :error_message, String
27
-
28
- attribute :rescue_context do
29
- attribute :caller, String
30
- attribute :args, ::Hash, allow_empty: true do
31
- not_strict
32
- end
33
- end
34
- end
35
-
36
- attribute :issue do
37
- merge version_1_base
38
- attribute :updated_at, Types::Iso8601
39
-
40
- link :self
41
- end
42
-
43
- view 'create' do
44
- attribute :issue do
45
- merge version_1_base
46
- end
47
- end
48
-
49
- view 'index' do
50
- merge index_scheme
51
- end
52
- end
53
- end
54
-
55
- registrations :issue do
56
- view 'create', :create_issue
57
- view 'index', :issue_urls
58
-
59
- versions 1
60
- end
61
-
62
- end
63
- end
64
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/iso8601'
5
+
6
+ module TrailerVote
7
+ module MediaTypes
8
+ class Issue < BaseText
9
+ media_type 'issue', defaults: { suffix: :json, version: 1 }
10
+
11
+ validations do
12
+ index_scheme = ::MediaTypes::Scheme.new do
13
+ attribute :issues do
14
+ collection :_index, allow_empty: true do
15
+ attribute :href, Types::HttpUrl
16
+ not_strict
17
+ end
18
+
19
+ not_strict
20
+ end
21
+ end
22
+
23
+ version 1 do
24
+ version_1_base = ::MediaTypes::Scheme.new do
25
+ attribute :error_name, String
26
+ attribute :error_message, String
27
+
28
+ attribute :rescue_context do
29
+ attribute :caller, String
30
+ attribute :args, ::Hash, allow_empty: true do
31
+ not_strict
32
+ end
33
+ end
34
+ end
35
+
36
+ attribute :issue do
37
+ merge version_1_base
38
+ attribute :updated_at, Types::Iso8601
39
+
40
+ link :self
41
+ end
42
+
43
+ view 'create' do
44
+ attribute :issue do
45
+ merge version_1_base
46
+ end
47
+ end
48
+
49
+ view 'index' do
50
+ merge index_scheme
51
+ end
52
+ end
53
+ end
54
+
55
+ registrations :issue do
56
+ view 'create', :create_issue
57
+ view 'index', :issue_urls
58
+
59
+ versions 1
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -1,35 +1,35 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/http_url'
5
-
6
- module TrailerVote
7
- module MediaTypes
8
- class OrderedFragment < BaseText
9
-
10
- media_type 'ordered_fragment', defaults: { suffix: :json, version: 1, view: :index }
11
-
12
- validations do
13
- version 1 do
14
- view 'index' do
15
- attribute :ordered_fragments do
16
- collection :_index, allow_empty: true do
17
- attribute :href, Types::HttpUrl
18
- attribute :q, Float
19
- end
20
- not_strict
21
- end
22
- end
23
- end
24
- end
25
-
26
- registrations :audio_fragment do
27
- view 'index', :ordered_fragment_urls
28
-
29
- versions 1
30
-
31
- type_alias 'ordered-fragment'
32
- end
33
- end
34
- end
35
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/http_url'
5
+
6
+ module TrailerVote
7
+ module MediaTypes
8
+ class OrderedFragment < BaseText
9
+
10
+ media_type 'ordered_fragment', defaults: { suffix: :json, version: 1, view: :index }
11
+
12
+ validations do
13
+ version 1 do
14
+ view 'index' do
15
+ attribute :ordered_fragments do
16
+ collection :_index, allow_empty: true do
17
+ attribute :href, Types::HttpUrl
18
+ attribute :q, Float
19
+ end
20
+ not_strict
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ registrations :audio_fragment do
27
+ view 'index', :ordered_fragment_urls
28
+
29
+ versions 1
30
+
31
+ type_alias 'ordered-fragment'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,30 +1,30 @@
1
- # frozen_string_literal: true
2
-
3
- require 'media_types'
4
- require_relative '../types/product_image_type'
5
-
6
- module TrailerVote
7
- module MediaTypes
8
- module Partials
9
- IMAGE_LINKS = ::MediaTypes::Scheme.new do
10
- link :self do
11
- attribute :type, Types::ProductImageType, optional: true
12
- end
13
-
14
- link :original do
15
- attribute :content_digest, String, optional: true
16
- attribute :width, Numeric, optional: true
17
- attribute :height, Numeric, optional: true
18
- end
19
-
20
- %i[thumbnail xlarge large medium small xsmall].each do |size|
21
- link size, optional: true do
22
- attribute :content_digest, String, optional: true
23
- attribute :width, Numeric, optional: true
24
- attribute :height, Numeric, optional: true
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'media_types'
4
+ require_relative '../types/product_image_type'
5
+
6
+ module TrailerVote
7
+ module MediaTypes
8
+ module Partials
9
+ IMAGE_LINKS = ::MediaTypes::Scheme.new do
10
+ link :self do
11
+ attribute :type, Types::ProductImageType, optional: true
12
+ end
13
+
14
+ link :original do
15
+ attribute :content_digest, String, optional: true
16
+ attribute :width, Numeric, optional: true
17
+ attribute :height, Numeric, optional: true
18
+ end
19
+
20
+ %i[thumbnail xlarge large medium small xsmall].each do |size|
21
+ link size, optional: true do
22
+ attribute :content_digest, String, optional: true
23
+ attribute :width, Numeric, optional: true
24
+ attribute :height, Numeric, optional: true
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,47 +1,47 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/uuid_v4'
5
-
6
- module TrailerVote
7
- module MediaTypes
8
-
9
- ##
10
- # Media Types for Persona
11
- #
12
- # A Persona is a uniquely identified person / a unique device. When someone uses the SDK, the client MUST generate a
13
- # UUID v4 and use that as Persona. This allows the API to link Feedback on Audio Fragments to a Persona, and MAY act
14
- # as likes/dislikes (interests/disinterests).
15
- #
16
- class Persona < BaseText
17
- media_type 'persona', defaults: { suffix: :json, version: 2 }
18
-
19
- validations do
20
- version 1 do
21
- attribute :persona do
22
- attribute :id, Types::UuidV4
23
- link :self
24
- link :feedback
25
- end
26
-
27
- view('create') {}
28
- end
29
-
30
- version 2 do
31
- attribute :persona do
32
- attribute :id, Types::UuidV4
33
- link :self
34
- link :feedback
35
- link :push_consent
36
- end
37
- end
38
- end
39
-
40
- registrations :persona do
41
- view 'create', :create_persona
42
-
43
- versions 1, 2
44
- end
45
- end
46
- end
47
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/uuid_v4'
5
+
6
+ module TrailerVote
7
+ module MediaTypes
8
+
9
+ ##
10
+ # Media Types for Persona
11
+ #
12
+ # A Persona is a uniquely identified person / a unique device. When someone uses the SDK, the client MUST generate a
13
+ # UUID v4 and use that as Persona. This allows the API to link Feedback on Audio Fragments to a Persona, and MAY act
14
+ # as likes/dislikes (interests/disinterests).
15
+ #
16
+ class Persona < BaseText
17
+ media_type 'persona', defaults: { suffix: :json, version: 2 }
18
+
19
+ validations do
20
+ version 1 do
21
+ attribute :persona do
22
+ attribute :id, Types::UuidV4
23
+ link :self
24
+ link :feedback
25
+ end
26
+
27
+ view('create') {}
28
+ end
29
+
30
+ version 2 do
31
+ attribute :persona do
32
+ attribute :id, Types::UuidV4
33
+ link :self
34
+ link :feedback
35
+ link :push_consent
36
+ end
37
+ end
38
+ end
39
+
40
+ registrations :persona do
41
+ view 'create', :create_persona
42
+
43
+ versions 1, 2
44
+ end
45
+ end
46
+ end
47
+ end