trailer_vote-media_types 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) 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 +8 -8
  7. data/Gemfile.lock +49 -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 +1 -0
  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 +139 -139
  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/ordered_fragment.rb +35 -35
  25. data/lib/trailer_vote/media_types/partials/image_links.rb +30 -30
  26. data/lib/trailer_vote/media_types/persona.rb +47 -47
  27. data/lib/trailer_vote/media_types/place.rb +143 -143
  28. data/lib/trailer_vote/media_types/product.rb +191 -191
  29. data/lib/trailer_vote/media_types/product_image.rb +96 -96
  30. data/lib/trailer_vote/media_types/product_lookup.rb +37 -37
  31. data/lib/trailer_vote/media_types/product_place_link.rb +36 -36
  32. data/lib/trailer_vote/media_types/product_video.rb +100 -100
  33. data/lib/trailer_vote/media_types/products_listing.rb +43 -43
  34. data/lib/trailer_vote/media_types/push_consent.rb +44 -44
  35. data/lib/trailer_vote/media_types/push_manifest.rb +44 -44
  36. data/lib/trailer_vote/media_types/push_token_android.rb +41 -41
  37. data/lib/trailer_vote/media_types/push_token_index.rb +42 -42
  38. data/lib/trailer_vote/media_types/push_token_ios.rb +41 -41
  39. data/lib/trailer_vote/media_types/push_trivial_campaign.rb +219 -219
  40. data/lib/trailer_vote/media_types/release_push_campaign.rb +77 -77
  41. data/lib/trailer_vote/media_types/sentiment_feedback.rb +100 -100
  42. data/lib/trailer_vote/media_types/types/boolean.rb +15 -15
  43. data/lib/trailer_vote/media_types/types/formatted_url.rb +51 -51
  44. data/lib/trailer_vote/media_types/types/http_url.rb +23 -23
  45. data/lib/trailer_vote/media_types/types/influx_db_connection_url.rb +10 -10
  46. data/lib/trailer_vote/media_types/types/iso8601.rb +10 -10
  47. data/lib/trailer_vote/media_types/types/local_time.rb +11 -11
  48. data/lib/trailer_vote/media_types/types/product_data_type.rb +15 -15
  49. data/lib/trailer_vote/media_types/types/product_image_type.rb +25 -25
  50. data/lib/trailer_vote/media_types/types/product_movie_handler.rb +16 -16
  51. data/lib/trailer_vote/media_types/types/product_movie_type.rb +17 -17
  52. data/lib/trailer_vote/media_types/types/uuid_v4.rb +10 -10
  53. data/lib/trailer_vote/media_types/types/vote_value.rb +17 -17
  54. data/lib/trailer_vote/media_types/version.rb +7 -7
  55. data/lib/trailer_vote/media_types/vista_config.rb +37 -0
  56. data/trailer_vote-media_types.gemspec +43 -43
  57. metadata +6 -5
