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.
- checksums.yaml +4 -4
- data/.gitignore +12 -12
- data/.rubocop.yml +29 -29
- data/.travis.yml +18 -18
- data/CHANGELOG.md +82 -82
- data/Gemfile +8 -8
- data/Gemfile.lock +49 -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 +1 -0
- 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 +139 -139
- 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/ordered_fragment.rb +35 -35
- data/lib/trailer_vote/media_types/partials/image_links.rb +30 -30
- data/lib/trailer_vote/media_types/persona.rb +47 -47
- data/lib/trailer_vote/media_types/place.rb +143 -143
- 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_consent.rb +44 -44
- data/lib/trailer_vote/media_types/push_manifest.rb +44 -44
- data/lib/trailer_vote/media_types/push_token_android.rb +41 -41
- data/lib/trailer_vote/media_types/push_token_index.rb +42 -42
- data/lib/trailer_vote/media_types/push_token_ios.rb +41 -41
- data/lib/trailer_vote/media_types/push_trivial_campaign.rb +219 -219
- data/lib/trailer_vote/media_types/release_push_campaign.rb +77 -77
- 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/local_time.rb +11 -11
- 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/lib/trailer_vote/media_types/vista_config.rb +37 -0
- data/trailer_vote-media_types.gemspec +43 -43
- metadata +6 -5
@@ -1,219 +1,219 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_text'
|
4
|
-
require_relative 'types/http_url'
|
5
|
-
require_relative 'types/iso8601'
|
6
|
-
require_relative 'types/boolean'
|
7
|
-
require_relative 'types/vote_value'
|
8
|
-
|
9
|
-
module TrailerVote
|
10
|
-
module MediaTypes
|
11
|
-
##
|
12
|
-
# Media Types for Trivial Push Campaign
|
13
|
-
#
|
14
|
-
# The trivial push campaign is used to schedule a local push notification at a specified time.
|
15
|
-
#
|
16
|
-
class PushTrivialCampaign < BaseText
|
17
|
-
media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 5 }
|
18
|
-
|
19
|
-
filters = ::MediaTypes::Scheme.new do
|
20
|
-
attribute :filter do
|
21
|
-
attribute :platform, AllowNil(String)
|
22
|
-
attribute :region, AllowNil(String)
|
23
|
-
attribute :language, AllowNil(String)
|
24
|
-
attribute :timezone, AllowNil(String)
|
25
|
-
attribute :vote_source, AllowNil(String)
|
26
|
-
attribute :purchased, AllowNil(Types::Boolean)
|
27
|
-
attribute :vote_value, AllowNil(Types::VoteValue)
|
28
|
-
attribute :vote_from, AllowNil(Types::Iso8601)
|
29
|
-
attribute :vote_until, AllowNil(Types::Iso8601)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
filters_creation = ::MediaTypes::Scheme.new do
|
34
|
-
attribute :filter do
|
35
|
-
attribute :platform, AllowNil(String), optional: true
|
36
|
-
attribute :region, AllowNil(String), optional: true
|
37
|
-
attribute :language, AllowNil(String), optional: true
|
38
|
-
attribute :timezone, AllowNil(String), optional: true
|
39
|
-
attribute :vote_source, AllowNil(String), optional: true
|
40
|
-
attribute :purchased, AllowNil(Types::Boolean), optional: true
|
41
|
-
attribute :vote_value, AllowNil(Types::VoteValue), optional: true
|
42
|
-
attribute :vote_from, AllowNil(Types::Iso8601), optional: true
|
43
|
-
attribute :vote_until, AllowNil(Types::Iso8601), optional: true
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
push_creation_base = ::MediaTypes::Scheme.new do
|
48
|
-
link :product_asset
|
49
|
-
link :action
|
50
|
-
attribute :schedule_at, Types::Iso8601
|
51
|
-
attribute :translations, ::Hash
|
52
|
-
end
|
53
|
-
|
54
|
-
push_creation_base_v4 = ::MediaTypes::Scheme.new do
|
55
|
-
link :product, optional: true
|
56
|
-
link :product_asset, optional: true
|
57
|
-
link :action
|
58
|
-
link :rich_media, optional: true
|
59
|
-
attribute :schedule_at, Types::Iso8601
|
60
|
-
attribute :translations, ::Hash
|
61
|
-
end
|
62
|
-
|
63
|
-
validations do
|
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, AllowNil(Types::Iso8601)
|
73
|
-
attribute :archived_at, AllowNil(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, AllowNil(Types::Iso8601)
|
81
|
-
attribute :archived_at, AllowNil(Types::Iso8601)
|
82
|
-
merge filters_creation
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
view 'raw' do
|
87
|
-
attribute :push_campaign_trivial do
|
88
|
-
link :action
|
89
|
-
link :self
|
90
|
-
link :rich_media, optional: true
|
91
|
-
link :product, optional: true
|
92
|
-
link :product_asset, optional: true
|
93
|
-
attribute :translations, ::Hash
|
94
|
-
attribute :schedule_at, Types::Iso8601
|
95
|
-
attribute :published_at, AllowNil(Types::Iso8601)
|
96
|
-
attribute :archived_at, AllowNil(Types::Iso8601)
|
97
|
-
merge filters
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
version 4 do
|
103
|
-
attribute :push_campaign_trivial do
|
104
|
-
link :action
|
105
|
-
link :self
|
106
|
-
link :rich_media, optional: true
|
107
|
-
attribute :message, String
|
108
|
-
attribute :schedule_at, Types::Iso8601
|
109
|
-
merge filters
|
110
|
-
end
|
111
|
-
|
112
|
-
view 'create' do
|
113
|
-
attribute :push_campaign_trivial do
|
114
|
-
merge push_creation_base_v4
|
115
|
-
merge filters_creation
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
view 'raw' do
|
120
|
-
attribute :push_campaign_trivial do
|
121
|
-
link :action
|
122
|
-
link :self
|
123
|
-
link :rich_media, optional: true
|
124
|
-
link :product, optional: true
|
125
|
-
link :product_asset, optional: true
|
126
|
-
attribute :translations, ::Hash
|
127
|
-
attribute :schedule_at, Types::Iso8601
|
128
|
-
merge filters
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
version 3 do
|
134
|
-
attribute :push_campaign_trivial do
|
135
|
-
link :action
|
136
|
-
link :self
|
137
|
-
attribute :message, String
|
138
|
-
attribute :schedule_at, Types::Iso8601
|
139
|
-
merge filters
|
140
|
-
end
|
141
|
-
|
142
|
-
view 'create' do
|
143
|
-
attribute :push_campaign_trivial do
|
144
|
-
merge push_creation_base
|
145
|
-
merge filters_creation
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
view 'raw' do
|
150
|
-
attribute :push_campaign_trivial do
|
151
|
-
link :action
|
152
|
-
link :self
|
153
|
-
link :product_asset, optional: true
|
154
|
-
attribute :translations, ::Hash
|
155
|
-
attribute :schedule_at, Types::Iso8601
|
156
|
-
merge filters
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
version 2 do
|
162
|
-
attribute :push_campaign_trivial do
|
163
|
-
link :action
|
164
|
-
attribute :message, String
|
165
|
-
attribute :schedule_at, Types::Iso8601
|
166
|
-
merge filters
|
167
|
-
end
|
168
|
-
|
169
|
-
view 'create' do
|
170
|
-
attribute :push_campaign_trivial do
|
171
|
-
merge push_creation_base
|
172
|
-
merge filters_creation
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
view 'raw' do
|
177
|
-
attribute :push_campaign_trivial do
|
178
|
-
link :action
|
179
|
-
link :product_asset, optional: true
|
180
|
-
attribute :translations, ::Hash
|
181
|
-
attribute :schedule_at, Types::Iso8601
|
182
|
-
merge filters
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
version 1 do
|
188
|
-
attribute :push_campaign_trivial do
|
189
|
-
link :action
|
190
|
-
attribute :message, String
|
191
|
-
attribute :schedule_at, Types::Iso8601
|
192
|
-
end
|
193
|
-
|
194
|
-
view 'create' do
|
195
|
-
attribute :push_campaign_trivial do
|
196
|
-
merge push_creation_base
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
view 'raw' do
|
201
|
-
attribute :push_campaign_trivial do
|
202
|
-
link :action
|
203
|
-
link :product_asset, optional: true
|
204
|
-
attribute :translations, ::Hash
|
205
|
-
attribute :schedule_at, Types::Iso8601
|
206
|
-
end
|
207
|
-
end
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
registrations :push_campaign_trivial do
|
212
|
-
view 'create', :create_push_trivial_campaign
|
213
|
-
view 'raw', :raw_push_trivial_campaign
|
214
|
-
|
215
|
-
versions 1, 2, 3, 4, 5
|
216
|
-
end
|
217
|
-
end
|
218
|
-
end
|
219
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base_text'
|
4
|
+
require_relative 'types/http_url'
|
5
|
+
require_relative 'types/iso8601'
|
6
|
+
require_relative 'types/boolean'
|
7
|
+
require_relative 'types/vote_value'
|
8
|
+
|
9
|
+
module TrailerVote
|
10
|
+
module MediaTypes
|
11
|
+
##
|
12
|
+
# Media Types for Trivial Push Campaign
|
13
|
+
#
|
14
|
+
# The trivial push campaign is used to schedule a local push notification at a specified time.
|
15
|
+
#
|
16
|
+
class PushTrivialCampaign < BaseText
|
17
|
+
media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 5 }
|
18
|
+
|
19
|
+
filters = ::MediaTypes::Scheme.new do
|
20
|
+
attribute :filter do
|
21
|
+
attribute :platform, AllowNil(String)
|
22
|
+
attribute :region, AllowNil(String)
|
23
|
+
attribute :language, AllowNil(String)
|
24
|
+
attribute :timezone, AllowNil(String)
|
25
|
+
attribute :vote_source, AllowNil(String)
|
26
|
+
attribute :purchased, AllowNil(Types::Boolean)
|
27
|
+
attribute :vote_value, AllowNil(Types::VoteValue)
|
28
|
+
attribute :vote_from, AllowNil(Types::Iso8601)
|
29
|
+
attribute :vote_until, AllowNil(Types::Iso8601)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
filters_creation = ::MediaTypes::Scheme.new do
|
34
|
+
attribute :filter do
|
35
|
+
attribute :platform, AllowNil(String), optional: true
|
36
|
+
attribute :region, AllowNil(String), optional: true
|
37
|
+
attribute :language, AllowNil(String), optional: true
|
38
|
+
attribute :timezone, AllowNil(String), optional: true
|
39
|
+
attribute :vote_source, AllowNil(String), optional: true
|
40
|
+
attribute :purchased, AllowNil(Types::Boolean), optional: true
|
41
|
+
attribute :vote_value, AllowNil(Types::VoteValue), optional: true
|
42
|
+
attribute :vote_from, AllowNil(Types::Iso8601), optional: true
|
43
|
+
attribute :vote_until, AllowNil(Types::Iso8601), optional: true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
push_creation_base = ::MediaTypes::Scheme.new do
|
48
|
+
link :product_asset
|
49
|
+
link :action
|
50
|
+
attribute :schedule_at, Types::Iso8601
|
51
|
+
attribute :translations, ::Hash
|
52
|
+
end
|
53
|
+
|
54
|
+
push_creation_base_v4 = ::MediaTypes::Scheme.new do
|
55
|
+
link :product, optional: true
|
56
|
+
link :product_asset, optional: true
|
57
|
+
link :action
|
58
|
+
link :rich_media, optional: true
|
59
|
+
attribute :schedule_at, Types::Iso8601
|
60
|
+
attribute :translations, ::Hash
|
61
|
+
end
|
62
|
+
|
63
|
+
validations do
|
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, AllowNil(Types::Iso8601)
|
73
|
+
attribute :archived_at, AllowNil(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, AllowNil(Types::Iso8601)
|
81
|
+
attribute :archived_at, AllowNil(Types::Iso8601)
|
82
|
+
merge filters_creation
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
view 'raw' do
|
87
|
+
attribute :push_campaign_trivial do
|
88
|
+
link :action
|
89
|
+
link :self
|
90
|
+
link :rich_media, optional: true
|
91
|
+
link :product, optional: true
|
92
|
+
link :product_asset, optional: true
|
93
|
+
attribute :translations, ::Hash
|
94
|
+
attribute :schedule_at, Types::Iso8601
|
95
|
+
attribute :published_at, AllowNil(Types::Iso8601)
|
96
|
+
attribute :archived_at, AllowNil(Types::Iso8601)
|
97
|
+
merge filters
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
version 4 do
|
103
|
+
attribute :push_campaign_trivial do
|
104
|
+
link :action
|
105
|
+
link :self
|
106
|
+
link :rich_media, optional: true
|
107
|
+
attribute :message, String
|
108
|
+
attribute :schedule_at, Types::Iso8601
|
109
|
+
merge filters
|
110
|
+
end
|
111
|
+
|
112
|
+
view 'create' do
|
113
|
+
attribute :push_campaign_trivial do
|
114
|
+
merge push_creation_base_v4
|
115
|
+
merge filters_creation
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
view 'raw' do
|
120
|
+
attribute :push_campaign_trivial do
|
121
|
+
link :action
|
122
|
+
link :self
|
123
|
+
link :rich_media, optional: true
|
124
|
+
link :product, optional: true
|
125
|
+
link :product_asset, optional: true
|
126
|
+
attribute :translations, ::Hash
|
127
|
+
attribute :schedule_at, Types::Iso8601
|
128
|
+
merge filters
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
version 3 do
|
134
|
+
attribute :push_campaign_trivial do
|
135
|
+
link :action
|
136
|
+
link :self
|
137
|
+
attribute :message, String
|
138
|
+
attribute :schedule_at, Types::Iso8601
|
139
|
+
merge filters
|
140
|
+
end
|
141
|
+
|
142
|
+
view 'create' do
|
143
|
+
attribute :push_campaign_trivial do
|
144
|
+
merge push_creation_base
|
145
|
+
merge filters_creation
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
view 'raw' do
|
150
|
+
attribute :push_campaign_trivial do
|
151
|
+
link :action
|
152
|
+
link :self
|
153
|
+
link :product_asset, optional: true
|
154
|
+
attribute :translations, ::Hash
|
155
|
+
attribute :schedule_at, Types::Iso8601
|
156
|
+
merge filters
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
version 2 do
|
162
|
+
attribute :push_campaign_trivial do
|
163
|
+
link :action
|
164
|
+
attribute :message, String
|
165
|
+
attribute :schedule_at, Types::Iso8601
|
166
|
+
merge filters
|
167
|
+
end
|
168
|
+
|
169
|
+
view 'create' do
|
170
|
+
attribute :push_campaign_trivial do
|
171
|
+
merge push_creation_base
|
172
|
+
merge filters_creation
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
view 'raw' do
|
177
|
+
attribute :push_campaign_trivial do
|
178
|
+
link :action
|
179
|
+
link :product_asset, optional: true
|
180
|
+
attribute :translations, ::Hash
|
181
|
+
attribute :schedule_at, Types::Iso8601
|
182
|
+
merge filters
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
version 1 do
|
188
|
+
attribute :push_campaign_trivial do
|
189
|
+
link :action
|
190
|
+
attribute :message, String
|
191
|
+
attribute :schedule_at, Types::Iso8601
|
192
|
+
end
|
193
|
+
|
194
|
+
view 'create' do
|
195
|
+
attribute :push_campaign_trivial do
|
196
|
+
merge push_creation_base
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
view 'raw' do
|
201
|
+
attribute :push_campaign_trivial do
|
202
|
+
link :action
|
203
|
+
link :product_asset, optional: true
|
204
|
+
attribute :translations, ::Hash
|
205
|
+
attribute :schedule_at, Types::Iso8601
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
registrations :push_campaign_trivial do
|
212
|
+
view 'create', :create_push_trivial_campaign
|
213
|
+
view 'raw', :raw_push_trivial_campaign
|
214
|
+
|
215
|
+
versions 1, 2, 3, 4, 5
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -1,77 +1,77 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_text'
|
4
|
-
require_relative 'types/http_url'
|
5
|
-
require_relative 'types/local_time'
|
6
|
-
require_relative 'types/iso8601'
|
7
|
-
|
8
|
-
module TrailerVote
|
9
|
-
module MediaTypes
|
10
|
-
##
|
11
|
-
# Media Types for Release Push Campaign
|
12
|
-
#
|
13
|
-
# The release push campaign is used to show a local push notification upon product release.
|
14
|
-
#
|
15
|
-
class ReleasePushCampaign < BaseText
|
16
|
-
media_type 'release_push_campaign', defaults: { suffix: :json, version: 2 }
|
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, AllowNil(Types::Iso8601)
|
25
|
-
attribute :archived_at, AllowNil(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
|
-
|
45
|
-
version 1 do
|
46
|
-
attribute :release_push_campaign do
|
47
|
-
attribute :message, String
|
48
|
-
attribute :dnd_start, Types::LocalTime
|
49
|
-
attribute :dnd_end, Types::LocalTime
|
50
|
-
|
51
|
-
link :action
|
52
|
-
link :self
|
53
|
-
link :rich_media, optional: true
|
54
|
-
end
|
55
|
-
|
56
|
-
view 'create' do
|
57
|
-
attribute :release_push_campaign do
|
58
|
-
attribute :translations, ::Hash
|
59
|
-
attribute :dnd_start, Types::LocalTime
|
60
|
-
attribute :dnd_end, Types::LocalTime
|
61
|
-
|
62
|
-
link :product
|
63
|
-
link :action
|
64
|
-
link :rich_media, optional: true
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
registrations :release_push_campaign do
|
71
|
-
view 'create', :create_release_push_campaign
|
72
|
-
|
73
|
-
versions 1,2
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base_text'
|
4
|
+
require_relative 'types/http_url'
|
5
|
+
require_relative 'types/local_time'
|
6
|
+
require_relative 'types/iso8601'
|
7
|
+
|
8
|
+
module TrailerVote
|
9
|
+
module MediaTypes
|
10
|
+
##
|
11
|
+
# Media Types for Release Push Campaign
|
12
|
+
#
|
13
|
+
# The release push campaign is used to show a local push notification upon product release.
|
14
|
+
#
|
15
|
+
class ReleasePushCampaign < BaseText
|
16
|
+
media_type 'release_push_campaign', defaults: { suffix: :json, version: 2 }
|
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, AllowNil(Types::Iso8601)
|
25
|
+
attribute :archived_at, AllowNil(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
|
+
|
45
|
+
version 1 do
|
46
|
+
attribute :release_push_campaign do
|
47
|
+
attribute :message, String
|
48
|
+
attribute :dnd_start, Types::LocalTime
|
49
|
+
attribute :dnd_end, Types::LocalTime
|
50
|
+
|
51
|
+
link :action
|
52
|
+
link :self
|
53
|
+
link :rich_media, optional: true
|
54
|
+
end
|
55
|
+
|
56
|
+
view 'create' do
|
57
|
+
attribute :release_push_campaign do
|
58
|
+
attribute :translations, ::Hash
|
59
|
+
attribute :dnd_start, Types::LocalTime
|
60
|
+
attribute :dnd_end, Types::LocalTime
|
61
|
+
|
62
|
+
link :product
|
63
|
+
link :action
|
64
|
+
link :rich_media, optional: true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
registrations :release_push_campaign do
|
71
|
+
view 'create', :create_release_push_campaign
|
72
|
+
|
73
|
+
versions 1,2
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|