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.
- checksums.yaml +4 -4
- data/.gitignore +12 -12
- data/.rubocop.yml +29 -29
- data/.travis.yml +19 -19
- data/CHANGELOG.md +82 -82
- data/Gemfile +6 -6
- data/Gemfile.lock +51 -51
- data/README.md +118 -118
- data/Rakefile +12 -12
- data/bin/console +16 -16
- data/bin/setup +8 -8
- data/lib/trailer_vote/media_types.rb +35 -33
- data/lib/trailer_vote/media_types/audio_fragment.rb +108 -108
- data/lib/trailer_vote/media_types/base_text.rb +22 -22
- data/lib/trailer_vote/media_types/carousel.rb +42 -42
- data/lib/trailer_vote/media_types/client_configuration.rb +35 -35
- data/lib/trailer_vote/media_types/configuration.rb +82 -61
- data/lib/trailer_vote/media_types/errors.rb +31 -31
- data/lib/trailer_vote/media_types/feedback.rb +50 -50
- data/lib/trailer_vote/media_types/feedback_listing.rb +49 -49
- data/lib/trailer_vote/media_types/fingerprint_binary.rb +67 -67
- data/lib/trailer_vote/media_types/interactive_player.rb +33 -33
- data/lib/trailer_vote/media_types/issue.rb +64 -64
- data/lib/trailer_vote/media_types/partials/image_links.rb +30 -30
- data/lib/trailer_vote/media_types/persona.rb +38 -38
- data/lib/trailer_vote/media_types/place.rb +106 -106
- data/lib/trailer_vote/media_types/product.rb +191 -191
- data/lib/trailer_vote/media_types/product_image.rb +96 -96
- data/lib/trailer_vote/media_types/product_lookup.rb +37 -37
- data/lib/trailer_vote/media_types/product_place_link.rb +36 -36
- data/lib/trailer_vote/media_types/product_video.rb +100 -100
- data/lib/trailer_vote/media_types/products_listing.rb +43 -43
- data/lib/trailer_vote/media_types/push_manifest.rb +33 -0
- data/lib/trailer_vote/media_types/push_trivial_campaign.rb +32 -0
- data/lib/trailer_vote/media_types/sentiment_feedback.rb +100 -100
- data/lib/trailer_vote/media_types/types/boolean.rb +15 -15
- data/lib/trailer_vote/media_types/types/formatted_url.rb +51 -51
- data/lib/trailer_vote/media_types/types/http_url.rb +23 -23
- data/lib/trailer_vote/media_types/types/influx_db_connection_url.rb +10 -10
- data/lib/trailer_vote/media_types/types/iso8601.rb +10 -10
- data/lib/trailer_vote/media_types/types/product_data_type.rb +15 -15
- data/lib/trailer_vote/media_types/types/product_image_type.rb +25 -25
- data/lib/trailer_vote/media_types/types/product_movie_handler.rb +16 -16
- data/lib/trailer_vote/media_types/types/product_movie_type.rb +17 -17
- data/lib/trailer_vote/media_types/types/uuid_v4.rb +10 -10
- data/lib/trailer_vote/media_types/types/vote_value.rb +17 -17
- data/lib/trailer_vote/media_types/version.rb +7 -7
- data/trailer_vote-media_types.gemspec +41 -41
- 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:
|
15
|
-
|
16
|
-
validations do
|
17
|
-
version
|
18
|
-
attribute :configuration do
|
19
|
-
link :self
|
20
|
-
link :place
|
21
|
-
link :
|
22
|
-
link :
|
23
|
-
link :
|
24
|
-
|
25
|
-
attribute :
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
link :
|
41
|
-
link :
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
attribute :
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|