├── tool ├── CHANGELOG.md └── grind.dart ├── example ├── analysis_options.yaml ├── credentials.yaml ├── pubspec.yaml ├── chatbot.yaml ├── livechat_example.dart └── example.sh ├── lib ├── src │ ├── oauth │ │ ├── refresh_token_generator.dart │ │ ├── oauth_access_control.dart │ │ ├── oauth_access_control_interface.dart │ │ └── oauth_access_control_web.dart │ ├── util │ │ ├── authorization_exception.dart │ │ ├── extras.dart │ │ ├── emoji_formatter.dart │ │ ├── enum.dart │ │ ├── logging_interceptors.dart │ │ └── phrase_match.dart │ ├── model │ │ ├── response_metadata.dart │ │ ├── playlist │ │ │ ├── status.dart │ │ │ ├── player.g.dart │ │ │ ├── status.g.dart │ │ │ ├── content_details.g.dart │ │ │ ├── player.dart │ │ │ ├── content_details.dart │ │ │ ├── playlist_response.dart │ │ │ ├── snippet.dart │ │ │ ├── snippet.g.dart │ │ │ ├── playlist_response.g.dart │ │ │ └── playlist.g.dart │ │ ├── videos │ │ │ ├── rating.dart │ │ │ ├── player.dart │ │ │ ├── rating.g.dart │ │ │ ├── player.g.dart │ │ │ ├── statistics.dart │ │ │ ├── category_snippet.g.dart │ │ │ ├── video_get_rating_response.g.dart │ │ │ ├── video_category.g.dart │ │ │ ├── content_details.dart │ │ │ ├── video_get_rating_response.dart │ │ │ ├── video_category_list_response.g.dart │ │ │ ├── report_abuse.g.dart │ │ │ ├── category_snippet.dart │ │ │ ├── live_streaming_details.dart │ │ │ ├── statistics.g.dart │ │ │ ├── video_category.dart │ │ │ ├── video_list_response.dart │ │ │ ├── video_category_list_response.dart │ │ │ ├── status.dart │ │ │ ├── content_details.g.dart │ │ │ ├── video_list_response.g.dart │ │ │ ├── live_streaming_details.g.dart │ │ │ ├── status.g.dart │ │ │ ├── report_abuse.dart │ │ │ └── video_item.g.dart │ │ ├── playlistItem │ │ │ ├── status.g.dart │ │ │ ├── resource_id.g.dart │ │ │ ├── status.dart │ │ │ ├── content_details.g.dart │ │ │ ├── resource_id.dart │ │ │ ├── content_details.dart │ │ │ ├── playlist_item.g.dart │ │ │ ├── playlist_item_list_response.g.dart │ │ │ ├── playlist_item_list_response.dart │ │ │ └── snippet.g.dart │ │ ├── chat │ │ │ ├── keyword.dart │ │ │ ├── text_message_details.g.dart │ │ │ ├── message_deleted_details.g.dart │ │ │ ├── keyword.g.dart │ │ │ ├── text_message_details.dart │ │ │ ├── dialog.g.dart │ │ │ ├── super_sticker_metadata.g.dart │ │ │ ├── banned_user_details.g.dart │ │ │ ├── user_banned_details.g.dart │ │ │ ├── super_chat_details.g.dart │ │ │ ├── banned_user_details.dart │ │ │ ├── live_chat_message.g.dart │ │ │ ├── dialog.dart │ │ │ ├── super_sticker_details.g.dart │ │ │ ├── message_deleted_details.dart │ │ │ ├── super_sticker_metadata.dart │ │ │ ├── user_banned_details.dart │ │ │ ├── author_details.g.dart │ │ │ ├── live_chat_message.dart │ │ │ ├── live_chat_message_list_response.g.dart │ │ │ └── author_details.dart │ │ ├── comments │ │ │ ├── author_channel_id.g.dart │ │ │ ├── comment.dart │ │ │ ├── author_channel_id.dart │ │ │ ├── comment.g.dart │ │ │ ├── comment_list_response.dart │ │ │ └── comment_list_response.g.dart │ │ ├── broadcast │ │ │ ├── statistics.g.dart │ │ │ ├── monitor_stream.g.dart │ │ │ ├── configuration_issue.g.dart │ │ │ ├── status.g.dart │ │ │ ├── health_status.g.dart │ │ │ ├── statistics.dart │ │ │ ├── live_broadcast_response.g.dart │ │ │ ├── live_broadcast_item.g.dart │ │ │ ├── health_status.dart │ │ │ ├── configuration_issue.dart │ │ │ └── live_broadcast_response.dart │ │ ├── search │ │ │ ├── id.dart │ │ │ ├── id.g.dart │ │ │ ├── search_result.g.dart │ │ │ ├── snippet.dart │ │ │ ├── snippet.g.dart │ │ │ ├── search_list_response.g.dart │ │ │ ├── search_result.dart │ │ │ └── search_list_response.dart │ │ ├── localized.g.dart │ │ ├── subscriptions │ │ │ ├── resource_id.g.dart │ │ │ ├── resource_id.dart │ │ │ ├── content_details.g.dart │ │ │ ├── subscriber_snippet.g.dart │ │ │ ├── content_details.dart │ │ │ ├── subscriber_snippet.dart │ │ │ ├── snippet.g.dart │ │ │ ├── subscription_list_response.dart │ │ │ ├── subscription_list_response.g.dart │ │ │ ├── subscription.g.dart │ │ │ └── subscription.dart │ │ ├── commentThreads │ │ │ ├── replies.g.dart │ │ │ ├── comment_thread.dart │ │ │ ├── comment_thread.g.dart │ │ │ ├── snippet.g.dart │ │ │ ├── replies.dart │ │ │ ├── comment_thread_list_response.g.dart │ │ │ └── comment_thread_list_response.dart │ │ ├── channels │ │ │ ├── branding_settings.g.dart │ │ │ ├── related_playlists.g.dart │ │ │ ├── content_details.g.dart │ │ │ ├── branding_settings.dart │ │ │ ├── content_details.dart │ │ │ ├── statistics.g.dart │ │ │ ├── related_playlists.dart │ │ │ ├── channel_response.dart │ │ │ ├── channel.g.dart │ │ │ ├── channel_response.g.dart │ │ │ ├── statistics.dart │ │ │ ├── snippet.g.dart │ │ │ ├── channel_item.g.dart │ │ │ └── channel_item.dart │ │ ├── watermark │ │ │ ├── position.g.dart │ │ │ ├── timing.g.dart │ │ │ ├── position.dart │ │ │ ├── watermarks_resource.g.dart │ │ │ └── timing.dart │ │ ├── util │ │ │ ├── jwt_credentials.dart │ │ │ ├── oauth_credentials.g.dart │ │ │ ├── jwt_credentials.g.dart │ │ │ ├── token.dart │ │ │ ├── token.g.dart │ │ │ ├── json_settings.g.dart │ │ │ ├── json_settings.dart │ │ │ └── oauth_credentials.dart │ │ ├── page_info.g.dart │ │ ├── thumbnail.g.dart │ │ ├── page_info.dart │ │ ├── stream │ │ │ ├── status.g.dart │ │ │ ├── cdn.dart │ │ │ ├── snippet.g.dart │ │ │ ├── cdn.g.dart │ │ │ ├── configuration_issue.g.dart │ │ │ ├── ingestion_info.dart │ │ │ ├── health_status.g.dart │ │ │ ├── live_stream_list_response.dart │ │ │ ├── ingestion_info.g.dart │ │ │ ├── live_stream_item.g.dart │ │ │ ├── live_stream_list_response.g.dart │ │ │ ├── snippet.dart │ │ │ ├── health_status.dart │ │ │ ├── live_stream_item.dart │ │ │ └── status.dart │ │ ├── localized.dart │ │ ├── thumbnails │ │ │ ├── thumbnails_set_response.dart │ │ │ └── thumbnails_set_response.g.dart │ │ ├── list_response.dart │ │ ├── thumbnail.dart │ │ ├── thumbnails.g.dart │ │ └── thumbnails.dart │ ├── cmd │ │ ├── youtube_version_command.dart │ │ └── youtube_helper_command.dart │ ├── provider │ │ ├── oauth.dart │ │ └── data │ │ │ ├── video_categories.dart │ │ │ ├── channels.dart │ │ │ └── comment_threads.dart │ ├── chatbot.g.dart │ ├── youtube_api_helper.dart │ ├── video_categories.dart │ ├── chatbot.dart │ └── watermarks.dart ├── oauth.dart └── meta.dart ├── analysis_options.yaml ├── pubspec.yaml ├── .gitignore ├── LICENSE ├── bin └── yt.dart └── .github └── workflows └── dart.yml /tool/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## {{ pubspec.version }} 2 | 3 | {{ changes }} 4 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lints/recommended.yaml 2 | 3 | analyzer: 4 | exclude: 5 | -------------------------------------------------------------------------------- /example/credentials.yaml: -------------------------------------------------------------------------------- 1 | { 2 | "identifier": "[oauth2 identifier from Google]", 3 | "secret": "[oauth2 secret from Google]", 4 | } 5 | -------------------------------------------------------------------------------- /lib/src/oauth/refresh_token_generator.dart: -------------------------------------------------------------------------------- 1 | import 'package:yt/yt.dart'; 2 | 3 | abstract class RefreshTokenGenerator { 4 | Future generate(); 5 | } 6 | -------------------------------------------------------------------------------- /lib/oauth.dart: -------------------------------------------------------------------------------- 1 | /// oauth related classes for io versus browser usage 2 | library; 3 | 4 | export 'src/oauth/oauth_access_control_interface.dart'; 5 | export 'src/oauth/refresh_token_generator.dart'; 6 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lints/recommended.yaml 2 | 3 | analyzer: 4 | exclude: 5 | # workaround for https://github.com/dart-lang/sdk/issues/42910 6 | - "example/flutter_playlist/**" 7 | - "lib/**.g.dart" 8 | -------------------------------------------------------------------------------- /lib/src/oauth/oauth_access_control.dart: -------------------------------------------------------------------------------- 1 | import 'package:googleapis_auth/googleapis_auth.dart'; 2 | 3 | import 'oauth_access_control_interface.dart'; 4 | 5 | OAuthAccessControl getOAuthAccessControl(ClientId? clientId) => 6 | throw UnimplementedError('getOAuthAccessControl'); 7 | -------------------------------------------------------------------------------- /lib/src/util/authorization_exception.dart: -------------------------------------------------------------------------------- 1 | class AuthorizationException implements Exception { 2 | final String msg; 3 | final Exception? err; 4 | 5 | const AuthorizationException([this.msg = '', this.err]); 6 | 7 | @override 8 | String toString() => 'Authorization error: $msg\n\n$err'; 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/util/extras.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | extension UsageExtension on DioException { 4 | String get usage { 5 | return response?.data == '' || response?.data['error']['errors'] == null 6 | ? message ?? '' 7 | : response!.data['error']['errors'].toString(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: examples 2 | version: 0.0.1 3 | description: Example 4 | repository: https://github.com/faithoflifedev/yt 5 | homepage: https://github.com/faithoflifedev/yt 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ">=3.1.0 <4.0.0" 10 | 11 | dependencies: 12 | googleapis: ^14.0.0 13 | googleapis_auth: ^2.0.0 14 | lints: ^6.0.0 15 | yaml: ^3.1.3 16 | yt: 17 | path: ../../yt 18 | -------------------------------------------------------------------------------- /lib/src/model/response_metadata.dart: -------------------------------------------------------------------------------- 1 | /// Returns a collection of results that match the parameters specified in the API request. 2 | abstract class ResponseMetadata { 3 | /// Identifies the API resource's type. The value will be youtube#searchListResponse. 4 | final String kind; 5 | 6 | /// The Etag of this resource. 7 | final String etag; 8 | 9 | ResponseMetadata({required this.kind, required this.etag}); 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/util/emoji_formatter.dart: -------------------------------------------------------------------------------- 1 | class EmojiFormatter { 2 | static final Map emojiMap = { 3 | ':robot:': '🤖', 4 | ':mosque:': '🕌', 5 | ':video_camera:': '📹', 6 | ':growing_heart:': '💗', 7 | }; 8 | 9 | static final regExp = RegExp('(:[a-zA-Z_]+:)'); 10 | 11 | static String format(String data) => 12 | data.replaceAllMapped(regExp, (match) => '${emojiMap[match[1]]}'); 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/util/enum.dart: -------------------------------------------------------------------------------- 1 | /// Identifies the new moderation status of the specified comments. 2 | enum ModerationStatus { 3 | /// Marks a comment as awaiting review by a moderator. 4 | heldForReview, 5 | 6 | /// Clears a comment for public display. 7 | published, 8 | 9 | /// Rejects a comment as being unfit for display. This action also effectively 10 | /// hides all replies to the rejected comment. 11 | rejected, 12 | } 13 | -------------------------------------------------------------------------------- /lib/src/cmd/youtube_version_command.dart: -------------------------------------------------------------------------------- 1 | import 'package:args/command_runner.dart'; 2 | import 'package:yt/meta.dart'; 3 | 4 | class YoutubeVersionCommand extends Command { 5 | @override 6 | String get description => 'Display the package name and version'; 7 | 8 | @override 9 | String get name => 'version'; 10 | 11 | @override 12 | void run() async { 13 | print('${pubSpec['name']} v${pubSpec['version']}'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/model/playlist/status.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'status.g.dart'; 6 | 7 | @JsonSerializable() 8 | class Status { 9 | final String privacyStatus; 10 | 11 | Status({required this.privacyStatus}); 12 | 13 | factory Status.fromJson(Map json) => _$StatusFromJson(json); 14 | 15 | Map toJson() => _$StatusToJson(this); 16 | 17 | @override 18 | String toString() => jsonEncode(toJson()); 19 | } 20 | -------------------------------------------------------------------------------- /lib/meta.dart: -------------------------------------------------------------------------------- 1 | /// app metadata 2 | library; 3 | 4 | // DO NOT EDIT THIS FILE 5 | // THIS FILE IS AUTOMATICALLY OVER WRITTEN BY PublishTools 6 | import 'dart:convert' show json; 7 | 8 | final pubSpec = json.decode( 9 | '{"description":"Native Dart interface to multiple YouTube REST APIs including the Data and Live Streaming API.","homepage":"https://github.com/faithoflifedev/yt","documentation":"null","repository":"https://github.com/faithoflifedev/yt","issueTracker":"null","name":"yt","publish_to":"null","version":"2.2.6"}', 10 | ); 11 | -------------------------------------------------------------------------------- /lib/src/provider/oauth.dart: -------------------------------------------------------------------------------- 1 | import 'package:retrofit/retrofit.dart'; 2 | import 'package:dio/dio.dart' hide Headers; 3 | import 'package:yt/yt.dart'; 4 | 5 | part 'oauth.g.dart'; 6 | 7 | @RestApi(baseUrl: 'https://accounts.google.com/o/oauth2') 8 | abstract class OAuthClient { 9 | factory OAuthClient(Dio dio, {String baseUrl}) = _OAuthClient; 10 | 11 | @POST('/token') 12 | @Headers({ 13 | "Content-Type": "application/x-www-form-urlencoded", 14 | }) 15 | Future getToken(@Body() Map params); 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/model/videos/rating.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'rating.g.dart'; 6 | 7 | @JsonSerializable() 8 | class Rating { 9 | final String videoId; 10 | final String rating; 11 | 12 | Rating({required this.videoId, required this.rating}); 13 | 14 | factory Rating.fromJson(Map json) => _$RatingFromJson(json); 15 | 16 | Map toJson() => _$RatingToJson(this); 17 | 18 | @override 19 | String toString() => jsonEncode(toJson()); 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/model/playlist/player.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'player.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Player _$PlayerFromJson(Map json) => 10 | Player(embedHtml: json['embedHtml'] as String); 11 | 12 | Map _$PlayerToJson(Player instance) => { 13 | 'embedHtml': instance.embedHtml, 14 | }; 15 | -------------------------------------------------------------------------------- /lib/src/model/playlist/status.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'status.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Status _$StatusFromJson(Map json) => 10 | Status(privacyStatus: json['privacyStatus'] as String); 11 | 12 | Map _$StatusToJson(Status instance) => { 13 | 'privacyStatus': instance.privacyStatus, 14 | }; 15 | -------------------------------------------------------------------------------- /lib/src/model/playlistItem/status.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'status.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Status _$StatusFromJson(Map json) => 10 | Status(privacyStatus: json['privacyStatus'] as String); 11 | 12 | Map _$StatusToJson(Status instance) => { 13 | 'privacyStatus': instance.privacyStatus, 14 | }; 15 | -------------------------------------------------------------------------------- /lib/src/model/videos/player.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'player.g.dart'; 6 | 7 | @JsonSerializable() 8 | class Player { 9 | final String? embedHtml; 10 | final int? embedHeight; 11 | final int? embedWidth; 12 | 13 | Player({this.embedHtml, this.embedHeight, this.embedWidth}); 14 | 15 | factory Player.fromJson(Map json) => _$PlayerFromJson(json); 16 | 17 | Map toJson() => _$PlayerToJson(this); 18 | 19 | @override 20 | String toString() => jsonEncode(toJson()); 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/model/chat/keyword.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'keyword.g.dart'; 6 | 7 | @JsonSerializable(explicitToJson: true) 8 | class Keyword { 9 | final List> patterns; 10 | final int score; 11 | 12 | Keyword({required this.patterns, required this.score}); 13 | 14 | factory Keyword.fromJson(Map json) => 15 | _$KeywordFromJson(json); 16 | 17 | Map toJson() => _$KeywordToJson(this); 18 | 19 | @override 20 | String toString() => jsonEncode(toJson()); 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/model/comments/author_channel_id.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'author_channel_id.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AuthorChannelId _$AuthorChannelIdFromJson(Map json) => 10 | AuthorChannelId(value: json['value'] as String); 11 | 12 | Map _$AuthorChannelIdToJson(AuthorChannelId instance) => 13 | {'value': instance.value}; 14 | -------------------------------------------------------------------------------- /lib/src/model/broadcast/statistics.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'statistics.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Statistics _$StatisticsFromJson(Map json) => 10 | Statistics(totalChatCount: (json['totalChatCount'] as num?)?.toInt()); 11 | 12 | Map _$StatisticsToJson(Statistics instance) => 13 | {'totalChatCount': instance.totalChatCount}; 14 | -------------------------------------------------------------------------------- /lib/src/model/search/id.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'id.g.dart'; 6 | 7 | @JsonSerializable() 8 | class Id { 9 | final String kind; 10 | final String? videoId; 11 | final String? channelId; 12 | final String? playlistId; 13 | 14 | Id({required this.kind, this.videoId, this.channelId, this.playlistId}); 15 | 16 | factory Id.fromJson(Map json) => _$IdFromJson(json); 17 | 18 | Map toJson() => _$IdToJson(this); 19 | 20 | @override 21 | String toString() => jsonEncode(toJson()); 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/model/playlist/content_details.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'content_details.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ContentDetails _$ContentDetailsFromJson(Map json) => 10 | ContentDetails(itemCount: (json['itemCount'] as num).toInt()); 11 | 12 | Map _$ContentDetailsToJson(ContentDetails instance) => 13 | {'itemCount': instance.itemCount}; 14 | -------------------------------------------------------------------------------- /lib/src/model/videos/rating.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'rating.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Rating _$RatingFromJson(Map json) => Rating( 10 | videoId: json['videoId'] as String, 11 | rating: json['rating'] as String, 12 | ); 13 | 14 | Map _$RatingToJson(Rating instance) => { 15 | 'videoId': instance.videoId, 16 | 'rating': instance.rating, 17 | }; 18 | -------------------------------------------------------------------------------- /lib/src/model/chat/text_message_details.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'text_message_details.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | TextMessageDetails _$TextMessageDetailsFromJson(Map json) => 10 | TextMessageDetails(messageText: json['messageText'] as String); 11 | 12 | Map _$TextMessageDetailsToJson(TextMessageDetails instance) => 13 | {'messageText': instance.messageText}; 14 | -------------------------------------------------------------------------------- /lib/src/model/playlistItem/resource_id.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'resource_id.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ResourceId _$ResourceIdFromJson(Map json) => ResourceId( 10 | kind: json['kind'] as String, 11 | videoId: json['videoId'] as String, 12 | ); 13 | 14 | Map _$ResourceIdToJson(ResourceId instance) => 15 | {'kind': instance.kind, 'videoId': instance.videoId}; 16 | -------------------------------------------------------------------------------- /lib/src/model/localized.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'localized.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Localized _$LocalizedFromJson(Map json) => Localized( 10 | title: json['title'] as String, 11 | description: json['description'] as String, 12 | ); 13 | 14 | Map _$LocalizedToJson(Localized instance) => { 15 | 'title': instance.title, 16 | 'description': instance.description, 17 | }; 18 | -------------------------------------------------------------------------------- /lib/src/model/subscriptions/resource_id.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'resource_id.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ResourceId _$ResourceIdFromJson(Map json) => ResourceId( 10 | kind: json['kind'] as String, 11 | channelId: json['channelId'] as String, 12 | ); 13 | 14 | Map _$ResourceIdToJson(ResourceId instance) => 15 | {'kind': instance.kind, 'channelId': instance.channelId}; 16 | -------------------------------------------------------------------------------- /lib/src/model/commentThreads/replies.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'replies.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Replies _$RepliesFromJson(Map json) => Replies( 10 | value: (json['value'] as List) 11 | .map((e) => Comment.fromJson(e as Map)) 12 | .toList(), 13 | ); 14 | 15 | Map _$RepliesToJson(Replies instance) => { 16 | 'value': instance.value, 17 | }; 18 | -------------------------------------------------------------------------------- /lib/src/model/channels/branding_settings.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'branding_settings.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | BrandingSettings _$BrandingSettingsFromJson(Map json) => 10 | BrandingSettings( 11 | channel: Channel.fromJson(json['channel'] as Map), 12 | ); 13 | 14 | Map _$BrandingSettingsToJson(BrandingSettings instance) => 15 | {'channel': instance.channel.toJson()}; 16 | -------------------------------------------------------------------------------- /lib/src/model/watermark/position.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'position.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Position _$PositionFromJson(Map json) => Position( 10 | type: json['type'] as String? ?? 'corner', 11 | cornerPosition: json['cornerPosition'] as String, 12 | ); 13 | 14 | Map _$PositionToJson(Position instance) => { 15 | 'type': instance.type, 16 | 'cornerPosition': instance.cornerPosition, 17 | }; 18 | -------------------------------------------------------------------------------- /lib/src/model/util/jwt_credentials.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | import 'json_settings.dart'; 6 | 7 | part 'jwt_credentials.g.dart'; 8 | 9 | @JsonSerializable(explicitToJson: true) 10 | class JwtCredentials { 11 | final JsonSettings settings; 12 | final String scope; 13 | 14 | JwtCredentials({required this.settings, required this.scope}); 15 | 16 | factory JwtCredentials.fromJson(Map json) => 17 | _$JwtCredentialsFromJson(json); 18 | 19 | Map toJson() => _$JwtCredentialsToJson(this); 20 | 21 | @override 22 | String toString() => jsonEncode(toJson()); 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/model/playlist/player.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'player.g.dart'; 6 | 7 | ///The [Player] object contains information that you would use to play the playlist in an embedded player. 8 | @JsonSerializable() 9 | class Player { 10 | ///An