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,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
@@ -14,7 +14,7 @@ module TrailerVote
14
14
  # The trivial push campaign is used to schedule a local push notification at a specified time.
15
15
  #
16
16
  class PushTrivialCampaign < BaseText
17
- media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 4 }
17
+ media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 5 }
18
18
 
19
19
  filters = ::MediaTypes::Scheme.new do
20
20
  attribute :filter do
@@ -62,6 +62,28 @@ module TrailerVote
62
62
 
63
63
  validations do
64
64
 
65
+ version 5 do
66
+ attribute :push_campaign_trivial do
67
+ link :action
68
+ link :self
69
+ link :rich_media, optional: true
70
+ attribute :message, String
71
+ attribute :schedule_at, Types::Iso8601
72
+ attribute :published_at, Types::Iso8601
73
+ attribute :archived_at, Types::Iso8601
74
+ merge filters
75
+ end
76
+
77
+ view 'create' do
78
+ attribute :push_campaign_trivial do
79
+ merge push_creation_base_v4
80
+ attribute :published_at, Types::Iso8601
81
+ attribute :archived_at, Types::Iso8601
82
+ merge filters_creation
83
+ end
84
+ end
85
+ end
86
+
65
87
  version 4 do
66
88
  attribute :push_campaign_trivial do
67
89
  link :action
@@ -3,6 +3,7 @@
3
3
  require_relative 'base_text'
4
4
  require_relative 'types/http_url'
5
5
  require_relative 'types/local_time'
6
+ require_relative 'types/iso8601'
6
7
 
7
8
  module TrailerVote
8
9
  module MediaTypes
@@ -12,9 +13,35 @@ module TrailerVote
12
13
  # The release push campaign is used to show a local push notification upon product release.
13
14
  #
14
15
  class ReleasePushCampaign < BaseText
15
- media_type 'release_push_campaign', defaults: { suffix: :json, version: 1 }
16
+ media_type 'release_push_campaign', defaults: { suffix: :json, version: 2 }
16
17
 
17
18
  validations do
19
+ version 2 do
20
+ attribute :release_push_campaign do
21
+ attribute :message, String
22
+ attribute :dnd_start, Types::LocalTime
23
+ attribute :dnd_end, Types::LocalTime
24
+ attribute :published_at, Types::Iso8601
25
+ attribute :archived_at, Types::Iso8601
26
+
27
+ link :action
28
+ link :self
29
+ link :rich_media, optional: true
30
+ end
31
+
32
+ view 'create' do
33
+ attribute :release_push_campaign do
34
+ attribute :translations, ::Hash
35
+ attribute :dnd_start, Types::LocalTime
36
+ attribute :dnd_end, Types::LocalTime
37
+
38
+ link :product
39
+ link :action
40
+ link :rich_media, optional: true
41
+ end
42
+ end
43
+ end
44
+
18
45
  version 1 do
19
46
  attribute :release_push_campaign do
20
47
  attribute :message, String
@@ -43,7 +70,7 @@ module TrailerVote
43
70
  registrations :release_push_campaign do
44
71
  view 'create', :create_release_push_campaign
45
72
 
46
- versions 1
73
+ versions 1,2
47
74
  end
48
75
  end
49
76
  end