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,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
-
9
- ##
10
- # Media Types for Client Configuration
11
- #
12
- # The client configuration media type is used when a client, such as the SDK clients, want to configure the
13
- # TrailerVote services. When accepted, the TrailerVote services may use the passed configurations to return specific
14
- # responses based on that configuration. For example, the {Configuration} from the root endpoint changed based on
15
- # the values.
16
- #
17
- class ClientConfiguration < BaseText
18
- media_type 'client_configuration', defaults: { suffix: :json, version: 1 }
19
-
20
- validations do
21
- version 1 do
22
- attribute :configuration do
23
- attribute :place, Types::HttpUrl
24
- attribute :persona, Types::HttpUrl
25
- end
26
- end
27
- end
28
-
29
- registrations :client_configuration do
30
- versions 1
31
- type_alias 'client-configuration'
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
+
9
+ ##
10
+ # Media Types for Client Configuration
11
+ #
12
+ # The client configuration media type is used when a client, such as the SDK clients, want to configure the
13
+ # TrailerVote services. When accepted, the TrailerVote services may use the passed configurations to return specific
14
+ # responses based on that configuration. For example, the {Configuration} from the root endpoint changed based on
15
+ # the values.
16
+ #
17
+ class ClientConfiguration < BaseText
18
+ media_type 'client_configuration', defaults: { suffix: :json, version: 1 }
19
+
20
+ validations do
21
+ version 1 do
22
+ attribute :configuration do
23
+ attribute :place, Types::HttpUrl
24
+ attribute :persona, Types::HttpUrl
25
+ end
26
+ end
27
+ end
28
+
29
+ registrations :client_configuration do
30
+ versions 1
31
+ type_alias 'client-configuration'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,61 +1,82 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/influx_db_connection_url'
5
- require_relative 'types/formatted_url'
6
-
7
- module TrailerVote
8
- module MediaTypes
9
-
10
- ##
11
- # Media Types for Configuration
12
- #
13
- class Configuration < BaseText
14
- media_type 'configuration', defaults: { suffix: :json, version: 2 }
15
-
16
- validations do
17
- version 2 do
18
- attribute :configuration do
19
- link :self
20
- link :place
21
- link :products
22
- link :product_lookup
23
- link :persona do
24
- attribute :href, Types.makeFormattedUrl(:uuid)
25
- attribute :templated, TrueClass
26
- end
27
- link :analytics do
28
- attribute :href, Types::InfluxDbConnectionUrl
29
- end
30
- link :telemetrics do
31
- attribute :href, Types::InfluxDbConnectionUrl
32
- end
33
- link :issues
34
- end
35
- end
36
-
37
- version 1 do
38
- attribute :configuration do
39
- link :place
40
- link :products
41
- link :feedback do
42
- attribute :href, Types.makeFormattedUrl(:uuid)
43
- attribute :templated, TrueClass
44
- end
45
- link :persona do
46
- attribute :href, Types.makeFormattedUrl(:uuid)
47
- attribute :templated, TrueClass
48
- end
49
- link :analytics do
50
- attribute :href, AllowNil(Types::InfluxDbConnectionUrl)
51
- end
52
- end
53
- end
54
- end
55
-
56
- registrations :configuration do
57
- versions 1, 2
58
- end
59
- end
60
- end
61
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/influx_db_connection_url'
5
+ require_relative 'types/formatted_url'
6
+
7
+ module TrailerVote
8
+ module MediaTypes
9
+
10
+ ##
11
+ # Media Types for Configuration
12
+ #
13
+ class Configuration < BaseText
14
+ media_type 'configuration', defaults: { suffix: :json, version: 3 }
15
+
16
+ validations do
17
+ version 3 do
18
+ attribute :configuration do
19
+ link :self
20
+ link :place
21
+ link :push_manifest
22
+ link :products
23
+ link :product_lookup
24
+ link :persona do
25
+ attribute :href, Types.makeFormattedUrl(:uuid)
26
+ attribute :templated, TrueClass
27
+ end
28
+ link :analytics do
29
+ attribute :href, Types::InfluxDbConnectionUrl
30
+ end
31
+ link :telemetrics do
32
+ attribute :href, Types::InfluxDbConnectionUrl
33
+ end
34
+ link :issues
35
+ end
36
+ end
37
+
38
+ version 2 do
39
+ attribute :configuration do
40
+ link :self
41
+ link :place
42
+ link :products
43
+ link :product_lookup
44
+ link :persona do
45
+ attribute :href, Types.makeFormattedUrl(:uuid)
46
+ attribute :templated, TrueClass
47
+ end
48
+ link :analytics do
49
+ attribute :href, Types::InfluxDbConnectionUrl
50
+ end
51
+ link :telemetrics do
52
+ attribute :href, Types::InfluxDbConnectionUrl
53
+ end
54
+ link :issues
55
+ end
56
+ end
57
+
58
+ version 1 do
59
+ attribute :configuration do
60
+ link :place
61
+ link :products
62
+ link :feedback do
63
+ attribute :href, Types.makeFormattedUrl(:uuid)
64
+ attribute :templated, TrueClass
65
+ end
66
+ link :persona do
67
+ attribute :href, Types.makeFormattedUrl(:uuid)
68
+ attribute :templated, TrueClass
69
+ end
70
+ link :analytics do
71
+ attribute :href, AllowNil(Types::InfluxDbConnectionUrl)
72
+ end
73
+ end
74
+ end
75
+ end
76
+
77
+ registrations :configuration do
78
+ versions 1, 2, 3
79
+ end
80
+ end
81
+ end
82
+ end
@@ -1,31 +1,31 @@
1
- # frozen_string_literal: true
2
-
3
- require 'trailer_vote/media_types/base_text'
4
-
5
- module TrailerVote
6
- module MediaTypes
7
- ##
8
- # Media Types for errors
9
- #
10
- # All errors given back to any TrailerVote service have this media type. In order to ensure correct error
11
- # content-type negotiation, clients SHOULD include the media type with a reduced quality param q in the Accept
12
- # header of each request. The RECOMMENDED value for q is 0.1.
13
- #
14
- class Errors < BaseText
15
- media_type 'errors', defaults: { suffix: :json, version: 1 }
16
-
17
- validations do
18
- version 1 do
19
- collection :errors do
20
- attribute :message, String
21
- attribute :code, AllowNil(String)
22
- end
23
- end
24
- end
25
-
26
- registrations :errors do
27
- versions 1
28
- end
29
- end
30
- end
31
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'trailer_vote/media_types/base_text'
4
+
5
+ module TrailerVote
6
+ module MediaTypes
7
+ ##
8
+ # Media Types for errors
9
+ #
10
+ # All errors given back to any TrailerVote service have this media type. In order to ensure correct error
11
+ # content-type negotiation, clients SHOULD include the media type with a reduced quality param q in the Accept
12
+ # header of each request. The RECOMMENDED value for q is 0.1.
13
+ #
14
+ class Errors < BaseText
15
+ media_type 'errors', defaults: { suffix: :json, version: 1 }
16
+
17
+ validations do
18
+ version 1 do
19
+ collection :errors do
20
+ attribute :message, String
21
+ attribute :code, AllowNil(String)
22
+ end
23
+ end
24
+ end
25
+
26
+ registrations :errors do
27
+ versions 1
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,50 +1,50 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/uuid_v4'
5
- require_relative 'types/vote_value'
6
- require_relative 'types/iso8601'
7
-
8
- module TrailerVote
9
- module MediaTypes
10
- class Feedback < BaseText
11
- media_type 'feedback', defaults: { suffix: :json, version: 1 }
12
-
13
- validations do
14
- version 1 do
15
- version_1_base = ::MediaTypes::Scheme.new do
16
- attribute :value, Types::VoteValue
17
- attribute :updated_at, Types::Iso8601
18
-
19
- link :audio_fragment
20
- link :product
21
- link :persona
22
- end
23
-
24
- attribute :feedback do
25
- merge version_1_base
26
- end
27
-
28
- view 'collection' do
29
- attribute :feedback do
30
- collection :_embedded, version_1_base, allow_empty: true
31
- not_strict
32
- end
33
- end
34
-
35
- view 'create' do
36
- attribute :feedback do
37
- attribute :persona, Types::UuidV4
38
- attribute :value, Types::VoteValue
39
- end
40
- end
41
- end
42
- end
43
-
44
- registrations :feedback do
45
- view 'create', :create_feedback
46
- view 'collection', :feedback_collection
47
- end
48
- end
49
- end
50
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/uuid_v4'
5
+ require_relative 'types/vote_value'
6
+ require_relative 'types/iso8601'
7
+
8
+ module TrailerVote
9
+ module MediaTypes
10
+ class Feedback < BaseText
11
+ media_type 'feedback', defaults: { suffix: :json, version: 1 }
12
+
13
+ validations do
14
+ version 1 do
15
+ version_1_base = ::MediaTypes::Scheme.new do
16
+ attribute :value, Types::VoteValue
17
+ attribute :updated_at, Types::Iso8601
18
+
19
+ link :audio_fragment
20
+ link :product
21
+ link :persona
22
+ end
23
+
24
+ attribute :feedback do
25
+ merge version_1_base
26
+ end
27
+
28
+ view 'collection' do
29
+ attribute :feedback do
30
+ collection :_embedded, version_1_base, allow_empty: true
31
+ not_strict
32
+ end
33
+ end
34
+
35
+ view 'create' do
36
+ attribute :feedback do
37
+ attribute :persona, Types::UuidV4
38
+ attribute :value, Types::VoteValue
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ registrations :feedback do
45
+ view 'create', :create_feedback
46
+ view 'collection', :feedback_collection
47
+ end
48
+ end
49
+ end
50
+ end
@@ -1,49 +1,49 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_text'
4
- require_relative 'types/vote_value'
5
- require_relative 'types/iso8601'
6
- require_relative 'partials/image_links'
7
-
8
- module TrailerVote
9
- module MediaTypes
10
- class FeedbackListing < BaseText
11
- media_type 'feedback_listing'
12
-
13
- defaults do
14
- suffix :json
15
- version 1
16
- end
17
-
18
- validations do
19
- version 1 do
20
- attribute :feedback_listing do
21
- collection :items, allow_empty: true do
22
- attribute :title, AllowNil(String)
23
- attribute :value, Types::VoteValue
24
- attribute :updated_at, Types::Iso8601
25
-
26
- link :audio_fragment
27
- link :product
28
- link :persona
29
- link :feedback
30
- link :interactive_player
31
-
32
- attribute :image, expected_type: AllowNil(::Hash), allow_empty: true, optional: true do
33
- attribute :_embedded, expected_type: AllowNil(::Hash), allow_empty: true do
34
- merge Partials::IMAGE_LINKS
35
- end
36
- end
37
- end
38
-
39
- link :self
40
- end
41
- end
42
- end
43
-
44
- registrations :feedback_listing do
45
- type_alias 'feedback-listing'
46
- end
47
- end
48
- end
49
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base_text'
4
+ require_relative 'types/vote_value'
5
+ require_relative 'types/iso8601'
6
+ require_relative 'partials/image_links'
7
+
8
+ module TrailerVote
9
+ module MediaTypes
10
+ class FeedbackListing < BaseText
11
+ media_type 'feedback_listing'
12
+
13
+ defaults do
14
+ suffix :json
15
+ version 1
16
+ end
17
+
18
+ validations do
19
+ version 1 do
20
+ attribute :feedback_listing do
21
+ collection :items, allow_empty: true do
22
+ attribute :title, AllowNil(String)
23
+ attribute :value, Types::VoteValue
24
+ attribute :updated_at, Types::Iso8601
25
+
26
+ link :audio_fragment
27
+ link :product
28
+ link :persona
29
+ link :feedback
30
+ link :interactive_player
31
+
32
+ attribute :image, expected_type: AllowNil(::Hash), allow_empty: true, optional: true do
33
+ attribute :_embedded, expected_type: AllowNil(::Hash), allow_empty: true do
34
+ merge Partials::IMAGE_LINKS
35
+ end
36
+ end
37
+ end
38
+
39
+ link :self
40
+ end
41
+ end
42
+ end
43
+
44
+ registrations :feedback_listing do
45
+ type_alias 'feedback-listing'
46
+ end
47
+ end
48
+ end
49
+ end