@@ -1,7 +1,10 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE LambdaCase #-}
34{-# LANGUAGE OverloadedStrings #-}
45
6+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
7+
58-- |
69-- Module : Network.Google.YouTube.Types.Sum
710-- Copyright : (c) 2015 Brendan Hay
@@ -25,6 +28,17 @@ data ActivityContentDetailsPromotedItemCtaType
2528
2629instance Hashable ActivityContentDetailsPromotedItemCtaType
2730
31+instance FromText ActivityContentDetailsPromotedItemCtaType where
32+ fromText = \case
33+ "unspecified" -> Just ACDPICTUnspecified
34+ "visitAdvertiserSite" -> Just ACDPICTVisitAdvertiserSite
35+ _ -> Nothing
36+
37+instance ToText ActivityContentDetailsPromotedItemCtaType where
38+ toText = \case
39+ ACDPICTUnspecified -> "unspecified"
40+ ACDPICTVisitAdvertiserSite -> "visitAdvertiserSite"
41+
2842-- | The reason that the resource is recommended to the user.
2943data ActivityContentDetailsRecommendationReason
3044 = ACDRRUnspecified
@@ -39,6 +53,21 @@ data ActivityContentDetailsRecommendationReason
3953
4054instance Hashable ActivityContentDetailsRecommendationReason
4155
56+instance FromText ActivityContentDetailsRecommendationReason where
57+ fromText = \case
58+ "unspecified" -> Just ACDRRUnspecified
59+ "videoFavorited" -> Just ACDRRVideoFavorited
60+ "videoLiked" -> Just ACDRRVideoLiked
61+ "videoWatched" -> Just ACDRRVideoWatched
62+ _ -> Nothing
63+
64+instance ToText ActivityContentDetailsRecommendationReason where
65+ toText = \case
66+ ACDRRUnspecified -> "unspecified"
67+ ACDRRVideoFavorited -> "videoFavorited"
68+ ACDRRVideoLiked -> "videoLiked"
69+ ACDRRVideoWatched -> "videoWatched"
70+
4271-- | The name of the social network.
4372data ActivityContentDetailsSocialType
4473 = ACDSTFacebook
@@ -53,6 +82,21 @@ data ActivityContentDetailsSocialType
5382
5483instance Hashable ActivityContentDetailsSocialType
5584
85+instance FromText ActivityContentDetailsSocialType where
86+ fromText = \case
87+ "facebook" -> Just ACDSTFacebook
88+ "googlePlus" -> Just ACDSTGooglePlus
89+ "twitter" -> Just ACDSTTwitter
90+ "unspecified" -> Just ACDSTUnspecified
91+ _ -> Nothing
92+
93+instance ToText ActivityContentDetailsSocialType where
94+ toText = \case
95+ ACDSTFacebook -> "facebook"
96+ ACDSTGooglePlus -> "googlePlus"
97+ ACDSTTwitter -> "twitter"
98+ ACDSTUnspecified -> "unspecified"
99+
56100-- | The type of activity that the resource describes.
57101data ActivitySnippetType
58102 = ASTBulletin
@@ -81,6 +125,35 @@ data ActivitySnippetType
81125
82126instance Hashable ActivitySnippetType
83127
128+instance FromText ActivitySnippetType where
129+ fromText = \case
130+ "bulletin" -> Just ASTBulletin
131+ "channelItem" -> Just ASTChannelItem
132+ "comment" -> Just ASTComment
133+ "favorite" -> Just ASTFavorite
134+ "like" -> Just ASTLike
135+ "playlistItem" -> Just ASTPlaylistItem
136+ "promotedItem" -> Just ASTPromotedItem
137+ "recommendation" -> Just ASTRecommendation
138+ "social" -> Just ASTSocial
139+ "subscription" -> Just ASTSubscription
140+ "upload" -> Just ASTUpload
141+ _ -> Nothing
142+
143+instance ToText ActivitySnippetType where
144+ toText = \case
145+ ASTBulletin -> "bulletin"
146+ ASTChannelItem -> "channelItem"
147+ ASTComment -> "comment"
148+ ASTFavorite -> "favorite"
149+ ASTLike -> "like"
150+ ASTPlaylistItem -> "playlistItem"
151+ ASTPromotedItem -> "promotedItem"
152+ ASTRecommendation -> "recommendation"
153+ ASTSocial -> "social"
154+ ASTSubscription -> "subscription"
155+ ASTUpload -> "upload"
156+
84157-- | The type of audio track associated with the caption track.
85158data CaptionSnippetAudioTrackType
86159 = CSATTCommentary
@@ -95,6 +168,21 @@ data CaptionSnippetAudioTrackType
95168
96169instance Hashable CaptionSnippetAudioTrackType
97170
171+instance FromText CaptionSnippetAudioTrackType where
172+ fromText = \case
173+ "commentary" -> Just CSATTCommentary
174+ "descriptive" -> Just CSATTDescriptive
175+ "primary" -> Just CSATTPrimary
176+ "unknown" -> Just CSATTUnknown
177+ _ -> Nothing
178+
179+instance ToText CaptionSnippetAudioTrackType where
180+ toText = \case
181+ CSATTCommentary -> "commentary"
182+ CSATTDescriptive -> "descriptive"
183+ CSATTPrimary -> "primary"
184+ CSATTUnknown -> "unknown"
185+
98186-- | The reason that YouTube failed to process the caption track. This
99187-- property is only present if the state property\'s value is failed.
100188data CaptionSnippetFailureReason
@@ -108,6 +196,19 @@ data CaptionSnippetFailureReason
108196
109197instance Hashable CaptionSnippetFailureReason
110198
199+instance FromText CaptionSnippetFailureReason where
200+ fromText = \case
201+ "processingFailed" -> Just CSFRProcessingFailed
202+ "unknownFormat" -> Just CSFRUnknownFormat
203+ "unsupportedFormat" -> Just CSFRUnsupportedFormat
204+ _ -> Nothing
205+
206+instance ToText CaptionSnippetFailureReason where
207+ toText = \case
208+ CSFRProcessingFailed -> "processingFailed"
209+ CSFRUnknownFormat -> "unknownFormat"
210+ CSFRUnsupportedFormat -> "unsupportedFormat"
211+
111212-- | The caption track\'s status.
112213data CaptionSnippetStatus
113214 = CSSFailed
@@ -120,6 +221,19 @@ data CaptionSnippetStatus
120221
121222instance Hashable CaptionSnippetStatus
122223
224+instance FromText CaptionSnippetStatus where
225+ fromText = \case
226+ "failed" -> Just CSSFailed
227+ "serving" -> Just CSSServing
228+ "syncing" -> Just CSSSyncing
229+ _ -> Nothing
230+
231+instance ToText CaptionSnippetStatus where
232+ toText = \case
233+ CSSFailed -> "failed"
234+ CSSServing -> "serving"
235+ CSSSyncing -> "syncing"
236+
123237-- | The caption track\'s type.
124238data CaptionSnippetTrackKind
125239 = CSTKAsr
@@ -132,6 +246,19 @@ data CaptionSnippetTrackKind
132246
133247instance Hashable CaptionSnippetTrackKind
134248
249+instance FromText CaptionSnippetTrackKind where
250+ fromText = \case
251+ "ASR" -> Just CSTKAsr
252+ "forced" -> Just CSTKForced
253+ "standard" -> Just CSTKStandard
254+ _ -> Nothing
255+
256+instance ToText CaptionSnippetTrackKind where
257+ toText = \case
258+ CSTKAsr -> "ASR"
259+ CSTKForced -> "forced"
260+ CSTKStandard -> "standard"
261+
135262-- | The method or protocol used to transmit the video stream.
136263data CdnSettingsIngestionType
137264 = CSITDash
@@ -142,6 +269,17 @@ data CdnSettingsIngestionType
142269
143270instance Hashable CdnSettingsIngestionType
144271
272+instance FromText CdnSettingsIngestionType where
273+ fromText = \case
274+ "dash" -> Just CSITDash
275+ "rtmp" -> Just CSITRtmp
276+ _ -> Nothing
277+
278+instance ToText CdnSettingsIngestionType where
279+ toText = \case
280+ CSITDash -> "dash"
281+ CSITRtmp -> "rtmp"
282+
145283-- | Defines the context of the ping.
146284data ChannelConversionPingContext
147285 = CCPCCview
@@ -154,6 +292,19 @@ data ChannelConversionPingContext
154292
155293instance Hashable ChannelConversionPingContext
156294
295+instance FromText ChannelConversionPingContext where
296+ fromText = \case
297+ "cview" -> Just CCPCCview
298+ "subscribe" -> Just CCPCSubscribe
299+ "unsubscribe" -> Just CCPCUnsubscribe
300+ _ -> Nothing
301+
302+instance ToText ChannelConversionPingContext where
303+ toText = \case
304+ CCPCCview -> "cview"
305+ CCPCSubscribe -> "subscribe"
306+ CCPCUnsubscribe -> "unsubscribe"
307+
157308-- | The style of the channel section.
158309data ChannelSectionSnippetStyle
159310 = CSSSChannelsectionStyleUndefined
@@ -166,6 +317,19 @@ data ChannelSectionSnippetStyle
166317
167318instance Hashable ChannelSectionSnippetStyle
168319
320+instance FromText ChannelSectionSnippetStyle where
321+ fromText = \case
322+ "channelsectionStyleUndefined" -> Just CSSSChannelsectionStyleUndefined
323+ "horizontalRow" -> Just CSSSHorizontalRow
324+ "verticalList" -> Just CSSSVerticalList
325+ _ -> Nothing
326+
327+instance ToText ChannelSectionSnippetStyle where
328+ toText = \case
329+ CSSSChannelsectionStyleUndefined -> "channelsectionStyleUndefined"
330+ CSSSHorizontalRow -> "horizontalRow"
331+ CSSSVerticalList -> "verticalList"
332+
169333-- | The type of the channel section.
170334data ChannelSectionSnippetType
171335 = CSSTAllPlaylists
@@ -206,6 +370,47 @@ data ChannelSectionSnippetType
206370
207371instance Hashable ChannelSectionSnippetType
208372
373+instance FromText ChannelSectionSnippetType where
374+ fromText = \case
375+ "allPlaylists" -> Just CSSTAllPlaylists
376+ "channelsectionTypeUndefined" -> Just CSSTChannelsectionTypeUndefined
377+ "completedEvents" -> Just CSSTCompletedEvents
378+ "likedPlaylists" -> Just CSSTLikedPlaylists
379+ "likes" -> Just CSSTLikes
380+ "liveEvents" -> Just CSSTLiveEvents
381+ "multipleChannels" -> Just CSSTMultipleChannels
382+ "multiplePlaylists" -> Just CSSTMultiplePlaylists
383+ "popularUploads" -> Just CSSTPopularUploads
384+ "postedPlaylists" -> Just CSSTPostedPlaylists
385+ "postedVideos" -> Just CSSTPostedVideos
386+ "recentActivity" -> Just CSSTRecentActivity
387+ "recentPosts" -> Just CSSTRecentPosts
388+ "recentUploads" -> Just CSSTRecentUploads
389+ "singlePlaylist" -> Just CSSTSinglePlaylist
390+ "subscriptions" -> Just CSSTSubscriptions
391+ "upcomingEvents" -> Just CSSTUpcomingEvents
392+ _ -> Nothing
393+
394+instance ToText ChannelSectionSnippetType where
395+ toText = \case
396+ CSSTAllPlaylists -> "allPlaylists"
397+ CSSTChannelsectionTypeUndefined -> "channelsectionTypeUndefined"
398+ CSSTCompletedEvents -> "completedEvents"
399+ CSSTLikedPlaylists -> "likedPlaylists"
400+ CSSTLikes -> "likes"
401+ CSSTLiveEvents -> "liveEvents"
402+ CSSTMultipleChannels -> "multipleChannels"
403+ CSSTMultiplePlaylists -> "multiplePlaylists"
404+ CSSTPopularUploads -> "popularUploads"
405+ CSSTPostedPlaylists -> "postedPlaylists"
406+ CSSTPostedVideos -> "postedVideos"
407+ CSSTRecentActivity -> "recentActivity"
408+ CSSTRecentPosts -> "recentPosts"
409+ CSSTRecentUploads -> "recentUploads"
410+ CSSTSinglePlaylist -> "singlePlaylist"
411+ CSSTSubscriptions -> "subscriptions"
412+ CSSTUpcomingEvents -> "upcomingEvents"
413+
209414-- | The long uploads status of this channel. See
210415data ChannelStatusLongUploadsStatus
211416 = CSLUSAllowed
@@ -220,6 +425,21 @@ data ChannelStatusLongUploadsStatus
220425
221426instance Hashable ChannelStatusLongUploadsStatus
222427
428+instance FromText ChannelStatusLongUploadsStatus where
429+ fromText = \case
430+ "allowed" -> Just CSLUSAllowed
431+ "disallowed" -> Just CSLUSDisallowed
432+ "eligible" -> Just CSLUSEligible
433+ "longUploadsUnspecified" -> Just CSLUSLongUploadsUnspecified
434+ _ -> Nothing
435+
436+instance ToText ChannelStatusLongUploadsStatus where
437+ toText = \case
438+ CSLUSAllowed -> "allowed"
439+ CSLUSDisallowed -> "disallowed"
440+ CSLUSEligible -> "eligible"
441+ CSLUSLongUploadsUnspecified -> "longUploadsUnspecified"
442+
223443-- | Privacy status of the channel.
224444data ChannelStatusPrivacyStatus
225445 = CSPSPrivate
@@ -232,6 +452,19 @@ data ChannelStatusPrivacyStatus
232452
233453instance Hashable ChannelStatusPrivacyStatus
234454
455+instance FromText ChannelStatusPrivacyStatus where
456+ fromText = \case
457+ "private" -> Just CSPSPrivate
458+ "public" -> Just CSPSPublic
459+ "unlisted" -> Just CSPSUnlisted
460+ _ -> Nothing
461+
462+instance ToText ChannelStatusPrivacyStatus where
463+ toText = \case
464+ CSPSPrivate -> "private"
465+ CSPSPublic -> "public"
466+ CSPSUnlisted -> "unlisted"
467+
235468-- | The comment\'s moderation status. Will not be set if the comments were
236469-- requested through the id filter.
237470data CommentSnippetModerationStatus
@@ -247,6 +480,21 @@ data CommentSnippetModerationStatus
247480
248481instance Hashable CommentSnippetModerationStatus
249482
483+instance FromText CommentSnippetModerationStatus where
484+ fromText = \case
485+ "heldForReview" -> Just CSMSHeldForReview
486+ "likelySpam" -> Just CSMSLikelySpam
487+ "published" -> Just CSMSPublished
488+ "rejected" -> Just CSMSRejected
489+ _ -> Nothing
490+
491+instance ToText CommentSnippetModerationStatus where
492+ toText = \case
493+ CSMSHeldForReview -> "heldForReview"
494+ CSMSLikelySpam -> "likelySpam"
495+ CSMSPublished -> "published"
496+ CSMSRejected -> "rejected"
497+
250498-- | The rating the viewer has given to this comment. For the time being this
251499-- will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE.
252500-- This may change in the future.
@@ -263,6 +511,21 @@ data CommentSnippetViewerRating
263511
264512instance Hashable CommentSnippetViewerRating
265513
514+instance FromText CommentSnippetViewerRating where
515+ fromText = \case
516+ "dislike" -> Just CSVRDislike
517+ "like" -> Just CSVRLike
518+ "none" -> Just CSVRNone
519+ "unspecified" -> Just CSVRUnspecified
520+ _ -> Nothing
521+
522+instance ToText CommentSnippetViewerRating where
523+ toText = \case
524+ CSVRDislike -> "dislike"
525+ CSVRLike -> "like"
526+ CSVRNone -> "none"
527+ CSVRUnspecified -> "unspecified"
528+
266529-- | The video\'s Australian Classification Board (ACB) or Australian
267530-- Communications and Media Authority (ACMA) rating. ACMA ratings are used
268531-- to classify children\'s television programming.
@@ -289,6 +552,31 @@ data ContentRatingAcbRating
289552
290553instance Hashable ContentRatingAcbRating
291554
555+instance FromText ContentRatingAcbRating where
556+ fromText = \case
557+ "acbC" -> Just CRARAcbC
558+ "acbE" -> Just CRARAcbE
559+ "acbG" -> Just CRARAcbG
560+ "acbM" -> Just CRARAcbM
561+ "acbMa15plus" -> Just CRARAcbMa15plus
562+ "acbP" -> Just CRARAcbP
563+ "acbPg" -> Just CRARAcbPg
564+ "acbR18plus" -> Just CRARAcbR18plus
565+ "acbUnrated" -> Just CRARAcbUnrated
566+ _ -> Nothing
567+
568+instance ToText ContentRatingAcbRating where
569+ toText = \case
570+ CRARAcbC -> "acbC"
571+ CRARAcbE -> "acbE"
572+ CRARAcbG -> "acbG"
573+ CRARAcbM -> "acbM"
574+ CRARAcbMa15plus -> "acbMa15plus"
575+ CRARAcbP -> "acbP"
576+ CRARAcbPg -> "acbPg"
577+ CRARAcbR18plus -> "acbR18plus"
578+ CRARAcbUnrated -> "acbUnrated"
579+
292580-- | The video\'s rating from Italy\'s Autorità per le Garanzie nelle
293581-- Comunicazioni (AGCOM).
294582data ContentRatingAgcomRating
@@ -304,6 +592,21 @@ data ContentRatingAgcomRating
304592
305593instance Hashable ContentRatingAgcomRating
306594
595+instance FromText ContentRatingAgcomRating where
596+ fromText = \case
597+ "agcomT" -> Just CRARAgcomT
598+ "agcomUnrated" -> Just CRARAgcomUnrated
599+ "agcomVm14" -> Just CRARAGCOMVM14
600+ "agcomVm18" -> Just CRARAGCOMVM18
601+ _ -> Nothing
602+
603+instance ToText ContentRatingAgcomRating where
604+ toText = \case
605+ CRARAgcomT -> "agcomT"
606+ CRARAgcomUnrated -> "agcomUnrated"
607+ CRARAGCOMVM14 -> "agcomVm14"
608+ CRARAGCOMVM18 -> "agcomVm18"
609+
307610-- | The video\'s Anatel (Asociación Nacional de Televisión) rating for
308611-- Chilean television.
309612data ContentRatingAnatelRating
@@ -327,6 +630,29 @@ data ContentRatingAnatelRating
327630
328631instance Hashable ContentRatingAnatelRating
329632
633+instance FromText ContentRatingAnatelRating where
634+ fromText = \case
635+ "anatelA" -> Just CRARAnatelA
636+ "anatelF" -> Just CRARAnatelF
637+ "anatelI" -> Just CRARAnatelI
638+ "anatelI10" -> Just CRARANATELI10
639+ "anatelI12" -> Just CRARANATELI12
640+ "anatelI7" -> Just CRARANATELI7
641+ "anatelR" -> Just CRARAnatelR
642+ "anatelUnrated" -> Just CRARAnatelUnrated
643+ _ -> Nothing
644+
645+instance ToText ContentRatingAnatelRating where
646+ toText = \case
647+ CRARAnatelA -> "anatelA"
648+ CRARAnatelF -> "anatelF"
649+ CRARAnatelI -> "anatelI"
650+ CRARANATELI10 -> "anatelI10"
651+ CRARANATELI12 -> "anatelI12"
652+ CRARANATELI7 -> "anatelI7"
653+ CRARAnatelR -> "anatelR"
654+ CRARAnatelUnrated -> "anatelUnrated"
655+
330656-- | The video\'s British Board of Film Classification (BBFC) rating.
331657data ContentRatingBbfcRating
332658 = CRBRBBFC12
@@ -349,6 +675,29 @@ data ContentRatingBbfcRating
349675
350676instance Hashable ContentRatingBbfcRating
351677
678+instance FromText ContentRatingBbfcRating where
679+ fromText = \case
680+ "bbfc12" -> Just CRBRBBFC12
681+ "bbfc12a" -> Just CRBRBbfc12a
682+ "bbfc15" -> Just CRBRBBFC15
683+ "bbfc18" -> Just CRBRBBFC18
684+ "bbfcPg" -> Just CRBRBbfcPg
685+ "bbfcR18" -> Just CRBRBBFCR18
686+ "bbfcU" -> Just CRBRBbfcU
687+ "bbfcUnrated" -> Just CRBRBbfcUnrated
688+ _ -> Nothing
689+
690+instance ToText ContentRatingBbfcRating where
691+ toText = \case
692+ CRBRBBFC12 -> "bbfc12"
693+ CRBRBbfc12a -> "bbfc12a"
694+ CRBRBBFC15 -> "bbfc15"
695+ CRBRBBFC18 -> "bbfc18"
696+ CRBRBbfcPg -> "bbfcPg"
697+ CRBRBBFCR18 -> "bbfcR18"
698+ CRBRBbfcU -> "bbfcU"
699+ CRBRBbfcUnrated -> "bbfcUnrated"
700+
352701-- | The video\'s rating from Thailand\'s Board of Film and Video Censors.
353702data ContentRatingBfvcRating
354703 = CRBRBFVC13
@@ -371,6 +720,29 @@ data ContentRatingBfvcRating
371720
372721instance Hashable ContentRatingBfvcRating
373722
723+instance FromText ContentRatingBfvcRating where
724+ fromText = \case
725+ "bfvc13" -> Just CRBRBFVC13
726+ "bfvc15" -> Just CRBRBFVC15
727+ "bfvc18" -> Just CRBRBFVC18
728+ "bfvc20" -> Just CRBRBFVC20
729+ "bfvcB" -> Just CRBRBfvcB
730+ "bfvcE" -> Just CRBRBfvcE
731+ "bfvcG" -> Just CRBRBfvcG
732+ "bfvcUnrated" -> Just CRBRBfvcUnrated
733+ _ -> Nothing
734+
735+instance ToText ContentRatingBfvcRating where
736+ toText = \case
737+ CRBRBFVC13 -> "bfvc13"
738+ CRBRBFVC15 -> "bfvc15"
739+ CRBRBFVC18 -> "bfvc18"
740+ CRBRBFVC20 -> "bfvc20"
741+ CRBRBfvcB -> "bfvcB"
742+ CRBRBfvcE -> "bfvcE"
743+ CRBRBfvcG -> "bfvcG"
744+ CRBRBfvcUnrated -> "bfvcUnrated"
745+
374746-- | The video\'s rating from the Austrian Board of Media Classification
375747-- (Bundesministerium für Unterricht, Kunst und Kultur).
376748data ContentRatingBmukkRating
@@ -394,6 +766,29 @@ data ContentRatingBmukkRating
394766
395767instance Hashable ContentRatingBmukkRating
396768
769+instance FromText ContentRatingBmukkRating where
770+ fromText = \case
771+ "bmukk10" -> Just CRBRBMUKK10
772+ "bmukk12" -> Just CRBRBMUKK12
773+ "bmukk14" -> Just CRBRBMUKK14
774+ "bmukk16" -> Just CRBRBMUKK16
775+ "bmukk6" -> Just CRBRBMUKK6
776+ "bmukk8" -> Just CRBRBMUKK8
777+ "bmukkAa" -> Just CRBRBmukkAa
778+ "bmukkUnrated" -> Just CRBRBmukkUnrated
779+ _ -> Nothing
780+
781+instance ToText ContentRatingBmukkRating where
782+ toText = \case
783+ CRBRBMUKK10 -> "bmukk10"
784+ CRBRBMUKK12 -> "bmukk12"
785+ CRBRBMUKK14 -> "bmukk14"
786+ CRBRBMUKK16 -> "bmukk16"
787+ CRBRBMUKK6 -> "bmukk6"
788+ CRBRBMUKK8 -> "bmukk8"
789+ CRBRBmukkAa -> "bmukkAa"
790+ CRBRBmukkUnrated -> "bmukkUnrated"
791+
397792-- | Rating system for Canadian TV - Canadian TV Classification System The
398793-- video\'s rating from the Canadian Radio-Television and
399794-- Telecommunications Commission (CRTC) for Canadian English-language
@@ -418,6 +813,27 @@ data ContentRatingCatvRating
418813
419814instance Hashable ContentRatingCatvRating
420815
816+instance FromText ContentRatingCatvRating where
817+ fromText = \case
818+ "catv14plus" -> Just CRCRCatv14plus
819+ "catv18plus" -> Just CRCRCatv18plus
820+ "catvC" -> Just CRCRCatvC
821+ "catvC8" -> Just CRCRCATVC8
822+ "catvG" -> Just CRCRCatvG
823+ "catvPg" -> Just CRCRCatvPg
824+ "catvUnrated" -> Just CRCRCatvUnrated
825+ _ -> Nothing
826+
827+instance ToText ContentRatingCatvRating where
828+ toText = \case
829+ CRCRCatv14plus -> "catv14plus"
830+ CRCRCatv18plus -> "catv18plus"
831+ CRCRCatvC -> "catvC"
832+ CRCRCATVC8 -> "catvC8"
833+ CRCRCatvG -> "catvG"
834+ CRCRCatvPg -> "catvPg"
835+ CRCRCatvUnrated -> "catvUnrated"
836+
421837-- | The video\'s rating from the Canadian Radio-Television and
422838-- Telecommunications Commission (CRTC) for Canadian French-language
423839-- broadcasts. For more information, see the Canadian Broadcast Standards
@@ -439,6 +855,25 @@ data ContentRatingCatvfrRating
439855
440856instance Hashable ContentRatingCatvfrRating
441857
858+instance FromText ContentRatingCatvfrRating where
859+ fromText = \case
860+ "catvfr13plus" -> Just CRCRCatvfr13plus
861+ "catvfr16plus" -> Just CRCRCatvfr16plus
862+ "catvfr18plus" -> Just CRCRCatvfr18plus
863+ "catvfr8plus" -> Just CRCRCatvfr8plus
864+ "catvfrG" -> Just CRCRCatvfrG
865+ "catvfrUnrated" -> Just CRCRCatvfrUnrated
866+ _ -> Nothing
867+
868+instance ToText ContentRatingCatvfrRating where
869+ toText = \case
870+ CRCRCatvfr13plus -> "catvfr13plus"
871+ CRCRCatvfr16plus -> "catvfr16plus"
872+ CRCRCatvfr18plus -> "catvfr18plus"
873+ CRCRCatvfr8plus -> "catvfr8plus"
874+ CRCRCatvfrG -> "catvfrG"
875+ CRCRCatvfrUnrated -> "catvfrUnrated"
876+
442877-- | The video\'s Central Board of Film Certification (CBFC - India) rating.
443878data ContentRatingCbfcRating
444879 = CRCRCbfcA
@@ -455,6 +890,23 @@ data ContentRatingCbfcRating
455890
456891instance Hashable ContentRatingCbfcRating
457892
893+instance FromText ContentRatingCbfcRating where
894+ fromText = \case
895+ "cbfcA" -> Just CRCRCbfcA
896+ "cbfcS" -> Just CRCRCbfcS
897+ "cbfcU" -> Just CRCRCbfcU
898+ "cbfcUA" -> Just CRCRCbfcUA
899+ "cbfcUnrated" -> Just CRCRCbfcUnrated
900+ _ -> Nothing
901+
902+instance ToText ContentRatingCbfcRating where
903+ toText = \case
904+ CRCRCbfcA -> "cbfcA"
905+ CRCRCbfcS -> "cbfcS"
906+ CRCRCbfcU -> "cbfcU"
907+ CRCRCbfcUA -> "cbfcUA"
908+ CRCRCbfcUnrated -> "cbfcUnrated"
909+
458910-- | The video\'s Consejo de Calificación Cinematográfica (Chile) rating.
459911data ContentRatingCccRating
460912 = CRCRCCC14
@@ -475,6 +927,27 @@ data ContentRatingCccRating
475927
476928instance Hashable ContentRatingCccRating
477929
930+instance FromText ContentRatingCccRating where
931+ fromText = \case
932+ "ccc14" -> Just CRCRCCC14
933+ "ccc18" -> Just CRCRCCC18
934+ "ccc18s" -> Just CRCRCcc18s
935+ "ccc18v" -> Just CRCRCcc18v
936+ "ccc6" -> Just CRCRCCC6
937+ "cccTe" -> Just CRCRCccTe
938+ "cccUnrated" -> Just CRCRCccUnrated
939+ _ -> Nothing
940+
941+instance ToText ContentRatingCccRating where
942+ toText = \case
943+ CRCRCCC14 -> "ccc14"
944+ CRCRCCC18 -> "ccc18"
945+ CRCRCcc18s -> "ccc18s"
946+ CRCRCcc18v -> "ccc18v"
947+ CRCRCCC6 -> "ccc6"
948+ CRCRCccTe -> "cccTe"
949+ CRCRCccUnrated -> "cccUnrated"
950+
478951-- | The video\'s rating from Portugal\'s Comissão de Classificação de
479952-- Espect´culos.
480953data ContentRatingCceRating
@@ -494,6 +967,25 @@ data ContentRatingCceRating
494967
495968instance Hashable ContentRatingCceRating
496969
970+instance FromText ContentRatingCceRating where
971+ fromText = \case
972+ "cceM12" -> Just CRCRCCEM12
973+ "cceM16" -> Just CRCRCCEM16
974+ "cceM18" -> Just CRCRCCEM18
975+ "cceM4" -> Just CRCRCCEM4
976+ "cceM6" -> Just CRCRCCEM6
977+ "cceUnrated" -> Just CRCRCceUnrated
978+ _ -> Nothing
979+
980+instance ToText ContentRatingCceRating where
981+ toText = \case
982+ CRCRCCEM12 -> "cceM12"
983+ CRCRCCEM16 -> "cceM16"
984+ CRCRCCEM18 -> "cceM18"
985+ CRCRCCEM4 -> "cceM4"
986+ CRCRCCEM6 -> "cceM6"
987+ CRCRCceUnrated -> "cceUnrated"
988+
497989-- | The video\'s rating in Switzerland.
498990data ContentRatingChfilmRating
499991 = CRCRCHFILM0
@@ -512,6 +1004,25 @@ data ContentRatingChfilmRating
5121004
5131005instance Hashable ContentRatingChfilmRating
5141006
1007+instance FromText ContentRatingChfilmRating where
1008+ fromText = \case
1009+ "chfilm0" -> Just CRCRCHFILM0
1010+ "chfilm12" -> Just CRCRCHFILM12
1011+ "chfilm16" -> Just CRCRCHFILM16
1012+ "chfilm18" -> Just CRCRCHFILM18
1013+ "chfilm6" -> Just CRCRCHFILM6
1014+ "chfilmUnrated" -> Just CRCRChfilmUnrated
1015+ _ -> Nothing
1016+
1017+instance ToText ContentRatingChfilmRating where
1018+ toText = \case
1019+ CRCRCHFILM0 -> "chfilm0"
1020+ CRCRCHFILM12 -> "chfilm12"
1021+ CRCRCHFILM16 -> "chfilm16"
1022+ CRCRCHFILM18 -> "chfilm18"
1023+ CRCRCHFILM6 -> "chfilm6"
1024+ CRCRChfilmUnrated -> "chfilmUnrated"
1025+
5151026-- | The video\'s Canadian Home Video Rating System (CHVRS) rating.
5161027data ContentRatingChvrsRating
5171028 = CRCRChvrs14a
@@ -532,6 +1043,27 @@ data ContentRatingChvrsRating
5321043
5331044instance Hashable ContentRatingChvrsRating
5341045
1046+instance FromText ContentRatingChvrsRating where
1047+ fromText = \case
1048+ "chvrs14a" -> Just CRCRChvrs14a
1049+ "chvrs18a" -> Just CRCRChvrs18a
1050+ "chvrsE" -> Just CRCRChvrsE
1051+ "chvrsG" -> Just CRCRChvrsG
1052+ "chvrsPg" -> Just CRCRChvrsPg
1053+ "chvrsR" -> Just CRCRChvrsR
1054+ "chvrsUnrated" -> Just CRCRChvrsUnrated
1055+ _ -> Nothing
1056+
1057+instance ToText ContentRatingChvrsRating where
1058+ toText = \case
1059+ CRCRChvrs14a -> "chvrs14a"
1060+ CRCRChvrs18a -> "chvrs18a"
1061+ CRCRChvrsE -> "chvrsE"
1062+ CRCRChvrsG -> "chvrsG"
1063+ CRCRChvrsPg -> "chvrsPg"
1064+ CRCRChvrsR -> "chvrsR"
1065+ CRCRChvrsUnrated -> "chvrsUnrated"
1066+
5351067-- | The video\'s rating from the Commission de Contrôle des Films (Belgium).
5361068data ContentRatingCicfRating
5371069 = CRCRCicfE
@@ -546,6 +1078,21 @@ data ContentRatingCicfRating
5461078
5471079instance Hashable ContentRatingCicfRating
5481080
1081+instance FromText ContentRatingCicfRating where
1082+ fromText = \case
1083+ "cicfE" -> Just CRCRCicfE
1084+ "cicfKntEna" -> Just CRCRCicfKntEna
1085+ "cicfKtEa" -> Just CRCRCicfKtEa
1086+ "cicfUnrated" -> Just CRCRCicfUnrated
1087+ _ -> Nothing
1088+
1089+instance ToText ContentRatingCicfRating where
1090+ toText = \case
1091+ CRCRCicfE -> "cicfE"
1092+ CRCRCicfKntEna -> "cicfKntEna"
1093+ CRCRCicfKtEa -> "cicfKtEa"
1094+ CRCRCicfUnrated -> "cicfUnrated"
1095+
5491096-- | The video\'s rating from Romania\'s CONSILIUL NATIONAL AL
5501097-- AUDIOVIZUALULUI (CNA).
5511098data ContentRatingCnaRating
@@ -565,6 +1112,25 @@ data ContentRatingCnaRating
5651112
5661113instance Hashable ContentRatingCnaRating
5671114
1115+instance FromText ContentRatingCnaRating where
1116+ fromText = \case
1117+ "cna12" -> Just CRCRCNA12
1118+ "cna15" -> Just CRCRCNA15
1119+ "cna18" -> Just CRCRCNA18
1120+ "cna18plus" -> Just CRCRCna18plus
1121+ "cnaAp" -> Just CRCRCnaAp
1122+ "cnaUnrated" -> Just CRCRCnaUnrated
1123+ _ -> Nothing
1124+
1125+instance ToText ContentRatingCnaRating where
1126+ toText = \case
1127+ CRCRCNA12 -> "cna12"
1128+ CRCRCNA15 -> "cna15"
1129+ CRCRCNA18 -> "cna18"
1130+ CRCRCna18plus -> "cna18plus"
1131+ CRCRCnaAp -> "cnaAp"
1132+ CRCRCnaUnrated -> "cnaUnrated"
1133+
5681134-- | Rating system in France - Commission de classification cinematographique
5691135data ContentRatingCncRating
5701136 = CRCRCNC10
@@ -585,6 +1151,27 @@ data ContentRatingCncRating
5851151
5861152instance Hashable ContentRatingCncRating
5871153
1154+instance FromText ContentRatingCncRating where
1155+ fromText = \case
1156+ "cnc10" -> Just CRCRCNC10
1157+ "cnc12" -> Just CRCRCNC12
1158+ "cnc16" -> Just CRCRCNC16
1159+ "cnc18" -> Just CRCRCNC18
1160+ "cncE" -> Just CRCRCncE
1161+ "cncT" -> Just CRCRCncT
1162+ "cncUnrated" -> Just CRCRCncUnrated
1163+ _ -> Nothing
1164+
1165+instance ToText ContentRatingCncRating where
1166+ toText = \case
1167+ CRCRCNC10 -> "cnc10"
1168+ CRCRCNC12 -> "cnc12"
1169+ CRCRCNC16 -> "cnc16"
1170+ CRCRCNC18 -> "cnc18"
1171+ CRCRCncE -> "cncE"
1172+ CRCRCncT -> "cncT"
1173+ CRCRCncUnrated -> "cncUnrated"
1174+
5881175-- | The video\'s rating from France\'s Conseil supérieur de l?audiovisuel,
5891176-- which rates broadcast content.
5901177data ContentRatingCsaRating
@@ -606,6 +1193,27 @@ data ContentRatingCsaRating
6061193
6071194instance Hashable ContentRatingCsaRating
6081195
1196+instance FromText ContentRatingCsaRating where
1197+ fromText = \case
1198+ "csa10" -> Just CRCRCSA10
1199+ "csa12" -> Just CRCRCSA12
1200+ "csa16" -> Just CRCRCSA16
1201+ "csa18" -> Just CRCRCSA18
1202+ "csaInterdiction" -> Just CRCRCsaInterdiction
1203+ "csaT" -> Just CRCRCsaT
1204+ "csaUnrated" -> Just CRCRCsaUnrated
1205+ _ -> Nothing
1206+
1207+instance ToText ContentRatingCsaRating where
1208+ toText = \case
1209+ CRCRCSA10 -> "csa10"
1210+ CRCRCSA12 -> "csa12"
1211+ CRCRCSA16 -> "csa16"
1212+ CRCRCSA18 -> "csa18"
1213+ CRCRCsaInterdiction -> "csaInterdiction"
1214+ CRCRCsaT -> "csaT"
1215+ CRCRCsaUnrated -> "csaUnrated"
1216+
6091217-- | The video\'s rating from Luxembourg\'s Commission de surveillance de la
6101218-- classification des films (CSCF).
6111219data ContentRatingCscfRating
@@ -629,6 +1237,29 @@ data ContentRatingCscfRating
6291237
6301238instance Hashable ContentRatingCscfRating
6311239
1240+instance FromText ContentRatingCscfRating where
1241+ fromText = \case
1242+ "cscf12" -> Just CRCRCSCF12
1243+ "cscf16" -> Just CRCRCSCF16
1244+ "cscf18" -> Just CRCRCSCF18
1245+ "cscf6" -> Just CRCRCSCF6
1246+ "cscf9" -> Just CRCRCSCF9
1247+ "cscfA" -> Just CRCRCscfA
1248+ "cscfAl" -> Just CRCRCscfAl
1249+ "cscfUnrated" -> Just CRCRCscfUnrated
1250+ _ -> Nothing
1251+
1252+instance ToText ContentRatingCscfRating where
1253+ toText = \case
1254+ CRCRCSCF12 -> "cscf12"
1255+ CRCRCSCF16 -> "cscf16"
1256+ CRCRCSCF18 -> "cscf18"
1257+ CRCRCSCF6 -> "cscf6"
1258+ CRCRCSCF9 -> "cscf9"
1259+ CRCRCscfA -> "cscfA"
1260+ CRCRCscfAl -> "cscfAl"
1261+ CRCRCscfUnrated -> "cscfUnrated"
1262+
6321263-- | The video\'s rating in the Czech Republic.
6331264data ContentRatingCzfilmRating
6341265 = CRCRCZFILM12
@@ -645,6 +1276,23 @@ data ContentRatingCzfilmRating
6451276
6461277instance Hashable ContentRatingCzfilmRating
6471278
1279+instance FromText ContentRatingCzfilmRating where
1280+ fromText = \case
1281+ "czfilm12" -> Just CRCRCZFILM12
1282+ "czfilm14" -> Just CRCRCZFILM14
1283+ "czfilm18" -> Just CRCRCZFILM18
1284+ "czfilmU" -> Just CRCRCzfilmU
1285+ "czfilmUnrated" -> Just CRCRCzfilmUnrated
1286+ _ -> Nothing
1287+
1288+instance ToText ContentRatingCzfilmRating where
1289+ toText = \case
1290+ CRCRCZFILM12 -> "czfilm12"
1291+ CRCRCZFILM14 -> "czfilm14"
1292+ CRCRCZFILM18 -> "czfilm18"
1293+ CRCRCzfilmU -> "czfilmU"
1294+ CRCRCzfilmUnrated -> "czfilmUnrated"
1295+
6481296-- | The video\'s Departamento de Justiça, Classificação, Qualificação e
6491297-- Títulos (DJCQT - Brazil) rating.
6501298data ContentRatingDjctqRating
@@ -666,6 +1314,27 @@ data ContentRatingDjctqRating
6661314
6671315instance Hashable ContentRatingDjctqRating
6681316
1317+instance FromText ContentRatingDjctqRating where
1318+ fromText = \case
1319+ "djctq10" -> Just CRDRDJCTQ10
1320+ "djctq12" -> Just CRDRDJCTQ12
1321+ "djctq14" -> Just CRDRDJCTQ14
1322+ "djctq16" -> Just CRDRDJCTQ16
1323+ "djctq18" -> Just CRDRDJCTQ18
1324+ "djctqL" -> Just CRDRDjctqL
1325+ "djctqUnrated" -> Just CRDRDjctqUnrated
1326+ _ -> Nothing
1327+
1328+instance ToText ContentRatingDjctqRating where
1329+ toText = \case
1330+ CRDRDJCTQ10 -> "djctq10"
1331+ CRDRDJCTQ12 -> "djctq12"
1332+ CRDRDJCTQ14 -> "djctq14"
1333+ CRDRDJCTQ16 -> "djctq16"
1334+ CRDRDJCTQ18 -> "djctq18"
1335+ CRDRDjctqL -> "djctqL"
1336+ CRDRDjctqUnrated -> "djctqUnrated"
1337+
6691338-- | The video\'s rating in Estonia.
6701339data ContentRatingEefilmRating
6711340 = CREREEFILMK12
@@ -690,6 +1359,31 @@ data ContentRatingEefilmRating
6901359
6911360instance Hashable ContentRatingEefilmRating
6921361
1362+instance FromText ContentRatingEefilmRating where
1363+ fromText = \case
1364+ "eefilmK12" -> Just CREREEFILMK12
1365+ "eefilmK14" -> Just CREREEFILMK14
1366+ "eefilmK16" -> Just CREREEFILMK16
1367+ "eefilmK6" -> Just CREREEFILMK6
1368+ "eefilmL" -> Just CREREefilmL
1369+ "eefilmMs12" -> Just CREREEFILMMS12
1370+ "eefilmMs6" -> Just CREREEFILMMS6
1371+ "eefilmPere" -> Just CREREefilmPere
1372+ "eefilmUnrated" -> Just CREREefilmUnrated
1373+ _ -> Nothing
1374+
1375+instance ToText ContentRatingEefilmRating where
1376+ toText = \case
1377+ CREREEFILMK12 -> "eefilmK12"
1378+ CREREEFILMK14 -> "eefilmK14"
1379+ CREREEFILMK16 -> "eefilmK16"
1380+ CREREEFILMK6 -> "eefilmK6"
1381+ CREREefilmL -> "eefilmL"
1382+ CREREEFILMMS12 -> "eefilmMs12"
1383+ CREREEFILMMS6 -> "eefilmMs6"
1384+ CREREefilmPere -> "eefilmPere"
1385+ CREREefilmUnrated -> "eefilmUnrated"
1386+
6931387-- | The video\'s rating in Egypt.
6941388data ContentRatingEgfilmRating
6951389 = CREREGFILM18
@@ -704,6 +1398,21 @@ data ContentRatingEgfilmRating
7041398
7051399instance Hashable ContentRatingEgfilmRating
7061400
1401+instance FromText ContentRatingEgfilmRating where
1402+ fromText = \case
1403+ "egfilm18" -> Just CREREGFILM18
1404+ "egfilmBn" -> Just CREREgfilmBn
1405+ "egfilmGn" -> Just CREREgfilmGn
1406+ "egfilmUnrated" -> Just CREREgfilmUnrated
1407+ _ -> Nothing
1408+
1409+instance ToText ContentRatingEgfilmRating where
1410+ toText = \case
1411+ CREREGFILM18 -> "egfilm18"
1412+ CREREgfilmBn -> "egfilmBn"
1413+ CREREgfilmGn -> "egfilmGn"
1414+ CREREgfilmUnrated -> "egfilmUnrated"
1415+
7071416-- | The video\'s Eirin (映倫) rating. Eirin is the Japanese rating system.
7081417data ContentRatingEirinRating
7091418 = CREREirinG
@@ -720,6 +1429,23 @@ data ContentRatingEirinRating
7201429
7211430instance Hashable ContentRatingEirinRating
7221431
1432+instance FromText ContentRatingEirinRating where
1433+ fromText = \case
1434+ "eirinG" -> Just CREREirinG
1435+ "eirinPg12" -> Just CREREIRINPG12
1436+ "eirinR15plus" -> Just CREREirinR15plus
1437+ "eirinR18plus" -> Just CREREirinR18plus
1438+ "eirinUnrated" -> Just CREREirinUnrated
1439+ _ -> Nothing
1440+
1441+instance ToText ContentRatingEirinRating where
1442+ toText = \case
1443+ CREREirinG -> "eirinG"
1444+ CREREIRINPG12 -> "eirinPg12"
1445+ CREREirinR15plus -> "eirinR15plus"
1446+ CREREirinR18plus -> "eirinR18plus"
1447+ CREREirinUnrated -> "eirinUnrated"
1448+
7231449-- | The video\'s rating from Malaysia\'s Film Censorship Board.
7241450data ContentRatingFcbmRating
7251451 = CRFRFCBM18
@@ -744,6 +1470,31 @@ data ContentRatingFcbmRating
7441470
7451471instance Hashable ContentRatingFcbmRating
7461472
1473+instance FromText ContentRatingFcbmRating where
1474+ fromText = \case
1475+ "fcbm18" -> Just CRFRFCBM18
1476+ "fcbm18pa" -> Just CRFRFcbm18pa
1477+ "fcbm18pl" -> Just CRFRFcbm18pl
1478+ "fcbm18sg" -> Just CRFRFcbm18sg
1479+ "fcbm18sx" -> Just CRFRFcbm18sx
1480+ "fcbmP13" -> Just CRFRFCBMP13
1481+ "fcbmPg13" -> Just CRFRFCBMPG13
1482+ "fcbmU" -> Just CRFRFcbmU
1483+ "fcbmUnrated" -> Just CRFRFcbmUnrated
1484+ _ -> Nothing
1485+
1486+instance ToText ContentRatingFcbmRating where
1487+ toText = \case
1488+ CRFRFCBM18 -> "fcbm18"
1489+ CRFRFcbm18pa -> "fcbm18pa"
1490+ CRFRFcbm18pl -> "fcbm18pl"
1491+ CRFRFcbm18sg -> "fcbm18sg"
1492+ CRFRFcbm18sx -> "fcbm18sx"
1493+ CRFRFCBMP13 -> "fcbmP13"
1494+ CRFRFCBMPG13 -> "fcbmPg13"
1495+ CRFRFcbmU -> "fcbmU"
1496+ CRFRFcbmUnrated -> "fcbmUnrated"
1497+
7471498-- | The video\'s rating from Hong Kong\'s Office for Film, Newspaper and
7481499-- Article Administration.
7491500data ContentRatingFcoRating
@@ -763,6 +1514,25 @@ data ContentRatingFcoRating
7631514
7641515instance Hashable ContentRatingFcoRating
7651516
1517+instance FromText ContentRatingFcoRating where
1518+ fromText = \case
1519+ "fcoI" -> Just CRFRFcoI
1520+ "fcoIi" -> Just CRFRFcoIi
1521+ "fcoIia" -> Just CRFRFcoIia
1522+ "fcoIib" -> Just CRFRFcoIib
1523+ "fcoIii" -> Just CRFRFcoIii
1524+ "fcoUnrated" -> Just CRFRFcoUnrated
1525+ _ -> Nothing
1526+
1527+instance ToText ContentRatingFcoRating where
1528+ toText = \case
1529+ CRFRFcoI -> "fcoI"
1530+ CRFRFcoIi -> "fcoIi"
1531+ CRFRFcoIia -> "fcoIia"
1532+ CRFRFcoIib -> "fcoIib"
1533+ CRFRFcoIii -> "fcoIii"
1534+ CRFRFcoUnrated -> "fcoUnrated"
1535+
7661536-- | This property has been deprecated. Use the
7671537-- contentDetails.contentRating.cncRating instead.
7681538data ContentRatingFmocRating
@@ -784,6 +1554,27 @@ data ContentRatingFmocRating
7841554
7851555instance Hashable ContentRatingFmocRating
7861556
1557+instance FromText ContentRatingFmocRating where
1558+ fromText = \case
1559+ "fmoc10" -> Just CRFRFMOC10
1560+ "fmoc12" -> Just CRFRFMOC12
1561+ "fmoc16" -> Just CRFRFMOC16
1562+ "fmoc18" -> Just CRFRFMOC18
1563+ "fmocE" -> Just CRFRFmocE
1564+ "fmocU" -> Just CRFRFmocU
1565+ "fmocUnrated" -> Just CRFRFmocUnrated
1566+ _ -> Nothing
1567+
1568+instance ToText ContentRatingFmocRating where
1569+ toText = \case
1570+ CRFRFMOC10 -> "fmoc10"
1571+ CRFRFMOC12 -> "fmoc12"
1572+ CRFRFMOC16 -> "fmoc16"
1573+ CRFRFMOC18 -> "fmoc18"
1574+ CRFRFmocE -> "fmocE"
1575+ CRFRFmocU -> "fmocU"
1576+ CRFRFmocUnrated -> "fmocUnrated"
1577+
7871578-- | The video\'s rating from South Africa\'s Film and Publication Board.
7881579data ContentRatingFpbRating
7891580 = CRFRFpb1012Pg
@@ -810,6 +1601,33 @@ data ContentRatingFpbRating
8101601
8111602instance Hashable ContentRatingFpbRating
8121603
1604+instance FromText ContentRatingFpbRating where
1605+ fromText = \case
1606+ "fpb1012Pg" -> Just CRFRFpb1012Pg
1607+ "fpb13" -> Just CRFRFPB13
1608+ "fpb16" -> Just CRFRFPB16
1609+ "fpb18" -> Just CRFRFPB18
1610+ "fpb79Pg" -> Just CRFRFpb79Pg
1611+ "fpbA" -> Just CRFRFpbA
1612+ "fpbPg" -> Just CRFRFpbPg
1613+ "fpbUnrated" -> Just CRFRFpbUnrated
1614+ "fpbX18" -> Just CRFRFPBX18
1615+ "fpbXx" -> Just CRFRFpbXx
1616+ _ -> Nothing
1617+
1618+instance ToText ContentRatingFpbRating where
1619+ toText = \case
1620+ CRFRFpb1012Pg -> "fpb1012Pg"
1621+ CRFRFPB13 -> "fpb13"
1622+ CRFRFPB16 -> "fpb16"
1623+ CRFRFPB18 -> "fpb18"
1624+ CRFRFpb79Pg -> "fpb79Pg"
1625+ CRFRFpbA -> "fpbA"
1626+ CRFRFpbPg -> "fpbPg"
1627+ CRFRFpbUnrated -> "fpbUnrated"
1628+ CRFRFPBX18 -> "fpbX18"
1629+ CRFRFpbXx -> "fpbXx"
1630+
8131631-- | The video\'s Freiwillige Selbstkontrolle der Filmwirtschaft (FSK -
8141632-- Germany) rating.
8151633data ContentRatingFskRating
@@ -829,6 +1647,25 @@ data ContentRatingFskRating
8291647
8301648instance Hashable ContentRatingFskRating
8311649
1650+instance FromText ContentRatingFskRating where
1651+ fromText = \case
1652+ "fsk0" -> Just CRFRFSK0
1653+ "fsk12" -> Just CRFRFSK12
1654+ "fsk16" -> Just CRFRFSK16
1655+ "fsk18" -> Just CRFRFSK18
1656+ "fsk6" -> Just CRFRFSK6
1657+ "fskUnrated" -> Just CRFRFskUnrated
1658+ _ -> Nothing
1659+
1660+instance ToText ContentRatingFskRating where
1661+ toText = \case
1662+ CRFRFSK0 -> "fsk0"
1663+ CRFRFSK12 -> "fsk12"
1664+ CRFRFSK16 -> "fsk16"
1665+ CRFRFSK18 -> "fsk18"
1666+ CRFRFSK6 -> "fsk6"
1667+ CRFRFskUnrated -> "fskUnrated"
1668+
8321669-- | The video\'s rating in Greece.
8331670data ContentRatingGrfilmRating
8341671 = CRGRGrfilmE
@@ -845,6 +1682,23 @@ data ContentRatingGrfilmRating
8451682
8461683instance Hashable ContentRatingGrfilmRating
8471684
1685+instance FromText ContentRatingGrfilmRating where
1686+ fromText = \case
1687+ "grfilmE" -> Just CRGRGrfilmE
1688+ "grfilmK" -> Just CRGRGrfilmK
1689+ "grfilmK13" -> Just CRGRGRFILMK13
1690+ "grfilmK17" -> Just CRGRGRFILMK17
1691+ "grfilmUnrated" -> Just CRGRGrfilmUnrated
1692+ _ -> Nothing
1693+
1694+instance ToText ContentRatingGrfilmRating where
1695+ toText = \case
1696+ CRGRGrfilmE -> "grfilmE"
1697+ CRGRGrfilmK -> "grfilmK"
1698+ CRGRGRFILMK13 -> "grfilmK13"
1699+ CRGRGRFILMK17 -> "grfilmK17"
1700+ CRGRGrfilmUnrated -> "grfilmUnrated"
1701+
8481702-- | The video\'s Instituto de la Cinematografía y de las Artes Audiovisuales
8491703-- (ICAA - Spain) rating.
8501704data ContentRatingIcaaRating
@@ -868,6 +1722,29 @@ data ContentRatingIcaaRating
8681722
8691723instance Hashable ContentRatingIcaaRating
8701724
1725+instance FromText ContentRatingIcaaRating where
1726+ fromText = \case
1727+ "icaa12" -> Just CRIRICAA12
1728+ "icaa13" -> Just CRIRICAA13
1729+ "icaa16" -> Just CRIRICAA16
1730+ "icaa18" -> Just CRIRICAA18
1731+ "icaa7" -> Just CRIRICAA7
1732+ "icaaApta" -> Just CRIRIcaaApta
1733+ "icaaUnrated" -> Just CRIRIcaaUnrated
1734+ "icaaX" -> Just CRIRIcaaX
1735+ _ -> Nothing
1736+
1737+instance ToText ContentRatingIcaaRating where
1738+ toText = \case
1739+ CRIRICAA12 -> "icaa12"
1740+ CRIRICAA13 -> "icaa13"
1741+ CRIRICAA16 -> "icaa16"
1742+ CRIRICAA18 -> "icaa18"
1743+ CRIRICAA7 -> "icaa7"
1744+ CRIRIcaaApta -> "icaaApta"
1745+ CRIRIcaaUnrated -> "icaaUnrated"
1746+ CRIRIcaaX -> "icaaX"
1747+
8711748-- | The video\'s Irish Film Classification Office (IFCO - Ireland) rating.
8721749-- See the IFCO website for more information.
8731750data ContentRatingIfcoRating
@@ -893,6 +1770,31 @@ data ContentRatingIfcoRating
8931770
8941771instance Hashable ContentRatingIfcoRating
8951772
1773+instance FromText ContentRatingIfcoRating where
1774+ fromText = \case
1775+ "ifco12" -> Just CRIRIFCO12
1776+ "ifco12a" -> Just CRIRIfco12a
1777+ "ifco15" -> Just CRIRIFCO15
1778+ "ifco15a" -> Just CRIRIfco15a
1779+ "ifco16" -> Just CRIRIFCO16
1780+ "ifco18" -> Just CRIRIFCO18
1781+ "ifcoG" -> Just CRIRIfcoG
1782+ "ifcoPg" -> Just CRIRIfcoPg
1783+ "ifcoUnrated" -> Just CRIRIfcoUnrated
1784+ _ -> Nothing
1785+
1786+instance ToText ContentRatingIfcoRating where
1787+ toText = \case
1788+ CRIRIFCO12 -> "ifco12"
1789+ CRIRIfco12a -> "ifco12a"
1790+ CRIRIFCO15 -> "ifco15"
1791+ CRIRIfco15a -> "ifco15a"
1792+ CRIRIFCO16 -> "ifco16"
1793+ CRIRIFCO18 -> "ifco18"
1794+ CRIRIfcoG -> "ifcoG"
1795+ CRIRIfcoPg -> "ifcoPg"
1796+ CRIRIfcoUnrated -> "ifcoUnrated"
1797+
8961798-- | The video\'s rating in Israel.
8971799data ContentRatingIlfilmRating
8981800 = CRIRILFILM12
@@ -909,6 +1811,23 @@ data ContentRatingIlfilmRating
9091811
9101812instance Hashable ContentRatingIlfilmRating
9111813
1814+instance FromText ContentRatingIlfilmRating where
1815+ fromText = \case
1816+ "ilfilm12" -> Just CRIRILFILM12
1817+ "ilfilm16" -> Just CRIRILFILM16
1818+ "ilfilm18" -> Just CRIRILFILM18
1819+ "ilfilmAa" -> Just CRIRIlfilmAa
1820+ "ilfilmUnrated" -> Just CRIRIlfilmUnrated
1821+ _ -> Nothing
1822+
1823+instance ToText ContentRatingIlfilmRating where
1824+ toText = \case
1825+ CRIRILFILM12 -> "ilfilm12"
1826+ CRIRILFILM16 -> "ilfilm16"
1827+ CRIRILFILM18 -> "ilfilm18"
1828+ CRIRIlfilmAa -> "ilfilmAa"
1829+ CRIRIlfilmUnrated -> "ilfilmUnrated"
1830+
9121831-- | The video\'s INCAA (Instituto Nacional de Cine y Artes Audiovisuales -
9131832-- Argentina) rating.
9141833data ContentRatingIncaaRating
@@ -928,6 +1847,25 @@ data ContentRatingIncaaRating
9281847
9291848instance Hashable ContentRatingIncaaRating
9301849
1850+instance FromText ContentRatingIncaaRating where
1851+ fromText = \case
1852+ "incaaAtp" -> Just CRIRIncaaAtp
1853+ "incaaC" -> Just CRIRIncaaC
1854+ "incaaSam13" -> Just CRIRINCAASAM13
1855+ "incaaSam16" -> Just CRIRINCAASAM16
1856+ "incaaSam18" -> Just CRIRINCAASAM18
1857+ "incaaUnrated" -> Just CRIRIncaaUnrated
1858+ _ -> Nothing
1859+
1860+instance ToText ContentRatingIncaaRating where
1861+ toText = \case
1862+ CRIRIncaaAtp -> "incaaAtp"
1863+ CRIRIncaaC -> "incaaC"
1864+ CRIRINCAASAM13 -> "incaaSam13"
1865+ CRIRINCAASAM16 -> "incaaSam16"
1866+ CRIRINCAASAM18 -> "incaaSam18"
1867+ CRIRIncaaUnrated -> "incaaUnrated"
1868+
9311869data ContentRatingItemDjctqRatingReasons
9321870 = CRIDRRDjctqCriminalActs
9331871 -- ^ @djctqCriminalActs@
@@ -957,6 +1895,37 @@ data ContentRatingItemDjctqRatingReasons
9571895
9581896instance Hashable ContentRatingItemDjctqRatingReasons
9591897
1898+instance FromText ContentRatingItemDjctqRatingReasons where
1899+ fromText = \case
1900+ "djctqCriminalActs" -> Just CRIDRRDjctqCriminalActs
1901+ "djctqDrugs" -> Just CRIDRRDjctqDrugs
1902+ "djctqExplicitSex" -> Just CRIDRRDjctqExplicitSex
1903+ "djctqExtremeViolence" -> Just CRIDRRDjctqExtremeViolence
1904+ "djctqIllegalDrugs" -> Just CRIDRRDjctqIllegalDrugs
1905+ "djctqImpactingContent" -> Just CRIDRRDjctqImpactingContent
1906+ "djctqInappropriateLanguage" -> Just CRIDRRDjctqInappropriateLanguage
1907+ "djctqLegalDrugs" -> Just CRIDRRDjctqLegalDrugs
1908+ "djctqNudity" -> Just CRIDRRDjctqNudity
1909+ "djctqSex" -> Just CRIDRRDjctqSex
1910+ "djctqSexualContent" -> Just CRIDRRDjctqSexualContent
1911+ "djctqViolence" -> Just CRIDRRDjctqViolence
1912+ _ -> Nothing
1913+
1914+instance ToText ContentRatingItemDjctqRatingReasons where
1915+ toText = \case
1916+ CRIDRRDjctqCriminalActs -> "djctqCriminalActs"
1917+ CRIDRRDjctqDrugs -> "djctqDrugs"
1918+ CRIDRRDjctqExplicitSex -> "djctqExplicitSex"
1919+ CRIDRRDjctqExtremeViolence -> "djctqExtremeViolence"
1920+ CRIDRRDjctqIllegalDrugs -> "djctqIllegalDrugs"
1921+ CRIDRRDjctqImpactingContent -> "djctqImpactingContent"
1922+ CRIDRRDjctqInappropriateLanguage -> "djctqInappropriateLanguage"
1923+ CRIDRRDjctqLegalDrugs -> "djctqLegalDrugs"
1924+ CRIDRRDjctqNudity -> "djctqNudity"
1925+ CRIDRRDjctqSex -> "djctqSex"
1926+ CRIDRRDjctqSexualContent -> "djctqSexualContent"
1927+ CRIDRRDjctqViolence -> "djctqViolence"
1928+
9601929-- | The video\'s rating from the Kenya Film Classification Board.
9611930data ContentRatingKfcbRating
9621931 = CRKRKfcb16plus
@@ -973,6 +1942,23 @@ data ContentRatingKfcbRating
9731942
9741943instance Hashable ContentRatingKfcbRating
9751944
1945+instance FromText ContentRatingKfcbRating where
1946+ fromText = \case
1947+ "kfcb16plus" -> Just CRKRKfcb16plus
1948+ "kfcbG" -> Just CRKRKfcbG
1949+ "kfcbPg" -> Just CRKRKfcbPg
1950+ "kfcbR" -> Just CRKRKfcbR
1951+ "kfcbUnrated" -> Just CRKRKfcbUnrated
1952+ _ -> Nothing
1953+
1954+instance ToText ContentRatingKfcbRating where
1955+ toText = \case
1956+ CRKRKfcb16plus -> "kfcb16plus"
1957+ CRKRKfcbG -> "kfcbG"
1958+ CRKRKfcbPg -> "kfcbPg"
1959+ CRKRKfcbR -> "kfcbR"
1960+ CRKRKfcbUnrated -> "kfcbUnrated"
1961+
9761962-- | voor de Classificatie van Audiovisuele Media (Netherlands).
9771963data ContentRatingKijkwijzerRating
9781964 = CRKRKIJKWIJZER12
@@ -993,6 +1979,27 @@ data ContentRatingKijkwijzerRating
9931979
9941980instance Hashable ContentRatingKijkwijzerRating
9951981
1982+instance FromText ContentRatingKijkwijzerRating where
1983+ fromText = \case
1984+ "kijkwijzer12" -> Just CRKRKIJKWIJZER12
1985+ "kijkwijzer16" -> Just CRKRKIJKWIJZER16
1986+ "kijkwijzer18" -> Just CRKRKIJKWIJZER18
1987+ "kijkwijzer6" -> Just CRKRKIJKWIJZER6
1988+ "kijkwijzer9" -> Just CRKRKIJKWIJZER9
1989+ "kijkwijzerAl" -> Just CRKRKijkwijzerAl
1990+ "kijkwijzerUnrated" -> Just CRKRKijkwijzerUnrated
1991+ _ -> Nothing
1992+
1993+instance ToText ContentRatingKijkwijzerRating where
1994+ toText = \case
1995+ CRKRKIJKWIJZER12 -> "kijkwijzer12"
1996+ CRKRKIJKWIJZER16 -> "kijkwijzer16"
1997+ CRKRKIJKWIJZER18 -> "kijkwijzer18"
1998+ CRKRKIJKWIJZER6 -> "kijkwijzer6"
1999+ CRKRKIJKWIJZER9 -> "kijkwijzer9"
2000+ CRKRKijkwijzerAl -> "kijkwijzerAl"
2001+ CRKRKijkwijzerUnrated -> "kijkwijzerUnrated"
2002+
9962003-- | The video\'s Korea Media Rating Board (영상물등급위원회) rating. The
9972004-- KMRB rates videos in South Korea.
9982005data ContentRatingKmrbRating
@@ -1012,6 +2019,25 @@ data ContentRatingKmrbRating
10122019
10132020instance Hashable ContentRatingKmrbRating
10142021
2022+instance FromText ContentRatingKmrbRating where
2023+ fromText = \case
2024+ "kmrb12plus" -> Just CRKRKmrb12plus
2025+ "kmrb15plus" -> Just CRKRKmrb15plus
2026+ "kmrbAll" -> Just CRKRKmrbAll
2027+ "kmrbR" -> Just CRKRKmrbR
2028+ "kmrbTeenr" -> Just CRKRKmrbTeenr
2029+ "kmrbUnrated" -> Just CRKRKmrbUnrated
2030+ _ -> Nothing
2031+
2032+instance ToText ContentRatingKmrbRating where
2033+ toText = \case
2034+ CRKRKmrb12plus -> "kmrb12plus"
2035+ CRKRKmrb15plus -> "kmrb15plus"
2036+ CRKRKmrbAll -> "kmrbAll"
2037+ CRKRKmrbR -> "kmrbR"
2038+ CRKRKmrbTeenr -> "kmrbTeenr"
2039+ CRKRKmrbUnrated -> "kmrbUnrated"
2040+
10152041-- | The video\'s rating from Indonesia\'s Lembaga Sensor Film.
10162042data ContentRatingLsfRating
10172043 = CRLRLSF13
@@ -1036,6 +2062,31 @@ data ContentRatingLsfRating
10362062
10372063instance Hashable ContentRatingLsfRating
10382064
2065+instance FromText ContentRatingLsfRating where
2066+ fromText = \case
2067+ "lsf13" -> Just CRLRLSF13
2068+ "lsf17" -> Just CRLRLSF17
2069+ "lsf21" -> Just CRLRLSF21
2070+ "lsfA" -> Just CRLRLsfA
2071+ "lsfBo" -> Just CRLRLsfBo
2072+ "lsfD" -> Just CRLRLsfD
2073+ "lsfR" -> Just CRLRLsfR
2074+ "lsfSu" -> Just CRLRLsfSu
2075+ "lsfUnrated" -> Just CRLRLsfUnrated
2076+ _ -> Nothing
2077+
2078+instance ToText ContentRatingLsfRating where
2079+ toText = \case
2080+ CRLRLSF13 -> "lsf13"
2081+ CRLRLSF17 -> "lsf17"
2082+ CRLRLSF21 -> "lsf21"
2083+ CRLRLsfA -> "lsfA"
2084+ CRLRLsfBo -> "lsfBo"
2085+ CRLRLsfD -> "lsfD"
2086+ CRLRLsfR -> "lsfR"
2087+ CRLRLsfSu -> "lsfSu"
2088+ CRLRLsfUnrated -> "lsfUnrated"
2089+
10392090-- | The video\'s rating from Malta\'s Film Age-Classification Board.
10402091data ContentRatingMccaaRating
10412092 = CRMRMCCAA12
@@ -1060,6 +2111,31 @@ data ContentRatingMccaaRating
10602111
10612112instance Hashable ContentRatingMccaaRating
10622113
2114+instance FromText ContentRatingMccaaRating where
2115+ fromText = \case
2116+ "mccaa12" -> Just CRMRMCCAA12
2117+ "mccaa12a" -> Just CRMRMccaa12a
2118+ "mccaa14" -> Just CRMRMCCAA14
2119+ "mccaa15" -> Just CRMRMCCAA15
2120+ "mccaa16" -> Just CRMRMCCAA16
2121+ "mccaa18" -> Just CRMRMCCAA18
2122+ "mccaaPg" -> Just CRMRMccaaPg
2123+ "mccaaU" -> Just CRMRMccaaU
2124+ "mccaaUnrated" -> Just CRMRMccaaUnrated
2125+ _ -> Nothing
2126+
2127+instance ToText ContentRatingMccaaRating where
2128+ toText = \case
2129+ CRMRMCCAA12 -> "mccaa12"
2130+ CRMRMccaa12a -> "mccaa12a"
2131+ CRMRMCCAA14 -> "mccaa14"
2132+ CRMRMCCAA15 -> "mccaa15"
2133+ CRMRMCCAA16 -> "mccaa16"
2134+ CRMRMCCAA18 -> "mccaa18"
2135+ CRMRMccaaPg -> "mccaaPg"
2136+ CRMRMccaaU -> "mccaaU"
2137+ CRMRMccaaUnrated -> "mccaaUnrated"
2138+
10632139-- | The video\'s rating from the Danish Film Institute\'s (Det Danske
10642140-- Filminstitut) Media Council for Children and Young People.
10652141data ContentRatingMccypRating
@@ -1077,6 +2153,23 @@ data ContentRatingMccypRating
10772153
10782154instance Hashable ContentRatingMccypRating
10792155
2156+instance FromText ContentRatingMccypRating where
2157+ fromText = \case
2158+ "mccyp11" -> Just CRMRMCCYP11
2159+ "mccyp15" -> Just CRMRMCCYP15
2160+ "mccyp7" -> Just CRMRMCCYP7
2161+ "mccypA" -> Just CRMRMccypA
2162+ "mccypUnrated" -> Just CRMRMccypUnrated
2163+ _ -> Nothing
2164+
2165+instance ToText ContentRatingMccypRating where
2166+ toText = \case
2167+ CRMRMCCYP11 -> "mccyp11"
2168+ CRMRMCCYP15 -> "mccyp15"
2169+ CRMRMCCYP7 -> "mccyp7"
2170+ CRMRMccypA -> "mccypA"
2171+ CRMRMccypUnrated -> "mccypUnrated"
2172+
10802173-- | The video\'s rating from Singapore\'s Media Development Authority (MDA)
10812174-- and, specifically, it\'s Board of Film Censors (BFC).
10822175data ContentRatingMdaRating
@@ -1098,6 +2191,27 @@ data ContentRatingMdaRating
10982191
10992192instance Hashable ContentRatingMdaRating
11002193
2194+instance FromText ContentRatingMdaRating where
2195+ fromText = \case
2196+ "mdaG" -> Just CRMRMdaG
2197+ "mdaM18" -> Just CRMRMDAM18
2198+ "mdaNc16" -> Just CRMRMDANC16
2199+ "mdaPg" -> Just CRMRMdaPg
2200+ "mdaPg13" -> Just CRMRMDAPG13
2201+ "mdaR21" -> Just CRMRMDAR21
2202+ "mdaUnrated" -> Just CRMRMdaUnrated
2203+ _ -> Nothing
2204+
2205+instance ToText ContentRatingMdaRating where
2206+ toText = \case
2207+ CRMRMdaG -> "mdaG"
2208+ CRMRMDAM18 -> "mdaM18"
2209+ CRMRMDANC16 -> "mdaNc16"
2210+ CRMRMdaPg -> "mdaPg"
2211+ CRMRMDAPG13 -> "mdaPg13"
2212+ CRMRMDAR21 -> "mdaR21"
2213+ CRMRMdaUnrated -> "mdaUnrated"
2214+
11012215-- | The video\'s rating from Medietilsynet, the Norwegian Media Authority.
11022216data ContentRatingMedietilsynetRating
11032217 = CRMRMEDIETILSYNET11
@@ -1122,6 +2236,31 @@ data ContentRatingMedietilsynetRating
11222236
11232237instance Hashable ContentRatingMedietilsynetRating
11242238
2239+instance FromText ContentRatingMedietilsynetRating where
2240+ fromText = \case
2241+ "medietilsynet11" -> Just CRMRMEDIETILSYNET11
2242+ "medietilsynet12" -> Just CRMRMEDIETILSYNET12
2243+ "medietilsynet15" -> Just CRMRMEDIETILSYNET15
2244+ "medietilsynet18" -> Just CRMRMEDIETILSYNET18
2245+ "medietilsynet6" -> Just CRMRMEDIETILSYNET6
2246+ "medietilsynet7" -> Just CRMRMEDIETILSYNET7
2247+ "medietilsynet9" -> Just CRMRMEDIETILSYNET9
2248+ "medietilsynetA" -> Just CRMRMedietilsynetA
2249+ "medietilsynetUnrated" -> Just CRMRMedietilsynetUnrated
2250+ _ -> Nothing
2251+
2252+instance ToText ContentRatingMedietilsynetRating where
2253+ toText = \case
2254+ CRMRMEDIETILSYNET11 -> "medietilsynet11"
2255+ CRMRMEDIETILSYNET12 -> "medietilsynet12"
2256+ CRMRMEDIETILSYNET15 -> "medietilsynet15"
2257+ CRMRMEDIETILSYNET18 -> "medietilsynet18"
2258+ CRMRMEDIETILSYNET6 -> "medietilsynet6"
2259+ CRMRMEDIETILSYNET7 -> "medietilsynet7"
2260+ CRMRMEDIETILSYNET9 -> "medietilsynet9"
2261+ CRMRMedietilsynetA -> "medietilsynetA"
2262+ CRMRMedietilsynetUnrated -> "medietilsynetUnrated"
2263+
11252264-- | The video\'s rating from Finland\'s Kansallinen Audiovisuaalinen
11262265-- Instituutti (National Audiovisual Institute).
11272266data ContentRatingMekuRating
@@ -1141,6 +2280,25 @@ data ContentRatingMekuRating
11412280
11422281instance Hashable ContentRatingMekuRating
11432282
2283+instance FromText ContentRatingMekuRating where
2284+ fromText = \case
2285+ "meku12" -> Just CRMRMEKU12
2286+ "meku16" -> Just CRMRMEKU16
2287+ "meku18" -> Just CRMRMEKU18
2288+ "meku7" -> Just CRMRMEKU7
2289+ "mekuS" -> Just CRMRMekuS
2290+ "mekuUnrated" -> Just CRMRMekuUnrated
2291+ _ -> Nothing
2292+
2293+instance ToText ContentRatingMekuRating where
2294+ toText = \case
2295+ CRMRMEKU12 -> "meku12"
2296+ CRMRMEKU16 -> "meku16"
2297+ CRMRMEKU18 -> "meku18"
2298+ CRMRMEKU7 -> "meku7"
2299+ CRMRMekuS -> "mekuS"
2300+ CRMRMekuUnrated -> "mekuUnrated"
2301+
11442302-- | The video\'s rating from the Ministero dei Beni e delle Attività
11452303-- Culturali e del Turismo (Italy).
11462304data ContentRatingMibacRating
@@ -1160,6 +2318,25 @@ data ContentRatingMibacRating
11602318
11612319instance Hashable ContentRatingMibacRating
11622320
2321+instance FromText ContentRatingMibacRating where
2322+ fromText = \case
2323+ "mibacT" -> Just CRMRMibacT
2324+ "mibacUnrated" -> Just CRMRMibacUnrated
2325+ "mibacVap" -> Just CRMRMibacVap
2326+ "mibacVm12" -> Just CRMRMIBACVM12
2327+ "mibacVm14" -> Just CRMRMIBACVM14
2328+ "mibacVm18" -> Just CRMRMIBACVM18
2329+ _ -> Nothing
2330+
2331+instance ToText ContentRatingMibacRating where
2332+ toText = \case
2333+ CRMRMibacT -> "mibacT"
2334+ CRMRMibacUnrated -> "mibacUnrated"
2335+ CRMRMibacVap -> "mibacVap"
2336+ CRMRMIBACVM12 -> "mibacVm12"
2337+ CRMRMIBACVM14 -> "mibacVm14"
2338+ CRMRMIBACVM18 -> "mibacVm18"
2339+
11632340-- | The video\'s Ministerio de Cultura (Colombia) rating.
11642341data ContentRatingMocRating
11652342 = CRMRMOC12
@@ -1184,6 +2361,31 @@ data ContentRatingMocRating
11842361
11852362instance Hashable ContentRatingMocRating
11862363
2364+instance FromText ContentRatingMocRating where
2365+ fromText = \case
2366+ "moc12" -> Just CRMRMOC12
2367+ "moc15" -> Just CRMRMOC15
2368+ "moc18" -> Just CRMRMOC18
2369+ "moc7" -> Just CRMRMOC7
2370+ "mocBanned" -> Just CRMRMocBanned
2371+ "mocE" -> Just CRMRMocE
2372+ "mocT" -> Just CRMRMocT
2373+ "mocUnrated" -> Just CRMRMocUnrated
2374+ "mocX" -> Just CRMRMocX
2375+ _ -> Nothing
2376+
2377+instance ToText ContentRatingMocRating where
2378+ toText = \case
2379+ CRMRMOC12 -> "moc12"
2380+ CRMRMOC15 -> "moc15"
2381+ CRMRMOC18 -> "moc18"
2382+ CRMRMOC7 -> "moc7"
2383+ CRMRMocBanned -> "mocBanned"
2384+ CRMRMocE -> "mocE"
2385+ CRMRMocT -> "mocT"
2386+ CRMRMocUnrated -> "mocUnrated"
2387+ CRMRMocX -> "mocX"
2388+
11872389-- | The video\'s rating from Taiwan\'s Ministry of Culture (文化部).
11882390data ContentRatingMoctwRating
11892391 = CRMRMoctwG
@@ -1200,6 +2402,23 @@ data ContentRatingMoctwRating
12002402
12012403instance Hashable ContentRatingMoctwRating
12022404
2405+instance FromText ContentRatingMoctwRating where
2406+ fromText = \case
2407+ "moctwG" -> Just CRMRMoctwG
2408+ "moctwP" -> Just CRMRMoctwP
2409+ "moctwPg" -> Just CRMRMoctwPg
2410+ "moctwR" -> Just CRMRMoctwR
2411+ "moctwUnrated" -> Just CRMRMoctwUnrated
2412+ _ -> Nothing
2413+
2414+instance ToText ContentRatingMoctwRating where
2415+ toText = \case
2416+ CRMRMoctwG -> "moctwG"
2417+ CRMRMoctwP -> "moctwP"
2418+ CRMRMoctwPg -> "moctwPg"
2419+ CRMRMoctwR -> "moctwR"
2420+ CRMRMoctwUnrated -> "moctwUnrated"
2421+
12032422-- | The video\'s Motion Picture Association of America (MPAA) rating.
12042423data ContentRatingMpaaRating
12052424 = CRMRMpaaG
@@ -1218,6 +2437,25 @@ data ContentRatingMpaaRating
12182437
12192438instance Hashable ContentRatingMpaaRating
12202439
2440+instance FromText ContentRatingMpaaRating where
2441+ fromText = \case
2442+ "mpaaG" -> Just CRMRMpaaG
2443+ "mpaaNc17" -> Just CRMRMPAANC17
2444+ "mpaaPg" -> Just CRMRMpaaPg
2445+ "mpaaPg13" -> Just CRMRMPAAPG13
2446+ "mpaaR" -> Just CRMRMpaaR
2447+ "mpaaUnrated" -> Just CRMRMpaaUnrated
2448+ _ -> Nothing
2449+
2450+instance ToText ContentRatingMpaaRating where
2451+ toText = \case
2452+ CRMRMpaaG -> "mpaaG"
2453+ CRMRMPAANC17 -> "mpaaNc17"
2454+ CRMRMpaaPg -> "mpaaPg"
2455+ CRMRMPAAPG13 -> "mpaaPg13"
2456+ CRMRMpaaR -> "mpaaR"
2457+ CRMRMpaaUnrated -> "mpaaUnrated"
2458+
12212459-- | The video\'s rating from the Movie and Television Review and
12222460-- Classification Board (Philippines).
12232461data ContentRatingMtrcbRating
@@ -1239,6 +2477,27 @@ data ContentRatingMtrcbRating
12392477
12402478instance Hashable ContentRatingMtrcbRating
12412479
2480+instance FromText ContentRatingMtrcbRating where
2481+ fromText = \case
2482+ "mtrcbG" -> Just CRMRMtrcbG
2483+ "mtrcbPg" -> Just CRMRMtrcbPg
2484+ "mtrcbR13" -> Just CRMRMTRCBR13
2485+ "mtrcbR16" -> Just CRMRMTRCBR16
2486+ "mtrcbR18" -> Just CRMRMTRCBR18
2487+ "mtrcbUnrated" -> Just CRMRMtrcbUnrated
2488+ "mtrcbX" -> Just CRMRMtrcbX
2489+ _ -> Nothing
2490+
2491+instance ToText ContentRatingMtrcbRating where
2492+ toText = \case
2493+ CRMRMtrcbG -> "mtrcbG"
2494+ CRMRMtrcbPg -> "mtrcbPg"
2495+ CRMRMTRCBR13 -> "mtrcbR13"
2496+ CRMRMTRCBR16 -> "mtrcbR16"
2497+ CRMRMTRCBR18 -> "mtrcbR18"
2498+ CRMRMtrcbUnrated -> "mtrcbUnrated"
2499+ CRMRMtrcbX -> "mtrcbX"
2500+
12422501-- | The video\'s rating from the Maldives National Bureau of Classification.
12432502data ContentRatingNbcRating
12442503 = CRNRNbc12plus
@@ -1261,6 +2520,29 @@ data ContentRatingNbcRating
12612520
12622521instance Hashable ContentRatingNbcRating
12632522
2523+instance FromText ContentRatingNbcRating where
2524+ fromText = \case
2525+ "nbc12plus" -> Just CRNRNbc12plus
2526+ "nbc15plus" -> Just CRNRNbc15plus
2527+ "nbc18plus" -> Just CRNRNbc18plus
2528+ "nbc18plusr" -> Just CRNRNbc18plusr
2529+ "nbcG" -> Just CRNRNbcG
2530+ "nbcPg" -> Just CRNRNbcPg
2531+ "nbcPu" -> Just CRNRNbcPu
2532+ "nbcUnrated" -> Just CRNRNbcUnrated
2533+ _ -> Nothing
2534+
2535+instance ToText ContentRatingNbcRating where
2536+ toText = \case
2537+ CRNRNbc12plus -> "nbc12plus"
2538+ CRNRNbc15plus -> "nbc15plus"
2539+ CRNRNbc18plus -> "nbc18plus"
2540+ CRNRNbc18plusr -> "nbc18plusr"
2541+ CRNRNbcG -> "nbcG"
2542+ CRNRNbcPg -> "nbcPg"
2543+ CRNRNbcPu -> "nbcPu"
2544+ CRNRNbcUnrated -> "nbcUnrated"
2545+
12642546-- | The video\'s rating in Poland.
12652547data ContentRatingNbcplRating
12662548 = CRNRNbcpl18plus
@@ -1279,6 +2561,25 @@ data ContentRatingNbcplRating
12792561
12802562instance Hashable ContentRatingNbcplRating
12812563
2564+instance FromText ContentRatingNbcplRating where
2565+ fromText = \case
2566+ "nbcpl18plus" -> Just CRNRNbcpl18plus
2567+ "nbcplI" -> Just CRNRNbcplI
2568+ "nbcplIi" -> Just CRNRNbcplIi
2569+ "nbcplIii" -> Just CRNRNbcplIii
2570+ "nbcplIv" -> Just CRNRNbcplIv
2571+ "nbcplUnrated" -> Just CRNRNbcplUnrated
2572+ _ -> Nothing
2573+
2574+instance ToText ContentRatingNbcplRating where
2575+ toText = \case
2576+ CRNRNbcpl18plus -> "nbcpl18plus"
2577+ CRNRNbcplI -> "nbcplI"
2578+ CRNRNbcplIi -> "nbcplIi"
2579+ CRNRNbcplIii -> "nbcplIii"
2580+ CRNRNbcplIv -> "nbcplIv"
2581+ CRNRNbcplUnrated -> "nbcplUnrated"
2582+
12822583-- | The video\'s rating from the Bulgarian National Film Center.
12832584data ContentRatingNfrcRating
12842585 = CRNRNfrcA
@@ -1297,6 +2598,25 @@ data ContentRatingNfrcRating
12972598
12982599instance Hashable ContentRatingNfrcRating
12992600
2601+instance FromText ContentRatingNfrcRating where
2602+ fromText = \case
2603+ "nfrcA" -> Just CRNRNfrcA
2604+ "nfrcB" -> Just CRNRNfrcB
2605+ "nfrcC" -> Just CRNRNfrcC
2606+ "nfrcD" -> Just CRNRNfrcD
2607+ "nfrcUnrated" -> Just CRNRNfrcUnrated
2608+ "nfrcX" -> Just CRNRNfrcX
2609+ _ -> Nothing
2610+
2611+instance ToText ContentRatingNfrcRating where
2612+ toText = \case
2613+ CRNRNfrcA -> "nfrcA"
2614+ CRNRNfrcB -> "nfrcB"
2615+ CRNRNfrcC -> "nfrcC"
2616+ CRNRNfrcD -> "nfrcD"
2617+ CRNRNfrcUnrated -> "nfrcUnrated"
2618+ CRNRNfrcX -> "nfrcX"
2619+
13002620-- | The video\'s rating from Nigeria\'s National Film and Video Censors
13012621-- Board.
13022622data ContentRatingNfvcbRating
@@ -1320,6 +2640,29 @@ data ContentRatingNfvcbRating
13202640
13212641instance Hashable ContentRatingNfvcbRating
13222642
2643+instance FromText ContentRatingNfvcbRating where
2644+ fromText = \case
2645+ "nfvcb12" -> Just CRNRNFVCB12
2646+ "nfvcb12a" -> Just CRNRNfvcb12a
2647+ "nfvcb15" -> Just CRNRNFVCB15
2648+ "nfvcb18" -> Just CRNRNFVCB18
2649+ "nfvcbG" -> Just CRNRNfvcbG
2650+ "nfvcbPg" -> Just CRNRNfvcbPg
2651+ "nfvcbRe" -> Just CRNRNfvcbRe
2652+ "nfvcbUnrated" -> Just CRNRNfvcbUnrated
2653+ _ -> Nothing
2654+
2655+instance ToText ContentRatingNfvcbRating where
2656+ toText = \case
2657+ CRNRNFVCB12 -> "nfvcb12"
2658+ CRNRNfvcb12a -> "nfvcb12a"
2659+ CRNRNFVCB15 -> "nfvcb15"
2660+ CRNRNFVCB18 -> "nfvcb18"
2661+ CRNRNfvcbG -> "nfvcbG"
2662+ CRNRNfvcbPg -> "nfvcbPg"
2663+ CRNRNfvcbRe -> "nfvcbRe"
2664+ CRNRNfvcbUnrated -> "nfvcbUnrated"
2665+
13232666-- | The video\'s rating from the Nacionãlais Kino centrs (National Film
13242667-- Centre of Latvia).
13252668data ContentRatingNkclvRating
@@ -1337,6 +2680,23 @@ data ContentRatingNkclvRating
13372680
13382681instance Hashable ContentRatingNkclvRating
13392682
2683+instance FromText ContentRatingNkclvRating where
2684+ fromText = \case
2685+ "nkclv12plus" -> Just CRNRNkclv12plus
2686+ "nkclv18plus" -> Just CRNRNkclv18plus
2687+ "nkclv7plus" -> Just CRNRNkclv7plus
2688+ "nkclvU" -> Just CRNRNkclvU
2689+ "nkclvUnrated" -> Just CRNRNkclvUnrated
2690+ _ -> Nothing
2691+
2692+instance ToText ContentRatingNkclvRating where
2693+ toText = \case
2694+ CRNRNkclv12plus -> "nkclv12plus"
2695+ CRNRNkclv18plus -> "nkclv18plus"
2696+ CRNRNkclv7plus -> "nkclv7plus"
2697+ CRNRNkclvU -> "nkclvU"
2698+ CRNRNkclvUnrated -> "nkclvUnrated"
2699+
13402700-- | The video\'s Office of Film and Literature Classification (OFLC - New
13412701-- Zealand) rating.
13422702data ContentRatingOflcRating
@@ -1364,6 +2724,33 @@ data ContentRatingOflcRating
13642724
13652725instance Hashable ContentRatingOflcRating
13662726
2727+instance FromText ContentRatingOflcRating where
2728+ fromText = \case
2729+ "oflcG" -> Just CROROflcG
2730+ "oflcM" -> Just CROROflcM
2731+ "oflcPg" -> Just CROROflcPg
2732+ "oflcR13" -> Just CROROFLCR13
2733+ "oflcR15" -> Just CROROFLCR15
2734+ "oflcR16" -> Just CROROFLCR16
2735+ "oflcR18" -> Just CROROFLCR18
2736+ "oflcRp13" -> Just CROROFLCRP13
2737+ "oflcRp16" -> Just CROROFLCRP16
2738+ "oflcUnrated" -> Just CROROflcUnrated
2739+ _ -> Nothing
2740+
2741+instance ToText ContentRatingOflcRating where
2742+ toText = \case
2743+ CROROflcG -> "oflcG"
2744+ CROROflcM -> "oflcM"
2745+ CROROflcPg -> "oflcPg"
2746+ CROROFLCR13 -> "oflcR13"
2747+ CROROFLCR15 -> "oflcR15"
2748+ CROROFLCR16 -> "oflcR16"
2749+ CROROFLCR18 -> "oflcR18"
2750+ CROROFLCRP13 -> "oflcRp13"
2751+ CROROFLCRP16 -> "oflcRp16"
2752+ CROROflcUnrated -> "oflcUnrated"
2753+
13672754-- | The video\'s rating in Peru.
13682755data ContentRatingPefilmRating
13692756 = CRPRPEFILM14
@@ -1380,6 +2767,23 @@ data ContentRatingPefilmRating
13802767
13812768instance Hashable ContentRatingPefilmRating
13822769
2770+instance FromText ContentRatingPefilmRating where
2771+ fromText = \case
2772+ "pefilm14" -> Just CRPRPEFILM14
2773+ "pefilm18" -> Just CRPRPEFILM18
2774+ "pefilmPg" -> Just CRPRPefilmPg
2775+ "pefilmPt" -> Just CRPRPefilmPt
2776+ "pefilmUnrated" -> Just CRPRPefilmUnrated
2777+ _ -> Nothing
2778+
2779+instance ToText ContentRatingPefilmRating where
2780+ toText = \case
2781+ CRPRPEFILM14 -> "pefilm14"
2782+ CRPRPEFILM18 -> "pefilm18"
2783+ CRPRPefilmPg -> "pefilmPg"
2784+ CRPRPefilmPt -> "pefilmPt"
2785+ CRPRPefilmUnrated -> "pefilmUnrated"
2786+
13832787-- | The video\'s rating from the Hungarian Nemzeti Filmiroda, the Rating
13842788-- Committee of the National Office of Film.
13852789data ContentRatingRcnofRating
@@ -1401,6 +2805,27 @@ data ContentRatingRcnofRating
14012805
14022806instance Hashable ContentRatingRcnofRating
14032807
2808+instance FromText ContentRatingRcnofRating where
2809+ fromText = \case
2810+ "rcnofI" -> Just CRRRRcnofI
2811+ "rcnofIi" -> Just CRRRRcnofIi
2812+ "rcnofIii" -> Just CRRRRcnofIii
2813+ "rcnofIv" -> Just CRRRRcnofIv
2814+ "rcnofUnrated" -> Just CRRRRcnofUnrated
2815+ "rcnofV" -> Just CRRRRcnofV
2816+ "rcnofVi" -> Just CRRRRcnofVi
2817+ _ -> Nothing
2818+
2819+instance ToText ContentRatingRcnofRating where
2820+ toText = \case
2821+ CRRRRcnofI -> "rcnofI"
2822+ CRRRRcnofIi -> "rcnofIi"
2823+ CRRRRcnofIii -> "rcnofIii"
2824+ CRRRRcnofIv -> "rcnofIv"
2825+ CRRRRcnofUnrated -> "rcnofUnrated"
2826+ CRRRRcnofV -> "rcnofV"
2827+ CRRRRcnofVi -> "rcnofVi"
2828+
14042829-- | The video\'s rating in Venezuela.
14052830data ContentRatingResorteviolenciaRating
14062831 = CRRRResorteviolenciaA
@@ -1419,6 +2844,25 @@ data ContentRatingResorteviolenciaRating
14192844
14202845instance Hashable ContentRatingResorteviolenciaRating
14212846
2847+instance FromText ContentRatingResorteviolenciaRating where
2848+ fromText = \case
2849+ "resorteviolenciaA" -> Just CRRRResorteviolenciaA
2850+ "resorteviolenciaB" -> Just CRRRResorteviolenciaB
2851+ "resorteviolenciaC" -> Just CRRRResorteviolenciaC
2852+ "resorteviolenciaD" -> Just CRRRResorteviolenciaD
2853+ "resorteviolenciaE" -> Just CRRRResorteviolenciaE
2854+ "resorteviolenciaUnrated" -> Just CRRRResorteviolenciaUnrated
2855+ _ -> Nothing
2856+
2857+instance ToText ContentRatingResorteviolenciaRating where
2858+ toText = \case
2859+ CRRRResorteviolenciaA -> "resorteviolenciaA"
2860+ CRRRResorteviolenciaB -> "resorteviolenciaB"
2861+ CRRRResorteviolenciaC -> "resorteviolenciaC"
2862+ CRRRResorteviolenciaD -> "resorteviolenciaD"
2863+ CRRRResorteviolenciaE -> "resorteviolenciaE"
2864+ CRRRResorteviolenciaUnrated -> "resorteviolenciaUnrated"
2865+
14222866-- | The video\'s General Directorate of Radio, Television and Cinematography
14232867-- (Mexico) rating.
14242868data ContentRatingRtcRating
@@ -1440,6 +2884,27 @@ data ContentRatingRtcRating
14402884
14412885instance Hashable ContentRatingRtcRating
14422886
2887+instance FromText ContentRatingRtcRating where
2888+ fromText = \case
2889+ "rtcA" -> Just CRRRRtcA
2890+ "rtcAa" -> Just CRRRRtcAa
2891+ "rtcB" -> Just CRRRRtcB
2892+ "rtcB15" -> Just CRRRRTCB15
2893+ "rtcC" -> Just CRRRRtcC
2894+ "rtcD" -> Just CRRRRtcD
2895+ "rtcUnrated" -> Just CRRRRtcUnrated
2896+ _ -> Nothing
2897+
2898+instance ToText ContentRatingRtcRating where
2899+ toText = \case
2900+ CRRRRtcA -> "rtcA"
2901+ CRRRRtcAa -> "rtcAa"
2902+ CRRRRtcB -> "rtcB"
2903+ CRRRRTCB15 -> "rtcB15"
2904+ CRRRRtcC -> "rtcC"
2905+ CRRRRtcD -> "rtcD"
2906+ CRRRRtcUnrated -> "rtcUnrated"
2907+
14432908-- | The video\'s rating from Ireland\'s Raidió Teilifís Éireann.
14442909data ContentRatingRteRating
14452910 = CRRRRteCh
@@ -1456,6 +2921,23 @@ data ContentRatingRteRating
14562921
14572922instance Hashable ContentRatingRteRating
14582923
2924+instance FromText ContentRatingRteRating where
2925+ fromText = \case
2926+ "rteCh" -> Just CRRRRteCh
2927+ "rteGa" -> Just CRRRRteGa
2928+ "rteMa" -> Just CRRRRteMa
2929+ "rtePs" -> Just CRRRRtePs
2930+ "rteUnrated" -> Just CRRRRteUnrated
2931+ _ -> Nothing
2932+
2933+instance ToText ContentRatingRteRating where
2934+ toText = \case
2935+ CRRRRteCh -> "rteCh"
2936+ CRRRRteGa -> "rteGa"
2937+ CRRRRteMa -> "rteMa"
2938+ CRRRRtePs -> "rtePs"
2939+ CRRRRteUnrated -> "rteUnrated"
2940+
14592941-- | The video\'s National Film Registry of the Russian Federation (MKRF -
14602942-- Russia) rating.
14612943data ContentRatingRussiaRating
@@ -1475,6 +2957,25 @@ data ContentRatingRussiaRating
14752957
14762958instance Hashable ContentRatingRussiaRating
14772959
2960+instance FromText ContentRatingRussiaRating where
2961+ fromText = \case
2962+ "russia0" -> Just CRRRRUSSIA0
2963+ "russia12" -> Just CRRRRUSSIA12
2964+ "russia16" -> Just CRRRRUSSIA16
2965+ "russia18" -> Just CRRRRUSSIA18
2966+ "russia6" -> Just CRRRRUSSIA6
2967+ "russiaUnrated" -> Just CRRRRussiaUnrated
2968+ _ -> Nothing
2969+
2970+instance ToText ContentRatingRussiaRating where
2971+ toText = \case
2972+ CRRRRUSSIA0 -> "russia0"
2973+ CRRRRUSSIA12 -> "russia12"
2974+ CRRRRUSSIA16 -> "russia16"
2975+ CRRRRUSSIA18 -> "russia18"
2976+ CRRRRUSSIA6 -> "russia6"
2977+ CRRRRussiaUnrated -> "russiaUnrated"
2978+
14782979-- | The video\'s rating in Slovakia.
14792980data ContentRatingSkfilmRating
14802981 = CRSRSkfilmG
@@ -1491,6 +2992,23 @@ data ContentRatingSkfilmRating
14912992
14922993instance Hashable ContentRatingSkfilmRating
14932994
2995+instance FromText ContentRatingSkfilmRating where
2996+ fromText = \case
2997+ "skfilmG" -> Just CRSRSkfilmG
2998+ "skfilmP2" -> Just CRSRSKFILMP2
2999+ "skfilmP5" -> Just CRSRSKFILMP5
3000+ "skfilmP8" -> Just CRSRSKFILMP8
3001+ "skfilmUnrated" -> Just CRSRSkfilmUnrated
3002+ _ -> Nothing
3003+
3004+instance ToText ContentRatingSkfilmRating where
3005+ toText = \case
3006+ CRSRSkfilmG -> "skfilmG"
3007+ CRSRSKFILMP2 -> "skfilmP2"
3008+ CRSRSKFILMP5 -> "skfilmP5"
3009+ CRSRSKFILMP8 -> "skfilmP8"
3010+ CRSRSkfilmUnrated -> "skfilmUnrated"
3011+
14943012-- | The video\'s rating in Iceland.
14953013data ContentRatingSmaisRating
14963014 = CRSRSMAIS12
@@ -1511,6 +3029,27 @@ data ContentRatingSmaisRating
15113029
15123030instance Hashable ContentRatingSmaisRating
15133031
3032+instance FromText ContentRatingSmaisRating where
3033+ fromText = \case
3034+ "smais12" -> Just CRSRSMAIS12
3035+ "smais14" -> Just CRSRSMAIS14
3036+ "smais16" -> Just CRSRSMAIS16
3037+ "smais18" -> Just CRSRSMAIS18
3038+ "smais7" -> Just CRSRSMAIS7
3039+ "smaisL" -> Just CRSRSmaisL
3040+ "smaisUnrated" -> Just CRSRSmaisUnrated
3041+ _ -> Nothing
3042+
3043+instance ToText ContentRatingSmaisRating where
3044+ toText = \case
3045+ CRSRSMAIS12 -> "smais12"
3046+ CRSRSMAIS14 -> "smais14"
3047+ CRSRSMAIS16 -> "smais16"
3048+ CRSRSMAIS18 -> "smais18"
3049+ CRSRSMAIS7 -> "smais7"
3050+ CRSRSmaisL -> "smaisL"
3051+ CRSRSmaisUnrated -> "smaisUnrated"
3052+
15143053-- | The video\'s rating from Statens medieråd (Sweden\'s National Media
15153054-- Council).
15163055data ContentRatingSmsaRating
@@ -1528,6 +3067,23 @@ data ContentRatingSmsaRating
15283067
15293068instance Hashable ContentRatingSmsaRating
15303069
3070+instance FromText ContentRatingSmsaRating where
3071+ fromText = \case
3072+ "smsa11" -> Just CRSRSMSA11
3073+ "smsa15" -> Just CRSRSMSA15
3074+ "smsa7" -> Just CRSRSMSA7
3075+ "smsaA" -> Just CRSRSmsaA
3076+ "smsaUnrated" -> Just CRSRSmsaUnrated
3077+ _ -> Nothing
3078+
3079+instance ToText ContentRatingSmsaRating where
3080+ toText = \case
3081+ CRSRSMSA11 -> "smsa11"
3082+ CRSRSMSA15 -> "smsa15"
3083+ CRSRSMSA7 -> "smsa7"
3084+ CRSRSmsaA -> "smsaA"
3085+ CRSRSmsaUnrated -> "smsaUnrated"
3086+
15313087-- | The video\'s TV Parental Guidelines (TVPG) rating.
15323088data ContentRatingTvpgRating
15333089 = CRTRPG14
@@ -1550,6 +3106,29 @@ data ContentRatingTvpgRating
15503106
15513107instance Hashable ContentRatingTvpgRating
15523108
3109+instance FromText ContentRatingTvpgRating where
3110+ fromText = \case
3111+ "pg14" -> Just CRTRPG14
3112+ "tvpgG" -> Just CRTRTvpgG
3113+ "tvpgMa" -> Just CRTRTvpgMa
3114+ "tvpgPg" -> Just CRTRTvpgPg
3115+ "tvpgUnrated" -> Just CRTRTvpgUnrated
3116+ "tvpgY" -> Just CRTRTvpgY
3117+ "tvpgY7" -> Just CRTRTVPGY7
3118+ "tvpgY7Fv" -> Just CRTRTvpgY7Fv
3119+ _ -> Nothing
3120+
3121+instance ToText ContentRatingTvpgRating where
3122+ toText = \case
3123+ CRTRPG14 -> "pg14"
3124+ CRTRTvpgG -> "tvpgG"
3125+ CRTRTvpgMa -> "tvpgMa"
3126+ CRTRTvpgPg -> "tvpgPg"
3127+ CRTRTvpgUnrated -> "tvpgUnrated"
3128+ CRTRTvpgY -> "tvpgY"
3129+ CRTRTVPGY7 -> "tvpgY7"
3130+ CRTRTvpgY7Fv -> "tvpgY7Fv"
3131+
15533132-- | A rating that YouTube uses to identify age-restricted content.
15543133data ContentRatingYtRating
15553134 = CRYRYtAgeRestricted
@@ -1558,6 +3137,15 @@ data ContentRatingYtRating
15583137
15593138instance Hashable ContentRatingYtRating
15603139
3140+instance FromText ContentRatingYtRating where
3141+ fromText = \case
3142+ "ytAgeRestricted" -> Just CRYRYtAgeRestricted
3143+ _ -> Nothing
3144+
3145+instance ToText ContentRatingYtRating where
3146+ toText = \case
3147+ CRYRYtAgeRestricted -> "ytAgeRestricted"
3148+
15613149-- | Describes in which corner of the video the visual widget will appear.
15623150data InvideoPositionCornerPosition
15633151 = IPCPBottomLeft
@@ -1572,6 +3160,21 @@ data InvideoPositionCornerPosition
15723160
15733161instance Hashable InvideoPositionCornerPosition
15743162
3163+instance FromText InvideoPositionCornerPosition where
3164+ fromText = \case
3165+ "bottomLeft" -> Just IPCPBottomLeft
3166+ "bottomRight" -> Just IPCPBottomRight
3167+ "topLeft" -> Just IPCPTopLeft
3168+ "topRight" -> Just IPCPTopRight
3169+ _ -> Nothing
3170+
3171+instance ToText InvideoPositionCornerPosition where
3172+ toText = \case
3173+ IPCPBottomLeft -> "bottomLeft"
3174+ IPCPBottomRight -> "bottomRight"
3175+ IPCPTopLeft -> "topLeft"
3176+ IPCPTopRight -> "topRight"
3177+
15753178-- | Defines the position type.
15763179data InvideoPositionType
15773180 = IPTCorner
@@ -1580,6 +3183,15 @@ data InvideoPositionType
15803183
15813184instance Hashable InvideoPositionType
15823185
3186+instance FromText InvideoPositionType where
3187+ fromText = \case
3188+ "corner" -> Just IPTCorner
3189+ _ -> Nothing
3190+
3191+instance ToText InvideoPositionType where
3192+ toText = \case
3193+ IPTCorner -> "corner"
3194+
15833195-- | Describes a timing type. If the value is offsetFromStart, then the
15843196-- offsetMs field represents an offset from the start of the video. If the
15853197-- value is offsetFromEnd, then the offsetMs field represents an offset
@@ -1593,6 +3205,17 @@ data InvideoTimingType
15933205
15943206instance Hashable InvideoTimingType
15953207
3208+instance FromText InvideoTimingType where
3209+ fromText = \case
3210+ "offsetFromEnd" -> Just ITTOffsetFromEnd
3211+ "offsetFromStart" -> Just ITTOffsetFromStart
3212+ _ -> Nothing
3213+
3214+instance ToText InvideoTimingType where
3215+ toText = \case
3216+ ITTOffsetFromEnd -> "offsetFromEnd"
3217+ ITTOffsetFromStart -> "offsetFromStart"
3218+
15963219-- | The broadcast\'s status. The status can be updated using the API\'s
15973220-- liveBroadcasts.transition method.
15983221data LiveBroadcastStatusLifeCycleStatus
@@ -1622,6 +3245,35 @@ data LiveBroadcastStatusLifeCycleStatus
16223245
16233246instance Hashable LiveBroadcastStatusLifeCycleStatus
16243247
3248+instance FromText LiveBroadcastStatusLifeCycleStatus where
3249+ fromText = \case
3250+ "abandoned" -> Just LBSLCSAbandoned
3251+ "complete" -> Just LBSLCSComplete
3252+ "completeStarting" -> Just LBSLCSCompleteStarting
3253+ "created" -> Just LBSLCSCreated
3254+ "live" -> Just LBSLCSLive
3255+ "liveStarting" -> Just LBSLCSLiveStarting
3256+ "ready" -> Just LBSLCSReady
3257+ "reclaimed" -> Just LBSLCSReclaimed
3258+ "revoked" -> Just LBSLCSRevoked
3259+ "testStarting" -> Just LBSLCSTestStarting
3260+ "testing" -> Just LBSLCSTesting
3261+ _ -> Nothing
3262+
3263+instance ToText LiveBroadcastStatusLifeCycleStatus where
3264+ toText = \case
3265+ LBSLCSAbandoned -> "abandoned"
3266+ LBSLCSComplete -> "complete"
3267+ LBSLCSCompleteStarting -> "completeStarting"
3268+ LBSLCSCreated -> "created"
3269+ LBSLCSLive -> "live"
3270+ LBSLCSLiveStarting -> "liveStarting"
3271+ LBSLCSReady -> "ready"
3272+ LBSLCSReclaimed -> "reclaimed"
3273+ LBSLCSRevoked -> "revoked"
3274+ LBSLCSTestStarting -> "testStarting"
3275+ LBSLCSTesting -> "testing"
3276+
16253277-- | Priority of the live broadcast event (internal state).
16263278data LiveBroadcastStatusLiveBroadcastPriority
16273279 = LBSLBPHigh
@@ -1634,6 +3286,19 @@ data LiveBroadcastStatusLiveBroadcastPriority
16343286
16353287instance Hashable LiveBroadcastStatusLiveBroadcastPriority
16363288
3289+instance FromText LiveBroadcastStatusLiveBroadcastPriority where
3290+ fromText = \case
3291+ "high" -> Just LBSLBPHigh
3292+ "low" -> Just LBSLBPLow
3293+ "normal" -> Just LBSLBPNormal
3294+ _ -> Nothing
3295+
3296+instance ToText LiveBroadcastStatusLiveBroadcastPriority where
3297+ toText = \case
3298+ LBSLBPHigh -> "high"
3299+ LBSLBPLow -> "low"
3300+ LBSLBPNormal -> "normal"
3301+
16373302-- | The broadcast\'s privacy status. Note that the broadcast represents
16383303-- exactly one YouTube video, so the privacy settings are identical to
16393304-- those supported for videos. In addition, you can set this field by
@@ -1650,6 +3315,19 @@ data LiveBroadcastStatusPrivacyStatus
16503315
16513316instance Hashable LiveBroadcastStatusPrivacyStatus
16523317
3318+instance FromText LiveBroadcastStatusPrivacyStatus where
3319+ fromText = \case
3320+ "private" -> Just LBSPSPrivate
3321+ "public" -> Just LBSPSPublic
3322+ "unlisted" -> Just LBSPSUnlisted
3323+ _ -> Nothing
3324+
3325+instance ToText LiveBroadcastStatusPrivacyStatus where
3326+ toText = \case
3327+ LBSPSPrivate -> "private"
3328+ LBSPSPublic -> "public"
3329+ LBSPSUnlisted -> "unlisted"
3330+
16533331-- | The broadcast\'s recording status.
16543332data LiveBroadcastStatusRecordingStatus
16553333 = LBSRSNotRecording
@@ -1662,6 +3340,19 @@ data LiveBroadcastStatusRecordingStatus
16623340
16633341instance Hashable LiveBroadcastStatusRecordingStatus
16643342
3343+instance FromText LiveBroadcastStatusRecordingStatus where
3344+ fromText = \case
3345+ "notRecording" -> Just LBSRSNotRecording
3346+ "recorded" -> Just LBSRSRecorded
3347+ "recording" -> Just LBSRSRecording
3348+ _ -> Nothing
3349+
3350+instance ToText LiveBroadcastStatusRecordingStatus where
3351+ toText = \case
3352+ LBSRSNotRecording -> "notRecording"
3353+ LBSRSRecorded -> "recorded"
3354+ LBSRSRecording -> "recording"
3355+
16653356-- | The type of the topic.
16663357data LiveBroadcastTopicType
16673358 = LBTTVideoGame
@@ -1670,6 +3361,15 @@ data LiveBroadcastTopicType
16703361
16713362instance Hashable LiveBroadcastTopicType
16723363
3364+instance FromText LiveBroadcastTopicType where
3365+ fromText = \case
3366+ "videoGame" -> Just LBTTVideoGame
3367+ _ -> Nothing
3368+
3369+instance ToText LiveBroadcastTopicType where
3370+ toText = \case
3371+ LBTTVideoGame -> "videoGame"
3372+
16733373-- | How severe this issue is to the stream.
16743374data LiveStreamConfigurationIssueSeverity
16753375 = LSCISError
@@ -1682,6 +3382,19 @@ data LiveStreamConfigurationIssueSeverity
16823382
16833383instance Hashable LiveStreamConfigurationIssueSeverity
16843384
3385+instance FromText LiveStreamConfigurationIssueSeverity where
3386+ fromText = \case
3387+ "error" -> Just LSCISError
3388+ "info" -> Just LSCISInfo
3389+ "warning" -> Just LSCISWarning
3390+ _ -> Nothing
3391+
3392+instance ToText LiveStreamConfigurationIssueSeverity where
3393+ toText = \case
3394+ LSCISError -> "error"
3395+ LSCISInfo -> "info"
3396+ LSCISWarning -> "warning"
3397+
16853398-- | The kind of error happening.
16863399data LiveStreamConfigurationIssueType
16873400 = LSCITAudioBitrateHigh
@@ -1754,6 +3467,79 @@ data LiveStreamConfigurationIssueType
17543467
17553468instance Hashable LiveStreamConfigurationIssueType
17563469
3470+instance FromText LiveStreamConfigurationIssueType where
3471+ fromText = \case
3472+ "audioBitrateHigh" -> Just LSCITAudioBitrateHigh
3473+ "audioBitrateLow" -> Just LSCITAudioBitrateLow
3474+ "audioBitrateMismatch" -> Just LSCITAudioBitrateMismatch
3475+ "audioCodec" -> Just LSCITAudioCodec
3476+ "audioCodecMismatch" -> Just LSCITAudioCodecMismatch
3477+ "audioSampleRate" -> Just LSCITAudioSampleRate
3478+ "audioSampleRateMismatch" -> Just LSCITAudioSampleRateMismatch
3479+ "audioStereoMismatch" -> Just LSCITAudioStereoMismatch
3480+ "audioTooManyChannels" -> Just LSCITAudioTooManyChannels
3481+ "badContainer" -> Just LSCITBadContainer
3482+ "bitrateHigh" -> Just LSCITBitrateHigh
3483+ "bitrateLow" -> Just LSCITBitrateLow
3484+ "frameRateHigh" -> Just LSCITFrameRateHigh
3485+ "framerateMismatch" -> Just LSCITFramerateMismatch
3486+ "gopMismatch" -> Just LSCITGopMismatch
3487+ "gopSizeLong" -> Just LSCITGopSizeLong
3488+ "gopSizeOver" -> Just LSCITGopSizeOver
3489+ "gopSizeShort" -> Just LSCITGopSizeShort
3490+ "interlacedVideo" -> Just LSCITInterlacedVideo
3491+ "multipleAudioStreams" -> Just LSCITMultipleAudioStreams
3492+ "multipleVideoStreams" -> Just LSCITMultipleVideoStreams
3493+ "noAudioStream" -> Just LSCITNoAudioStream
3494+ "noVideoStream" -> Just LSCITNoVideoStream
3495+ "openGop" -> Just LSCITOpenGop
3496+ "resolutionMismatch" -> Just LSCITResolutionMismatch
3497+ "videoBitrateMismatch" -> Just LSCITVideoBitrateMismatch
3498+ "videoCodec" -> Just LSCITVideoCodec
3499+ "videoCodecMismatch" -> Just LSCITVideoCodecMismatch
3500+ "videoIngestionStarved" -> Just LSCITVideoIngestionStarved
3501+ "videoInterlaceMismatch" -> Just LSCITVideoInterlaceMismatch
3502+ "videoProfileMismatch" -> Just LSCITVideoProfileMismatch
3503+ "videoResolutionSuboptimal" -> Just LSCITVideoResolutionSuboptimal
3504+ "videoResolutionUnsupported" -> Just LSCITVideoResolutionUnsupported
3505+ _ -> Nothing
3506+
3507+instance ToText LiveStreamConfigurationIssueType where
3508+ toText = \case
3509+ LSCITAudioBitrateHigh -> "audioBitrateHigh"
3510+ LSCITAudioBitrateLow -> "audioBitrateLow"
3511+ LSCITAudioBitrateMismatch -> "audioBitrateMismatch"
3512+ LSCITAudioCodec -> "audioCodec"
3513+ LSCITAudioCodecMismatch -> "audioCodecMismatch"
3514+ LSCITAudioSampleRate -> "audioSampleRate"
3515+ LSCITAudioSampleRateMismatch -> "audioSampleRateMismatch"
3516+ LSCITAudioStereoMismatch -> "audioStereoMismatch"
3517+ LSCITAudioTooManyChannels -> "audioTooManyChannels"
3518+ LSCITBadContainer -> "badContainer"
3519+ LSCITBitrateHigh -> "bitrateHigh"
3520+ LSCITBitrateLow -> "bitrateLow"
3521+ LSCITFrameRateHigh -> "frameRateHigh"
3522+ LSCITFramerateMismatch -> "framerateMismatch"
3523+ LSCITGopMismatch -> "gopMismatch"
3524+ LSCITGopSizeLong -> "gopSizeLong"
3525+ LSCITGopSizeOver -> "gopSizeOver"
3526+ LSCITGopSizeShort -> "gopSizeShort"
3527+ LSCITInterlacedVideo -> "interlacedVideo"
3528+ LSCITMultipleAudioStreams -> "multipleAudioStreams"
3529+ LSCITMultipleVideoStreams -> "multipleVideoStreams"
3530+ LSCITNoAudioStream -> "noAudioStream"
3531+ LSCITNoVideoStream -> "noVideoStream"
3532+ LSCITOpenGop -> "openGop"
3533+ LSCITResolutionMismatch -> "resolutionMismatch"
3534+ LSCITVideoBitrateMismatch -> "videoBitrateMismatch"
3535+ LSCITVideoCodec -> "videoCodec"
3536+ LSCITVideoCodecMismatch -> "videoCodecMismatch"
3537+ LSCITVideoIngestionStarved -> "videoIngestionStarved"
3538+ LSCITVideoInterlaceMismatch -> "videoInterlaceMismatch"
3539+ LSCITVideoProfileMismatch -> "videoProfileMismatch"
3540+ LSCITVideoResolutionSuboptimal -> "videoResolutionSuboptimal"
3541+ LSCITVideoResolutionUnsupported -> "videoResolutionUnsupported"
3542+
17573543-- | The status code of this stream
17583544data LiveStreamHealthStatusStatus
17593545 = LSHSSBad
@@ -1770,6 +3556,23 @@ data LiveStreamHealthStatusStatus
17703556
17713557instance Hashable LiveStreamHealthStatusStatus
17723558
3559+instance FromText LiveStreamHealthStatusStatus where
3560+ fromText = \case
3561+ "bad" -> Just LSHSSBad
3562+ "good" -> Just LSHSSGood
3563+ "noData" -> Just LSHSSNoData
3564+ "ok" -> Just LSHSSOK
3565+ "revoked" -> Just LSHSSRevoked
3566+ _ -> Nothing
3567+
3568+instance ToText LiveStreamHealthStatusStatus where
3569+ toText = \case
3570+ LSHSSBad -> "bad"
3571+ LSHSSGood -> "good"
3572+ LSHSSNoData -> "noData"
3573+ LSHSSOK -> "ok"
3574+ LSHSSRevoked -> "revoked"
3575+
17733576data LiveStreamStatusStreamStatus
17743577 = LSSSSActive
17753578 -- ^ @active@
@@ -1785,6 +3588,23 @@ data LiveStreamStatusStreamStatus
17853588
17863589instance Hashable LiveStreamStatusStreamStatus
17873590
3591+instance FromText LiveStreamStatusStreamStatus where
3592+ fromText = \case
3593+ "active" -> Just LSSSSActive
3594+ "created" -> Just LSSSSCreated
3595+ "error" -> Just LSSSSError
3596+ "inactive" -> Just LSSSSInactive
3597+ "ready" -> Just LSSSSReady
3598+ _ -> Nothing
3599+
3600+instance ToText LiveStreamStatusStreamStatus where
3601+ toText = \case
3602+ LSSSSActive -> "active"
3603+ LSSSSCreated -> "created"
3604+ LSSSSError -> "error"
3605+ LSSSSInactive -> "inactive"
3606+ LSSSSReady -> "ready"
3607+
17883608-- | This resource\'s privacy status.
17893609data PlaylistItemStatusPrivacyStatus
17903610 = PISPSPrivate
@@ -1797,6 +3617,19 @@ data PlaylistItemStatusPrivacyStatus
17973617
17983618instance Hashable PlaylistItemStatusPrivacyStatus
17993619
3620+instance FromText PlaylistItemStatusPrivacyStatus where
3621+ fromText = \case
3622+ "private" -> Just PISPSPrivate
3623+ "public" -> Just PISPSPublic
3624+ "unlisted" -> Just PISPSUnlisted
3625+ _ -> Nothing
3626+
3627+instance ToText PlaylistItemStatusPrivacyStatus where
3628+ toText = \case
3629+ PISPSPrivate -> "private"
3630+ PISPSPublic -> "public"
3631+ PISPSUnlisted -> "unlisted"
3632+
18003633-- | The playlist\'s privacy status.
18013634data PlaylistStatusPrivacyStatus
18023635 = PSPSPrivate
@@ -1809,6 +3642,19 @@ data PlaylistStatusPrivacyStatus
18093642
18103643instance Hashable PlaylistStatusPrivacyStatus
18113644
3645+instance FromText PlaylistStatusPrivacyStatus where
3646+ fromText = \case
3647+ "private" -> Just PSPSPrivate
3648+ "public" -> Just PSPSPublic
3649+ "unlisted" -> Just PSPSUnlisted
3650+ _ -> Nothing
3651+
3652+instance ToText PlaylistStatusPrivacyStatus where
3653+ toText = \case
3654+ PSPSPrivate -> "private"
3655+ PSPSPublic -> "public"
3656+ PSPSUnlisted -> "unlisted"
3657+
18123658-- | Describes the type of the promoted item.
18133659data PromotedItemIdType
18143660 = PIITRecentUpload
@@ -1821,6 +3667,19 @@ data PromotedItemIdType
18213667
18223668instance Hashable PromotedItemIdType
18233669
3670+instance FromText PromotedItemIdType where
3671+ fromText = \case
3672+ "recentUpload" -> Just PIITRecentUpload
3673+ "video" -> Just PIITVideo
3674+ "website" -> Just PIITWebsite
3675+ _ -> Nothing
3676+
3677+instance ToText PromotedItemIdType where
3678+ toText = \case
3679+ PIITRecentUpload -> "recentUpload"
3680+ PIITVideo -> "video"
3681+ PIITWebsite -> "website"
3682+
18243683-- | It indicates if the resource (video or channel) has upcoming\/active
18253684-- live broadcast content. Or it\'s \"none\" if there is not any
18263685-- upcoming\/active live broadcasts.
@@ -1835,6 +3694,19 @@ data SearchResultSnippetLiveBroadcastContent
18353694
18363695instance Hashable SearchResultSnippetLiveBroadcastContent
18373696
3697+instance FromText SearchResultSnippetLiveBroadcastContent where
3698+ fromText = \case
3699+ "live" -> Just SRSLBCLive
3700+ "none" -> Just SRSLBCNone
3701+ "upcoming" -> Just SRSLBCUpcoming
3702+ _ -> Nothing
3703+
3704+instance ToText SearchResultSnippetLiveBroadcastContent where
3705+ toText = \case
3706+ SRSLBCLive -> "live"
3707+ SRSLBCNone -> "none"
3708+ SRSLBCUpcoming -> "upcoming"
3709+
18383710-- | The type of activity this subscription is for (only uploads,
18393711-- everything).
18403712data SubscriptionContentDetailsActivityType
@@ -1846,6 +3718,17 @@ data SubscriptionContentDetailsActivityType
18463718
18473719instance Hashable SubscriptionContentDetailsActivityType
18483720
3721+instance FromText SubscriptionContentDetailsActivityType where
3722+ fromText = \case
3723+ "all" -> Just SCDATAll
3724+ "uploads" -> Just SCDATUploads
3725+ _ -> Nothing
3726+
3727+instance ToText SubscriptionContentDetailsActivityType where
3728+ toText = \case
3729+ SCDATAll -> "all"
3730+ SCDATUploads -> "uploads"
3731+
18493732-- | Video game rating, if any.
18503733data VideoAgeGatingVideoGameRating
18513734 = VAGVGRAnyone
@@ -1860,6 +3743,21 @@ data VideoAgeGatingVideoGameRating
18603743
18613744instance Hashable VideoAgeGatingVideoGameRating
18623745
3746+instance FromText VideoAgeGatingVideoGameRating where
3747+ fromText = \case
3748+ "anyone" -> Just VAGVGRAnyone
3749+ "m15Plus" -> Just VAGVGRM15Plus
3750+ "m16Plus" -> Just VAGVGRM16Plus
3751+ "m17Plus" -> Just VAGVGRM17Plus
3752+ _ -> Nothing
3753+
3754+instance ToText VideoAgeGatingVideoGameRating where
3755+ toText = \case
3756+ VAGVGRAnyone -> "anyone"
3757+ VAGVGRM15Plus -> "m15Plus"
3758+ VAGVGRM16Plus -> "m16Plus"
3759+ VAGVGRM17Plus -> "m17Plus"
3760+
18633761-- | The value of captions indicates whether the video has captions or not.
18643762data VideoContentDetailsCaption
18653763 = VCDCFalse
@@ -1870,6 +3768,17 @@ data VideoContentDetailsCaption
18703768
18713769instance Hashable VideoContentDetailsCaption
18723770
3771+instance FromText VideoContentDetailsCaption where
3772+ fromText = \case
3773+ "false" -> Just VCDCFalse
3774+ "true" -> Just VCDCTrue
3775+ _ -> Nothing
3776+
3777+instance ToText VideoContentDetailsCaption where
3778+ toText = \case
3779+ VCDCFalse -> "false"
3780+ VCDCTrue -> "true"
3781+
18733782-- | The value of definition indicates whether the video is available in high
18743783-- definition or only in standard definition.
18753784data VideoContentDetailsDefinition
@@ -1881,6 +3790,17 @@ data VideoContentDetailsDefinition
18813790
18823791instance Hashable VideoContentDetailsDefinition
18833792
3793+instance FromText VideoContentDetailsDefinition where
3794+ fromText = \case
3795+ "hd" -> Just VCDDHD
3796+ "sd" -> Just VCDDSD
3797+ _ -> Nothing
3798+
3799+instance ToText VideoContentDetailsDefinition where
3800+ toText = \case
3801+ VCDDHD -> "hd"
3802+ VCDDSD -> "sd"
3803+
18843804-- | Defines the context of the ping.
18853805data VideoConversionPingContext
18863806 = VCPCComment
@@ -1895,6 +3815,21 @@ data VideoConversionPingContext
18953815
18963816instance Hashable VideoConversionPingContext
18973817
3818+instance FromText VideoConversionPingContext where
3819+ fromText = \case
3820+ "comment" -> Just VCPCComment
3821+ "dislike" -> Just VCPCDislike
3822+ "like" -> Just VCPCLike
3823+ "share" -> Just VCPCShare
3824+ _ -> Nothing
3825+
3826+instance ToText VideoConversionPingContext where
3827+ toText = \case
3828+ VCPCComment -> "comment"
3829+ VCPCDislike -> "dislike"
3830+ VCPCLike -> "like"
3831+ VCPCShare -> "share"
3832+
18983833-- | The uploaded file\'s type as detected by YouTube\'s video processing
18993834-- engine. Currently, YouTube only processes video files, but this field is
19003835-- present whether a video file or another type of file was uploaded.
@@ -1917,6 +3852,27 @@ data VideoFileDetailsFileType
19173852
19183853instance Hashable VideoFileDetailsFileType
19193854
3855+instance FromText VideoFileDetailsFileType where
3856+ fromText = \case
3857+ "archive" -> Just VFDFTArchive
3858+ "audio" -> Just VFDFTAudio
3859+ "document" -> Just VFDFTDocument
3860+ "image" -> Just VFDFTImage
3861+ "other" -> Just VFDFTOther
3862+ "project" -> Just VFDFTProject
3863+ "video" -> Just VFDFTVideo
3864+ _ -> Nothing
3865+
3866+instance ToText VideoFileDetailsFileType where
3867+ toText = \case
3868+ VFDFTArchive -> "archive"
3869+ VFDFTAudio -> "audio"
3870+ VFDFTDocument -> "document"
3871+ VFDFTImage -> "image"
3872+ VFDFTOther -> "other"
3873+ VFDFTProject -> "project"
3874+ VFDFTVideo -> "video"
3875+
19203876-- | The amount that YouTube needs to rotate the original source content to
19213877-- properly display the video.
19223878data VideoFileDetailsVideoStreamRotation
@@ -1934,6 +3890,23 @@ data VideoFileDetailsVideoStreamRotation
19343890
19353891instance Hashable VideoFileDetailsVideoStreamRotation
19363892
3893+instance FromText VideoFileDetailsVideoStreamRotation where
3894+ fromText = \case
3895+ "clockwise" -> Just VFDVSRClockwise
3896+ "counterClockwise" -> Just VFDVSRCounterClockwise
3897+ "none" -> Just VFDVSRNone
3898+ "other" -> Just VFDVSROther
3899+ "upsideDown" -> Just VFDVSRUpsideDown
3900+ _ -> Nothing
3901+
3902+instance ToText VideoFileDetailsVideoStreamRotation where
3903+ toText = \case
3904+ VFDVSRClockwise -> "clockwise"
3905+ VFDVSRCounterClockwise -> "counterClockwise"
3906+ VFDVSRNone -> "none"
3907+ VFDVSROther -> "other"
3908+ VFDVSRUpsideDown -> "upsideDown"
3909+
19373910-- | The reason that YouTube failed to process the video. This property will
19383911-- only have a value if the processingStatus property\'s value is failed.
19393912data VideoProcessingDetailsProcessingFailureReason
@@ -1949,6 +3922,21 @@ data VideoProcessingDetailsProcessingFailureReason
19493922
19503923instance Hashable VideoProcessingDetailsProcessingFailureReason
19513924
3925+instance FromText VideoProcessingDetailsProcessingFailureReason where
3926+ fromText = \case
3927+ "other" -> Just VPDPFROther
3928+ "streamingFailed" -> Just VPDPFRStreamingFailed
3929+ "transcodeFailed" -> Just VPDPFRTranscodeFailed
3930+ "uploadFailed" -> Just VPDPFRUploadFailed
3931+ _ -> Nothing
3932+
3933+instance ToText VideoProcessingDetailsProcessingFailureReason where
3934+ toText = \case
3935+ VPDPFROther -> "other"
3936+ VPDPFRStreamingFailed -> "streamingFailed"
3937+ VPDPFRTranscodeFailed -> "transcodeFailed"
3938+ VPDPFRUploadFailed -> "uploadFailed"
3939+
19523940-- | The video\'s processing status. This value indicates whether YouTube was
19533941-- able to process the video or if the video is still being processed.
19543942data VideoProcessingDetailsProcessingStatus
@@ -1964,6 +3952,21 @@ data VideoProcessingDetailsProcessingStatus
19643952
19653953instance Hashable VideoProcessingDetailsProcessingStatus
19663954
3955+instance FromText VideoProcessingDetailsProcessingStatus where
3956+ fromText = \case
3957+ "failed" -> Just VPDPSFailed
3958+ "processing" -> Just VPDPSProcessing
3959+ "succeeded" -> Just VPDPSSucceeded
3960+ "terminated" -> Just VPDPSTerminated
3961+ _ -> Nothing
3962+
3963+instance ToText VideoProcessingDetailsProcessingStatus where
3964+ toText = \case
3965+ VPDPSFailed -> "failed"
3966+ VPDPSProcessing -> "processing"
3967+ VPDPSSucceeded -> "succeeded"
3968+ VPDPSTerminated -> "terminated"
3969+
19673970data VideoRatingRating
19683971 = VRRDislike
19693972 -- ^ @dislike@
@@ -1977,6 +3980,21 @@ data VideoRatingRating
19773980
19783981instance Hashable VideoRatingRating
19793982
3983+instance FromText VideoRatingRating where
3984+ fromText = \case
3985+ "dislike" -> Just VRRDislike
3986+ "like" -> Just VRRLike
3987+ "none" -> Just VRRNone
3988+ "unspecified" -> Just VRRUnspecified
3989+ _ -> Nothing
3990+
3991+instance ToText VideoRatingRating where
3992+ toText = \case
3993+ VRRDislike -> "dislike"
3994+ VRRLike -> "like"
3995+ VRRNone -> "none"
3996+ VRRUnspecified -> "unspecified"
3997+
19803998-- | Indicates if the video is an upcoming\/active live broadcast. Or it\'s
19813999-- \"none\" if the video is not an upcoming\/active live broadcast.
19824000data VideoSnippetLiveBroadcastContent
@@ -1990,6 +4008,19 @@ data VideoSnippetLiveBroadcastContent
19904008
19914009instance Hashable VideoSnippetLiveBroadcastContent
19924010
4011+instance FromText VideoSnippetLiveBroadcastContent where
4012+ fromText = \case
4013+ "live" -> Just VSLBCLive
4014+ "none" -> Just VSLBCNone
4015+ "upcoming" -> Just VSLBCUpcoming
4016+ _ -> Nothing
4017+
4018+instance ToText VideoSnippetLiveBroadcastContent where
4019+ toText = \case
4020+ VSLBCLive -> "live"
4021+ VSLBCNone -> "none"
4022+ VSLBCUpcoming -> "upcoming"
4023+
19934024-- | This value explains why a video failed to upload. This property is only
19944025-- present if the uploadStatus property indicates that the upload failed.
19954026data VideoStatusFailureReason
@@ -2009,6 +4040,25 @@ data VideoStatusFailureReason
20094040
20104041instance Hashable VideoStatusFailureReason
20114042
4043+instance FromText VideoStatusFailureReason where
4044+ fromText = \case
4045+ "codec" -> Just VSFRCodec
4046+ "conversion" -> Just VSFRConversion
4047+ "emptyFile" -> Just VSFREmptyFile
4048+ "invalidFile" -> Just VSFRInvalidFile
4049+ "tooSmall" -> Just VSFRTooSmall
4050+ "uploadAborted" -> Just VSFRUploadAborted
4051+ _ -> Nothing
4052+
4053+instance ToText VideoStatusFailureReason where
4054+ toText = \case
4055+ VSFRCodec -> "codec"
4056+ VSFRConversion -> "conversion"
4057+ VSFREmptyFile -> "emptyFile"
4058+ VSFRInvalidFile -> "invalidFile"
4059+ VSFRTooSmall -> "tooSmall"
4060+ VSFRUploadAborted -> "uploadAborted"
4061+
20124062-- | The video\'s license.
20134063data VideoStatusLicense
20144064 = VSLCreativeCommon
@@ -2019,6 +4069,17 @@ data VideoStatusLicense
20194069
20204070instance Hashable VideoStatusLicense
20214071
4072+instance FromText VideoStatusLicense where
4073+ fromText = \case
4074+ "creativeCommon" -> Just VSLCreativeCommon
4075+ "youtube" -> Just VSLYoutube
4076+ _ -> Nothing
4077+
4078+instance ToText VideoStatusLicense where
4079+ toText = \case
4080+ VSLCreativeCommon -> "creativeCommon"
4081+ VSLYoutube -> "youtube"
4082+
20224083-- | The video\'s privacy status.
20234084data VideoStatusPrivacyStatus
20244085 = VSPSPrivate
@@ -2031,6 +4092,19 @@ data VideoStatusPrivacyStatus
20314092
20324093instance Hashable VideoStatusPrivacyStatus
20334094
4095+instance FromText VideoStatusPrivacyStatus where
4096+ fromText = \case
4097+ "private" -> Just VSPSPrivate
4098+ "public" -> Just VSPSPublic
4099+ "unlisted" -> Just VSPSUnlisted
4100+ _ -> Nothing
4101+
4102+instance ToText VideoStatusPrivacyStatus where
4103+ toText = \case
4104+ VSPSPrivate -> "private"
4105+ VSPSPublic -> "public"
4106+ VSPSUnlisted -> "unlisted"
4107+
20344108-- | This value explains why YouTube rejected an uploaded video. This
20354109-- property is only present if the uploadStatus property indicates that the
20364110-- upload was rejected.
@@ -2057,6 +4131,31 @@ data VideoStatusRejectionReason
20574131
20584132instance Hashable VideoStatusRejectionReason
20594133
4134+instance FromText VideoStatusRejectionReason where
4135+ fromText = \case
4136+ "claim" -> Just VSRRClaim
4137+ "copyright" -> Just VSRRCopyright
4138+ "duplicate" -> Just VSRRDuplicate
4139+ "inappropriate" -> Just VSRRInappropriate
4140+ "length" -> Just VSRRLength
4141+ "termsOfUse" -> Just VSRRTermsOfUse
4142+ "trademark" -> Just VSRRTrademark
4143+ "uploaderAccountClosed" -> Just VSRRUploaderAccountClosed
4144+ "uploaderAccountSuspended" -> Just VSRRUploaderAccountSuspended
4145+ _ -> Nothing
4146+
4147+instance ToText VideoStatusRejectionReason where
4148+ toText = \case
4149+ VSRRClaim -> "claim"
4150+ VSRRCopyright -> "copyright"
4151+ VSRRDuplicate -> "duplicate"
4152+ VSRRInappropriate -> "inappropriate"
4153+ VSRRLength -> "length"
4154+ VSRRTermsOfUse -> "termsOfUse"
4155+ VSRRTrademark -> "trademark"
4156+ VSRRUploaderAccountClosed -> "uploaderAccountClosed"
4157+ VSRRUploaderAccountSuspended -> "uploaderAccountSuspended"
4158+
20604159-- | The status of the uploaded video.
20614160data VideoStatusUploadStatus
20624161 = VSUSDeleted
@@ -2073,6 +4172,23 @@ data VideoStatusUploadStatus
20734172
20744173instance Hashable VideoStatusUploadStatus
20754174
4175+instance FromText VideoStatusUploadStatus where
4176+ fromText = \case
4177+ "deleted" -> Just VSUSDeleted
4178+ "failed" -> Just VSUSFailed
4179+ "processed" -> Just VSUSProcessed
4180+ "rejected" -> Just VSUSRejected
4181+ "uploaded" -> Just VSUSUploaded
4182+ _ -> Nothing
4183+
4184+instance ToText VideoStatusUploadStatus where
4185+ toText = \case
4186+ VSUSDeleted -> "deleted"
4187+ VSUSFailed -> "failed"
4188+ VSUSProcessed -> "processed"
4189+ VSUSRejected -> "rejected"
4190+ VSUSUploaded -> "uploaded"
4191+
20764192data VideoSuggestionsItemEditorSuggestions
20774193 = VSIESAudioQuietAudioSwap
20784194 -- ^ @audioQuietAudioSwap@
@@ -2086,6 +4202,21 @@ data VideoSuggestionsItemEditorSuggestions
20864202
20874203instance Hashable VideoSuggestionsItemEditorSuggestions
20884204
4205+instance FromText VideoSuggestionsItemEditorSuggestions where
4206+ fromText = \case
4207+ "audioQuietAudioSwap" -> Just VSIESAudioQuietAudioSwap
4208+ "videoAutoLevels" -> Just VSIESVideoAutoLevels
4209+ "videoCrop" -> Just VSIESVideoCrop
4210+ "videoStabilize" -> Just VSIESVideoStabilize
4211+ _ -> Nothing
4212+
4213+instance ToText VideoSuggestionsItemEditorSuggestions where
4214+ toText = \case
4215+ VSIESAudioQuietAudioSwap -> "audioQuietAudioSwap"
4216+ VSIESVideoAutoLevels -> "videoAutoLevels"
4217+ VSIESVideoCrop -> "videoCrop"
4218+ VSIESVideoStabilize -> "videoStabilize"
4219+
20894220data VideoSuggestionsItemProcessingErrors
20904221 = VSIPEArchiveFile
20914222 -- ^ @archiveFile@
@@ -2103,6 +4234,25 @@ data VideoSuggestionsItemProcessingErrors
21034234
21044235instance Hashable VideoSuggestionsItemProcessingErrors
21054236
4237+instance FromText VideoSuggestionsItemProcessingErrors where
4238+ fromText = \case
4239+ "archiveFile" -> Just VSIPEArchiveFile
4240+ "audioFile" -> Just VSIPEAudioFile
4241+ "docFile" -> Just VSIPEDocFile
4242+ "imageFile" -> Just VSIPEImageFile
4243+ "notAVideoFile" -> Just VSIPENotAVideoFile
4244+ "projectFile" -> Just VSIPEProjectFile
4245+ _ -> Nothing
4246+
4247+instance ToText VideoSuggestionsItemProcessingErrors where
4248+ toText = \case
4249+ VSIPEArchiveFile -> "archiveFile"
4250+ VSIPEAudioFile -> "audioFile"
4251+ VSIPEDocFile -> "docFile"
4252+ VSIPEImageFile -> "imageFile"
4253+ VSIPENotAVideoFile -> "notAVideoFile"
4254+ VSIPEProjectFile -> "projectFile"
4255+
21064256data VideoSuggestionsItemProcessingHints
21074257 = VSIPHNonStreamableMov
21084258 -- ^ @nonStreamableMov@
@@ -2112,6 +4262,17 @@ data VideoSuggestionsItemProcessingHints
21124262
21134263instance Hashable VideoSuggestionsItemProcessingHints
21144264
4265+instance FromText VideoSuggestionsItemProcessingHints where
4266+ fromText = \case
4267+ "nonStreamableMov" -> Just VSIPHNonStreamableMov
4268+ "sendBestQualityVideo" -> Just VSIPHSendBestQualityVideo
4269+ _ -> Nothing
4270+
4271+instance ToText VideoSuggestionsItemProcessingHints where
4272+ toText = \case
4273+ VSIPHNonStreamableMov -> "nonStreamableMov"
4274+ VSIPHSendBestQualityVideo -> "sendBestQualityVideo"
4275+
21154276data VideoSuggestionsItemProcessingWarnings
21164277 = VSIPWHasEditlist
21174278 -- ^ @hasEditlist@
@@ -2130,3 +4291,24 @@ data VideoSuggestionsItemProcessingWarnings
21304291 deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
21314292
21324293instance Hashable VideoSuggestionsItemProcessingWarnings
4294+
4295+instance FromText VideoSuggestionsItemProcessingWarnings where
4296+ fromText = \case
4297+ "hasEditlist" -> Just VSIPWHasEditlist
4298+ "inconsistentResolution" -> Just VSIPWInconsistentResolution
4299+ "problematicAudioCodec" -> Just VSIPWProblematicAudioCodec
4300+ "problematicVideoCodec" -> Just VSIPWProblematicVideoCodec
4301+ "unknownAudioCodec" -> Just VSIPWUnknownAudioCodec
4302+ "unknownContainer" -> Just VSIPWUnknownContainer
4303+ "unknownVideoCodec" -> Just VSIPWUnknownVideoCodec
4304+ _ -> Nothing
4305+
4306+instance ToText VideoSuggestionsItemProcessingWarnings where
4307+ toText = \case
4308+ VSIPWHasEditlist -> "hasEditlist"
4309+ VSIPWInconsistentResolution -> "inconsistentResolution"
4310+ VSIPWProblematicAudioCodec -> "problematicAudioCodec"
4311+ VSIPWProblematicVideoCodec -> "problematicVideoCodec"
4312+ VSIPWUnknownAudioCodec -> "unknownAudioCodec"
4313+ VSIPWUnknownContainer -> "unknownContainer"
4314+ VSIPWUnknownVideoCodec -> "unknownVideoCodec"