@@ -1,43 +1,43 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'partials/image_links'
5
- require_relative 'types/iso8601'
6
-
7
- module TrailerVote
8
- module MediaTypes
9
- class ProductsListing < BaseText
10
- media_type 'products_listing'
11
-
12
- defaults do
13
- suffix :json
14
- version 1
15
- end
16
-
17
- validations do
18
- version 1 do
19
- attribute :products_listing do
20
- collection :items, allow_empty: true do
21
- attribute :title, AllowNil(String)
22
- attribute :publish_date, AllowNil(Types::Iso8601)
23
-
24
- link :product
25
-
26
- attribute :image, expected_type: AllowNil(::Hash), allow_empty: true, optional: true do
27
- attribute :_embedded, expected_type: AllowNil(::Hash), allow_empty: true do
28
- merge Partials::IMAGE_LINKS
29
- end
30
- end
31
- end
32
-
33
- link :self
34
- end
35
- end
36
- end
37
-
38
- registrations :products_listing do
39
- type_alias 'products-listing'
40
- end
41
- end
42
- end
43
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'partials/image_links'
5
+ require_relative 'types/iso8601'
6
+
7
+ module TrailerVote
8
+ module MediaTypes
9
+ class ProductsListing < BaseText
10
+ media_type 'products_listing'
11
+
12
+ defaults do
13
+ suffix :json
14
+ version 1
15
+ end
16
+
17
+ validations do
18
+ version 1 do
19
+ attribute :products_listing do
20
+ collection :items, allow_empty: true do
21
+ attribute :title, AllowNil(String)
22
+ attribute :publish_date, AllowNil(Types::Iso8601)
23
+
24
+ link :product
25
+
26
+ attribute :image, expected_type: AllowNil(::Hash), allow_empty: true, optional: true do
27
+ attribute :_embedded, expected_type: AllowNil(::Hash), allow_empty: true do
28
+ merge Partials::IMAGE_LINKS
29
+ end
30
+ end
31
+ end
32
+
33
+ link :self
34
+ end
35
+ end
36
+ end
37
+
38
+ registrations :products_listing do
39
+ type_alias 'products-listing'
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,44 +1,44 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/boolean'
5
- require_relative 'types/iso8601'
6
-
7
- module TrailerVote
8
- module MediaTypes
9
- class PushConsent < BaseText
10
- media_type 'push_consent', defaults: { suffix: :json, version: 1 }
11
-
12
- validations do
13
- version 1 do
14
- version_1_base = ::MediaTypes::Scheme.new do
15
- attribute :region, String
16
- attribute :opt_in, Types::Boolean
17
- attribute :signed_at, Types::Iso8601
18
- end
19
-
20
- attribute :push_consent do
21
- merge version_1_base
22
-
23
- link :tos
24
- link :tokens
25
- end
26
-
27
- view 'create' do
28
- attribute :push_consent do
29
- merge version_1_base
30
-
31
- link :tos
32
- end
33
- end
34
- end
35
- end
36
-
37
- registrations :push_consent do
38
- view 'create', :create_push_consent
39
-
40
- versions 1
41
- end
42
- end
43
- end
44
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/boolean'
5
+ require_relative 'types/iso8601'
6
+
7
+ module TrailerVote
8
+ module MediaTypes
9
+ class PushConsent < BaseText
10
+ media_type 'push_consent', defaults: { suffix: :json, version: 1 }
11
+
12
+ validations do
13
+ version 1 do
14
+ version_1_base = ::MediaTypes::Scheme.new do
15
+ attribute :region, String
16
+ attribute :opt_in, Types::Boolean
17
+ attribute :signed_at, Types::Iso8601
18
+ end
19
+
20
+ attribute :push_consent do
21
+ merge version_1_base
22
+
23
+ link :tos
24
+ link :tokens
25
+ end
26
+
27
+ view 'create' do
28
+ attribute :push_consent do
29
+ merge version_1_base
30
+
31
+ link :tos
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ registrations :push_consent do
38
+ view 'create', :create_push_consent
39
+
40
+ versions 1
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,44 +1,44 @@
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
-
9
- ##
10
- # Media Type for Push Manifest
11
- #
12
- # The push manifest is a list of active push campaigns
13
- #
14
- class PushManifest < BaseText
15
- media_type 'push_manifest', defaults: { suffix: :json, version: 2 }
16
-
17
- validations do
18
-
19
- version 2 do
20
- attribute :push_manifest do
21
- collection :campaigns, allow_empty: true do
22
- link :audio_fragment, optional: true
23
- link :product, optional: true
24
- link :campaign
25
- end
26
- end
27
- end
28
-
29
- version 1 do
30
- attribute :push_manifest do
31
- collection :campaigns, allow_empty: true do
32
- link :audio_fragment
33
- link :campaign
34
- end
35
- end
36
- end
37
- end
38
-
39
- registrations :push_manifest do
40
- versions 1
41
- end
42
- end
43
- end
44
- 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
+
9
+ ##
10
+ # Media Type for Push Manifest
11
+ #
12
+ # The push manifest is a list of active push campaigns
13
+ #
14
+ class PushManifest < BaseText
15
+ media_type 'push_manifest', defaults: { suffix: :json, version: 2 }
16
+
17
+ validations do
18
+
19
+ version 2 do
20
+ attribute :push_manifest do
21
+ collection :campaigns, allow_empty: true do
22
+ link :audio_fragment, optional: true
23
+ link :product, optional: true
24
+ link :campaign
25
+ end
26
+ end
27
+ end
28
+
29
+ version 1 do
30
+ attribute :push_manifest do
31
+ collection :campaigns, allow_empty: true do
32
+ link :audio_fragment
33
+ link :campaign
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ registrations :push_manifest do
40
+ versions 1
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,41 +1,41 @@
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
- class PushTokenAndroid < BaseText
9
- media_type 'push_token_android', defaults: { suffix: :json, version: 1 }
10
-
11
- validations do
12
- version 1 do
13
- version_1_base = ::MediaTypes::Scheme.new do
14
- attribute :token, String
15
- attribute :app_id, String
16
- attribute :device_id, Types::UuidV4
17
- end
18
-
19
- attribute :push_token_android do
20
- merge version_1_base
21
-
22
- link :self
23
- end
24
-
25
- view 'create' do
26
- attribute :push_token_android do
27
- merge version_1_base
28
- end
29
- end
30
- end
31
- end
32
-
33
- registrations :push_token_android do
34
- view 'create', :create_push_token_android
35
-
36
- versions 1
37
- end
38
-
39
- end
40
- end
41
- 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
+ class PushTokenAndroid < BaseText
9
+ media_type 'push_token_android', defaults: { suffix: :json, version: 1 }
10
+
11
+ validations do
12
+ version 1 do
13
+ version_1_base = ::MediaTypes::Scheme.new do
14
+ attribute :token, String
15
+ attribute :app_id, String
16
+ attribute :device_id, Types::UuidV4
17
+ end
18
+
19
+ attribute :push_token_android do
20
+ merge version_1_base
21
+
22
+ link :self
23
+ end
24
+
25
+ view 'create' do
26
+ attribute :push_token_android do
27
+ merge version_1_base
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ registrations :push_token_android do
34
+ view 'create', :create_push_token_android
35
+
36
+ versions 1
37
+ end
38
+
39
+ end
40
+ end
41
+ end
@@ -1,42 +1,42 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/http_url'
5
- require_relative 'types/uuid_v4'
6
-
7
- module TrailerVote
8
- module MediaTypes
9
- class PushTokenIndex < BaseText
10
- media_type 'push_token_index', defaults: { suffix: :json, version: 1 }
11
-
12
- validations do
13
- version 1 do
14
- attribute :push_token_index do
15
- collection :push_tokens, allow_empty: true do
16
- attribute :device_id, Types::UuidV4
17
-
18
- link :push_token
19
- end
20
- end
21
-
22
- view 'index' do
23
- attribute :push_token_index do
24
- collection :_index, allow_empty: true do
25
- attribute :device_id, Types::UuidV4
26
-
27
- link :push_token
28
- end
29
- not_strict
30
- end
31
- end
32
- end
33
- end
34
-
35
- registrations :push_token_index do
36
- view 'index', :push_token_index
37
-
38
- versions 1
39
- end
40
- end
41
- end
42
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/http_url'
5
+ require_relative 'types/uuid_v4'
6
+
7
+ module TrailerVote
8
+ module MediaTypes
9
+ class PushTokenIndex < BaseText
10
+ media_type 'push_token_index', defaults: { suffix: :json, version: 1 }
11
+
12
+ validations do
13
+ version 1 do
14
+ attribute :push_token_index do
15
+ collection :push_tokens, allow_empty: true do
16
+ attribute :device_id, Types::UuidV4
17
+
18
+ link :push_token
19
+ end
20
+ end
21
+
22
+ view 'index' do
23
+ attribute :push_token_index do
24
+ collection :_index, allow_empty: true do
25
+ attribute :device_id, Types::UuidV4
26
+
27
+ link :push_token
28
+ end
29
+ not_strict
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ registrations :push_token_index do
36
+ view 'index', :push_token_index
37
+
38
+ versions 1
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,41 +1,41 @@
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
- class PushTokenIos < BaseText
9
- media_type 'push_token_ios', defaults: { suffix: :json, version: 1 }
10
-
11
- validations do
12
- version 1 do
13
- version_1_base = ::MediaTypes::Scheme.new do
14
- attribute :token, String
15
- attribute :app_id, String
16
- attribute :device_id, Types::UuidV4
17
- end
18
-
19
- attribute :push_token_ios do
20
- merge version_1_base
21
-
22
- link :self
23
- end
24
-
25
- view 'create' do
26
- attribute :push_token_ios do
27
- merge version_1_base
28
- end
29
- end
30
- end
31
- end
32
-
33
- registrations :push_token_ios do
34
- view 'create', :create_push_token_ios
35
-
36
- versions 1
37
- end
38
-
39
- end
40
- end
41
- 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
+ class PushTokenIos < BaseText
9
+ media_type 'push_token_ios', defaults: { suffix: :json, version: 1 }
10
+
11
+ validations do
12
+ version 1 do
13
+ version_1_base = ::MediaTypes::Scheme.new do
14
+ attribute :token, String
15
+ attribute :app_id, String
16
+ attribute :device_id, Types::UuidV4
17
+ end
18
+
19
+ attribute :push_token_ios do
20
+ merge version_1_base
21
+
22
+ link :self
23
+ end
24
+
25
+ view 'create' do
26
+ attribute :push_token_ios do
27
+ merge version_1_base
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ registrations :push_token_ios do
34
+ view 'create', :create_push_token_ios
35
+
36
+ versions 1
37
+ end
38
+
39
+ end
40
+ end
41
+ end