diff --git a/.gitignore b/.gitignore
index 31a29842..038c2257 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,58 +20,14 @@
# is commented out by default.
#.vscode/
-# Flutter/Dart/Pub related
-**/doc/api/
+# Files and directories created by pub
.dart_tool/
-.flutter-plugins
-.flutter-plugins-dependencies
.packages
-.pub-cache/
-.pub/
-build/
-
-# Android related
-**/android/**/gradle-wrapper.jar
-**/android/.gradle
-**/android/captures/
-**/android/gradlew
-**/android/gradlew.bat
-**/android/local.properties
-**/android/**/GeneratedPluginRegistrant.java
-# iOS/XCode related
-**/ios/**/*.mode1v3
-**/ios/**/*.mode2v3
-**/ios/**/*.moved-aside
-**/ios/**/*.pbxuser
-**/ios/**/*.perspectivev3
-**/ios/**/*sync/
-**/ios/**/.sconsign.dblite
-**/ios/**/.tags*
-**/ios/**/.vagrant/
-**/ios/**/DerivedData/
-**/ios/**/Icon?
-**/ios/**/Pods/
-**/ios/**/.symlinks/
-**/ios/**/profile
-**/ios/**/xcuserdata
-**/ios/.generated/
-**/ios/Flutter/App.framework
-**/ios/Flutter/Flutter.framework
-**/ios/Flutter/Flutter.podspec
-**/ios/Flutter/Generated.xcconfig
-**/ios/Flutter/app.flx
-**/ios/Flutter/app.zip
-**/ios/Flutter/flutter_assets/
-**/ios/Flutter/flutter_export_environment.sh
-**/ios/ServiceDefinitions.json
-**/ios/Runner/GeneratedPluginRegistrant.*
+# Conventional directory for build outputs
+build/
-# Exceptions to above rules.
-!**/ios/**/default.mode1v3
-!**/ios/**/default.mode2v3
-!**/ios/**/default.pbxuser
-!**/ios/**/default.perspectivev3
+# Directory created by dartdoc
+doc/api/
pubspec.lock
-.fvm
diff --git a/.metadata b/.metadata
deleted file mode 100644
index bfc12cb1..00000000
--- a/.metadata
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
- channel: stable
-
-project_type: package
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ac071598..cb73e091 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,40 @@
-## [0.0.1] - TODO: Add release date.
+# Changelog
-* TODO: Describe initial release.
+
+## [Unreleased]
+### Added
+- Add `User` model.
+
+
+## [1.0.1-dev] - 2020-12-27
+### Added
+- Add `Features` export to `lib/tdproto_dart.dart`.
+- Add example folder.
+
+### Fixed
+- Make `deprecated_member_use_from_same_package` analysis rule excluded.
+
+
+## [1.0.0-dev.1] - 2020-12-25
+### Added
+- Initial Version of the library.
+
+
+---
+
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
+to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index ba75c69f..ecb858d5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1 +1,21 @@
-TODO: Add your license here.
+MIT License
+
+Copyright (c) 2020 tada.team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 0e395b4e..abc19a21 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,12 @@
+
+
+
# tdproto_dart
Autogenerated Tada API data types for dart.
- Autogenerated by [tdproto](https://github.com/tada-team/tdproto) from go code.
-- Powered by [freezed](https://pub.dev/packages/freezed), includes all its features.
+- Powered by [freezed](https://pub.dev/packages/freezed), includes all it's features.
- Synced with server data types structure and documentation.
- Has a big brother for TypeScript - [tdproto-ts](https://github.com/tada-team/tdproto-ts).
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 00000000..a26afb97
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,7 @@
+include: package:pedantic/analysis_options.1.9.0.yaml
+
+analyzer:
+ errors:
+ # Required to use the deprecation annotation on fields in this package and
+ # in the same time avoid issues with generated code by json_serializable.
+ deprecated_member_use_from_same_package: ignore
diff --git a/build.yaml b/build.yaml
index fe1f152b..7da97311 100644
--- a/build.yaml
+++ b/build.yaml
@@ -5,15 +5,11 @@ targets:
options:
# Options configure how source code is generated for every
# `@JsonSerializable`-annotated class in the package.
- any_map: false
- checked: false
- create_factory: true
- create_to_json: true
- disallow_unrecognized_keys: false
+
# If true, generated toJson methods will explicitly call toJson on nested objects.
explicit_to_json: true
- field_rename: none
- generic_argument_factories: false
- ignore_unannotated: false
- include_if_null: true
- nullable: true
+
+ # When true on classes with type parameters (generic types),
+ # extra "helper" parameters will be generated for fromJson and/or toJson
+ # to support serializing values of those types.
+ generic_argument_factories: true
diff --git a/example/main.dart b/example/main.dart
new file mode 100644
index 00000000..9a907fa5
--- /dev/null
+++ b/example/main.dart
@@ -0,0 +1,142 @@
+import 'package:test/test.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+const _messageJson = {
+ 'content': {
+ 'text': 'Hello',
+ 'type': 'plain',
+ 'subtype': 'none',
+ },
+ 'push_text': 'Hello',
+ 'from': 'd-42d35f81-daad-4a5b-8429-a4b47c6b43ae',
+ 'to': 't-8b8be02d-ca65-40eb-afb0-c3d230332534',
+ 'message_id': '19353ae1-ee16-404f-bc0a-95be4c18a153',
+ 'created': '2020-12-27T09:21:14.796246Z',
+ 'gentime': 1609060874796244743,
+ 'chat_type': 'task',
+ 'chat': 't-8b8be02d-ca65-40eb-afb0-c3d230332534',
+ 'links': [],
+ 'prev': '8a290ace-d8b7-4180-b052-9d8b31ab685c',
+ 'silently': true,
+ 'editable_until': '3000-01-01T00:00:00.000000Z',
+ 'num': 8
+};
+
+const _pdfVersionJson = {
+ 'url': 'SOME_URL',
+ 'text_preview': 'sample',
+};
+
+const _jsonResponse = {
+ '_time': '918ms',
+ 'ok': true,
+ 'result': _pdfVersionJson,
+};
+
+void main() {
+ group('tdproto features:', () {
+ final message = Message.fromJson(_messageJson);
+
+ test('enums', () {
+ // in IDE you get the documentation about any field
+ message.created;
+ // in IDE you get the deprecation warnings about deprecated fields due to @Deprecated annotation
+ message.content.mediaUrl;
+
+ expect(message.content.subtype, MediaSubtype.none);
+ });
+
+ test('generic response serialization', () {
+ // arrange
+ final handwrittenResponse = Response(
+ time: _jsonResponse['_time'],
+ ok: _jsonResponse['ok'],
+ result: PdfVersion(
+ url: (_jsonResponse['result'] as Map)['url'],
+ textPreview: (_jsonResponse['result'] as Map)['text_preview'],
+ ),
+ );
+ // act
+ final serializedResponse = Response.fromJson(_jsonResponse, (json) => PdfVersion.fromJson(json));
+ // assert
+ // Can't compare responses just with equality operator because
+ // response is implemented through json_serializable and doesn't have overridden equality operator.
+ expect(serializedResponse.time, equals(serializedResponse.time));
+ expect(serializedResponse.ok, equals(serializedResponse.ok));
+ expect(serializedResponse.error, equals(serializedResponse.error));
+ expect(serializedResponse.details, equals(serializedResponse.details));
+ expect(serializedResponse.result, equals(handwrittenResponse.result));
+ });
+ });
+
+ group('freezed features:', () {
+ test('fromJson, toJson', () {
+ // arrange
+ final pdfVersion = PdfVersion(
+ url: _pdfVersionJson['url'],
+ textPreview: _pdfVersionJson['text_preview'],
+ );
+ // act
+ final pdfVersionFromJson = PdfVersion.fromJson(_pdfVersionJson);
+ final pdfVersionToJson = pdfVersion.toJson();
+ // assert
+ expect(pdfVersionFromJson, equals(pdfVersion));
+ expect(pdfVersionToJson, equals(_pdfVersionJson));
+ });
+
+ test('equality operator (==)', () {
+ expect(
+ PdfVersion(url: 'url1'),
+ equals(PdfVersion(url: 'url1')),
+ );
+ expect(
+ PdfVersion(url: 'url2'),
+ isNot(equals(PdfVersion(url: 'url3'))),
+ );
+ });
+
+ test('hashCode method', () {
+ expect(
+ PdfVersion(url: 'url1').hashCode,
+ equals(PdfVersion(url: 'url1').hashCode),
+ );
+ expect(
+ PdfVersion(url: 'url2').hashCode,
+ isNot(equals(PdfVersion(url: 'url3').hashCode)),
+ );
+ });
+
+ test('nice toString', () {
+ // arrange
+ final pdfVersion = PdfVersion(
+ url: 'sample.pdf',
+ textPreview: 'Sample preview',
+ );
+ // act
+ final string = pdfVersion.toString();
+ // assert
+ expect(string, equals('PdfVersion(url: sample.pdf, textPreview: Sample preview)'));
+ });
+
+ test('copyWith method', () {
+ // arrange
+ final pdfVersion = PdfVersion.fromJson(_pdfVersionJson);
+ // act
+ final copiedPdfVersion = pdfVersion.copyWith(textPreview: 'example');
+ // assert
+ expect(copiedPdfVersion, PdfVersion(url: 'SOME_URL', textPreview: 'example'));
+ });
+
+ test('non-nullability', () {
+ expect(
+ () => PdfVersion(url: 'SOME_URL'),
+ isNot(throwsA(isA())),
+ );
+
+ expect(
+ () => PdfVersion(url: null),
+ throwsA(isA()),
+ );
+ });
+ });
+}
diff --git a/lib/src/date_time_converter.dart b/lib/src/converters/date_time_converter.dart
similarity index 84%
rename from lib/src/date_time_converter.dart
rename to lib/src/converters/date_time_converter.dart
index 1697de84..a2c86d8e 100644
--- a/lib/src/date_time_converter.dart
+++ b/lib/src/converters/date_time_converter.dart
@@ -10,5 +10,5 @@ class DateTimeConverter implements JsonConverter {
DateTime fromJson(String dateTimeString) => dateTimeString == null ? null : DateTime.parse(dateTimeString);
@override
- String toJson(DateTime dateTime) => dateTime.toIso8601String();
+ String toJson(DateTime dateTime) => dateTime?.toIso8601String();
}
diff --git a/lib/src/chat_type/chat_type.dart b/lib/src/enums/chat_type.dart
similarity index 80%
rename from lib/src/chat_type/chat_type.dart
rename to lib/src/enums/chat_type.dart
index 42f2a950..62d23c4a 100644
--- a/lib/src/chat_type/chat_type.dart
+++ b/lib/src/enums/chat_type.dart
@@ -2,15 +2,15 @@ import 'package:freezed_annotation/freezed_annotation.dart';
/// Chat type
enum ChatType {
- // Direct chat
+ /// Direct chat
@JsonValue('direct')
direct,
- // Group chat
+ /// Group chat
@JsonValue('group')
group,
- // Task
+ /// Task
@JsonValue('task')
task,
}
diff --git a/lib/src/group_status/group_status.dart b/lib/src/enums/group_status.dart
similarity index 79%
rename from lib/src/group_status/group_status.dart
rename to lib/src/enums/group_status.dart
index d808a44a..bb3e04ff 100644
--- a/lib/src/group_status/group_status.dart
+++ b/lib/src/enums/group_status.dart
@@ -2,11 +2,11 @@ import 'package:freezed_annotation/freezed_annotation.dart';
/// Status in team
enum GroupStatus {
- // Group administrator
+ /// Group administrator
@JsonValue('admin')
groupAdmin,
- // Group member
+ /// Group member
@JsonValue('member')
groupMember,
}
diff --git a/lib/src/markup_type/markup_type.dart b/lib/src/enums/markup_type.dart
similarity index 71%
rename from lib/src/markup_type/markup_type.dart
rename to lib/src/enums/markup_type.dart
index 1dced4c7..fab27883 100644
--- a/lib/src/markup_type/markup_type.dart
+++ b/lib/src/enums/markup_type.dart
@@ -2,43 +2,43 @@ import 'package:freezed_annotation/freezed_annotation.dart';
/// Markup type
enum MarkupType {
- // Bold text
+ /// Bold text
@JsonValue('bold')
bold,
- // Italic text
+ /// Italic text
@JsonValue('italic')
italic,
- // Underscore text
+ /// Underscore text
@JsonValue('underscore')
underscore,
- // Striked text
+ /// Striked text
@JsonValue('strike')
strike,
- // Inlined code
+ /// Inlined code
@JsonValue('code')
code,
- // Code block
+ /// Code block
@JsonValue('codeblock')
codeBlock,
- // Quote
+ /// Quote
@JsonValue('quote')
quote,
- // Link
+ /// Link
@JsonValue('link')
link,
- // Datetime
+ /// Datetime
@JsonValue('time')
time,
- // Unsafe html element
+ /// Unsafe html element
@JsonValue('unsafe')
unsafe,
}
diff --git a/lib/src/enums/media_subtype.dart b/lib/src/enums/media_subtype.dart
new file mode 100644
index 00000000..6593a675
--- /dev/null
+++ b/lib/src/enums/media_subtype.dart
@@ -0,0 +1,13 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+/// Media subtype. Handwritten implementation.
+enum MediaSubtype {
+ @JsonValue('sticker')
+ sticker,
+
+ @JsonValue('newtask')
+ newtask,
+
+ @JsonValue('none')
+ none,
+}
diff --git a/lib/src/enums/media_type.dart b/lib/src/enums/media_type.dart
new file mode 100644
index 00000000..cd8e9dc4
--- /dev/null
+++ b/lib/src/enums/media_type.dart
@@ -0,0 +1,31 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+/// Media type. Handwritten implementation.
+enum MediaType {
+ @JsonValue('plain')
+ plain,
+
+ @JsonValue('change')
+ change,
+
+ @JsonValue('deleted')
+ deleted,
+
+ @JsonValue('file')
+ file,
+
+ @JsonValue('image')
+ image,
+
+ @JsonValue('video')
+ video,
+
+ @JsonValue('audiomsg')
+ audiomsg,
+
+ @JsonValue('contact')
+ contact,
+
+ @JsonValue('pdf')
+ pdf,
+}
diff --git a/lib/src/team_status/team_status.dart b/lib/src/enums/team_status.dart
similarity index 68%
rename from lib/src/team_status/team_status.dart
rename to lib/src/enums/team_status.dart
index 90989cd2..a11fa6e4 100644
--- a/lib/src/team_status/team_status.dart
+++ b/lib/src/enums/team_status.dart
@@ -2,19 +2,19 @@ import 'package:freezed_annotation/freezed_annotation.dart';
/// Team status
enum TeamStatus {
- // Team owner. Can do anything
+ /// Team owner. Can do anything
@JsonValue('owner')
teamOwner,
- // Team administrator
+ /// Team administrator
@JsonValue('admin')
teamAdmin,
- // Team member
+ /// Team member
@JsonValue('member')
teamMember,
- // Team guest. Restricted account
+ /// Team guest. Restricted account
@JsonValue('guest')
teamGuest,
}
diff --git a/lib/src/interfaces/i_response.dart b/lib/src/interfaces/i_response.dart
new file mode 100644
index 00000000..1e5ad833
--- /dev/null
+++ b/lib/src/interfaces/i_response.dart
@@ -0,0 +1,11 @@
+abstract class IResponse {
+ String get time;
+
+ bool get ok;
+
+ T get result;
+
+ String get error;
+
+ Map get details;
+}
diff --git a/lib/src/interfaces/i_websocket_event.dart b/lib/src/interfaces/i_websocket_event.dart
new file mode 100644
index 00000000..0586e17d
--- /dev/null
+++ b/lib/src/interfaces/i_websocket_event.dart
@@ -0,0 +1,7 @@
+abstract class IWebsocketEvent {
+ String get event;
+
+ T get params;
+
+ String get confirmId;
+}
diff --git a/lib/src/country/country.dart b/lib/src/models/country/country.dart
similarity index 92%
rename from lib/src/country/country.dart
rename to lib/src/models/country/country.dart
index 74b86f62..7f09f657 100644
--- a/lib/src/country/country.dart
+++ b/lib/src/models/country/country.dart
@@ -1,5 +1,4 @@
import 'package:freezed_annotation/freezed_annotation.dart';
-import 'package:tdproto_dart/tdproto_dart.dart';
part 'country.freezed.dart';
part 'country.g.dart';
diff --git a/lib/src/country/country.freezed.dart b/lib/src/models/country/country.freezed.dart
similarity index 100%
rename from lib/src/country/country.freezed.dart
rename to lib/src/models/country/country.freezed.dart
diff --git a/lib/src/country/country.g.dart b/lib/src/models/country/country.g.dart
similarity index 100%
rename from lib/src/country/country.g.dart
rename to lib/src/models/country/country.g.dart
diff --git a/lib/src/models/features/features.dart b/lib/src/models/features/features.dart
new file mode 100644
index 00000000..7e6c1e44
--- /dev/null
+++ b/lib/src/models/features/features.dart
@@ -0,0 +1,205 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'features.freezed.dart';
+part 'features.g.dart';
+
+/// Server information.
+@freezed
+abstract class Features with _$Features {
+ const factory Features({
+ /// Current host.
+ @JsonKey(name: 'host') @required String host,
+
+ /// Build/revision of server side.
+ @JsonKey(name: 'build') @required String build,
+
+ /// Desktop application version.
+ @JsonKey(name: 'desktop_version') @required String desktopVersion,
+
+ /// Webclient version.
+ @JsonKey(name: 'front_version') @required String frontVersion,
+
+ /// Application title.
+ @JsonKey(name: 'app_title') @required String appTitle,
+
+ /// Local applications urls.
+ @JsonKey(name: 'app_schemes') @required List appSchemes,
+
+ /// Static files server address.
+ @JsonKey(name: 'userver') @required String userver,
+
+ /// Link to AppStore.
+ @JsonKey(name: 'ios_app') @required String iOSApp,
+
+ /// Link to Google Play.
+ @JsonKey(name: 'android_app') @required String androidApp,
+
+ /// Default UI theme.
+ @JsonKey(name: 'theme') @required String theme,
+
+ /// Minimal application version required for this server. Used for breaking changes.
+ @JsonKey(name: 'min_app_version') @required String minAppVersion,
+
+ /// Free registration allowed.
+ @JsonKey(name: 'free_registration') @required bool freeRegistration,
+
+ /// Maximum size of user's upload.
+ @JsonKey(name: 'max_upload_mb') @required int maxUploadMb,
+
+ /// Maximum number of forwarded messages.
+ @JsonKey(name: 'max_linked_messages') @required int maxLinkedMessages,
+
+ /// Maximum number of message uploads.
+ @JsonKey(name: 'max_message_uploads') @required int maxMessageUploads,
+
+ /// Maximum chars for: family_name, given_name, patronymic if any.
+ @JsonKey(name: 'max_username_part_length') @required int maxUsernamePartLength,
+
+ /// Maximum chars for group chat name.
+ @JsonKey(name: 'max_group_title_length') @required int maxGroupTitleLength,
+
+ /// Maximum chars for role in team.
+ @JsonKey(name: 'max_role_length') @required int maxRoleLength,
+
+ /// Maximum chars for mood in team.
+ @JsonKey(name: 'max_mood_length') @required int maxMoodLength,
+
+ /// Maximum chars for text message.
+ @JsonKey(name: 'max_message_length') @required int maxMessageLength,
+
+ /// Maximum length for project and contact's sections names.
+ @JsonKey(name: 'max_section_length') @required int maxSectionLength,
+
+ /// Maximum length for tags.
+ @JsonKey(name: 'max_tag_length') @required int maxTagLength,
+
+ /// Maximum length for task title.
+ @JsonKey(name: 'max_task_title_length') @required int maxTaskTitleLength,
+
+ /// Maximum length for ColorRule description.
+ @JsonKey(name: 'max_color_rule_description_length') @required int maxColorRuleDescriptionLength,
+
+ /// Maximum length for urls.
+ @JsonKey(name: 'max_url_length') @required int maxUrlLength,
+
+ /// Maximum length for Integration comment.
+ @JsonKey(name: 'max_integration_comment_length') @required int maxIntegrationCommentLength,
+
+ /// Maximum teams for one account.
+ @JsonKey(name: 'max_teams') @required int maxTeams,
+
+ /// Max inactivity seconds.
+ @JsonKey(name: 'afk_age') @required int afkAge,
+
+ /// Password authentication enabled.
+ @JsonKey(name: 'auth_by_password') bool authByPassword,
+
+ /// QR-code / link authentication enabled.
+ @JsonKey(name: 'auth_by_qr_code') bool authByQrCode,
+
+ /// SMS authentication enabled.
+ @JsonKey(name: 'auth_by_sms') bool authBySms,
+
+ /// ICE servers for WebRTC.
+ @JsonKey(name: 'ice_servers') @required List iceServers,
+
+ /// True for on-premise installation.
+ @JsonKey(name: 'custom_server') @required bool customServer,
+
+ /// Name of installation.
+ @JsonKey(name: 'installation_type') @required String installationType,
+
+ /// Testing installation.
+ @JsonKey(name: 'is_testing') @required bool isTesting,
+
+ /// Yandex metrika counter id.
+ @JsonKey(name: 'metrika') @required String metrika,
+
+ /// Minimal chars number for starting global search.
+ @JsonKey(name: 'min_search_length') @required int minSearchLength,
+
+ /// Resend message in n seconds if no confirmation from server given.
+ @JsonKey(name: 'resend_timeout') @required int resendTimeout,
+
+ /// Frontend sentry.io settings.
+ @JsonKey(name: 'sentry_dsn_js') @required String sentryDsnJS,
+
+ /// Message drafts saved on server.
+ @JsonKey(name: 'server_drafts') @required bool serverDrafts,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_app_id') @required String firebaseAppId,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_sender_id') @required String firebaseSenderId,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_api_key') @required String firebaseApiKey,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_auth_domain') @required String firebaseAuthDomain,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_database_url') @required String firebaseDatabaseUrl,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_project_id') @required String firebaseProjectId,
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_storage_bucket') @required String firebaseStorageBucket,
+
+ /// Calls functions enabled.
+ @JsonKey(name: 'calls') @required bool calls,
+
+ /// Calls functions enabled for mobile applications.
+ @JsonKey(name: 'mobile_calls') @required bool mobileCalls,
+
+ /// Calls record enabled.
+ @JsonKey(name: 'calls_record') @required bool callsRecord,
+
+ /// Disallow call from multiply devices. Experimental.
+ @JsonKey(name: 'only_one_device_per_call') bool onlyOneDevicePerCall,
+
+ /// Maximum number of participants per call.
+ @JsonKey(name: 'max_participants_per_call') int maxParticipantsPerCall,
+
+ /// Safari push id for web-push notifications.
+ @JsonKey(name: 'safari_push_id') @required String safariPushId,
+
+ /// Multiple message uploads.
+ @JsonKey(name: 'message_uploads') @required bool messageUploads,
+
+ /// Team entity naming. Experimental.
+ @JsonKey(name: 'terms') @required Terms terms,
+
+ /// Cross team communication. Experimental.
+ @JsonKey(name: 'single_group_teams') @required bool singleGroupTeams,
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'wiki_pages') @required bool wikiPages,
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'allow_admin_mute') bool allowAdminMute,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'task_checklist') @required bool taskChecklist,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'readonly_groups') @required bool readonlyGroups,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'task_dashboard') @required bool taskDashboard,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'task_messages') @required bool taskMessages,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'task_public') @required bool taskPublic,
+
+ /// Deprecated.
+ @deprecated @JsonKey(name: 'task_tags') @required bool taskTags,
+ }) = _Features;
+
+ factory Features.fromJson(Map json) => _$FeaturesFromJson(json);
+}
diff --git a/lib/src/models/features/features.freezed.dart b/lib/src/models/features/features.freezed.dart
new file mode 100644
index 00000000..b8f418f5
--- /dev/null
+++ b/lib/src/models/features/features.freezed.dart
@@ -0,0 +1,1940 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'features.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+Features _$FeaturesFromJson(Map json) {
+ return _Features.fromJson(json);
+}
+
+/// @nodoc
+class _$FeaturesTearOff {
+ const _$FeaturesTearOff();
+
+// ignore: unused_element
+ _Features call(
+ {@required @JsonKey(name: 'host') String host,
+ @required @JsonKey(name: 'build') String build,
+ @required @JsonKey(name: 'desktop_version') String desktopVersion,
+ @required @JsonKey(name: 'front_version') String frontVersion,
+ @required @JsonKey(name: 'app_title') String appTitle,
+ @required @JsonKey(name: 'app_schemes') List appSchemes,
+ @required @JsonKey(name: 'userver') String userver,
+ @required @JsonKey(name: 'ios_app') String iOSApp,
+ @required @JsonKey(name: 'android_app') String androidApp,
+ @required @JsonKey(name: 'theme') String theme,
+ @required @JsonKey(name: 'min_app_version') String minAppVersion,
+ @required @JsonKey(name: 'free_registration') bool freeRegistration,
+ @required @JsonKey(name: 'max_upload_mb') int maxUploadMb,
+ @required @JsonKey(name: 'max_linked_messages') int maxLinkedMessages,
+ @required @JsonKey(name: 'max_message_uploads') int maxMessageUploads,
+ @required @JsonKey(name: 'max_username_part_length') int maxUsernamePartLength,
+ @required @JsonKey(name: 'max_group_title_length') int maxGroupTitleLength,
+ @required @JsonKey(name: 'max_role_length') int maxRoleLength,
+ @required @JsonKey(name: 'max_mood_length') int maxMoodLength,
+ @required @JsonKey(name: 'max_message_length') int maxMessageLength,
+ @required @JsonKey(name: 'max_section_length') int maxSectionLength,
+ @required @JsonKey(name: 'max_tag_length') int maxTagLength,
+ @required @JsonKey(name: 'max_task_title_length') int maxTaskTitleLength,
+ @required @JsonKey(name: 'max_color_rule_description_length') int maxColorRuleDescriptionLength,
+ @required @JsonKey(name: 'max_url_length') int maxUrlLength,
+ @required @JsonKey(name: 'max_integration_comment_length') int maxIntegrationCommentLength,
+ @required @JsonKey(name: 'max_teams') int maxTeams,
+ @required @JsonKey(name: 'afk_age') int afkAge,
+ @JsonKey(name: 'auth_by_password') bool authByPassword,
+ @JsonKey(name: 'auth_by_qr_code') bool authByQrCode,
+ @JsonKey(name: 'auth_by_sms') bool authBySms,
+ @required @JsonKey(name: 'ice_servers') List iceServers,
+ @required @JsonKey(name: 'custom_server') bool customServer,
+ @required @JsonKey(name: 'installation_type') String installationType,
+ @required @JsonKey(name: 'is_testing') bool isTesting,
+ @required @JsonKey(name: 'metrika') String metrika,
+ @required @JsonKey(name: 'min_search_length') int minSearchLength,
+ @required @JsonKey(name: 'resend_timeout') int resendTimeout,
+ @required @JsonKey(name: 'sentry_dsn_js') String sentryDsnJS,
+ @required @JsonKey(name: 'server_drafts') bool serverDrafts,
+ @required @JsonKey(name: 'firebase_app_id') String firebaseAppId,
+ @required @JsonKey(name: 'firebase_sender_id') String firebaseSenderId,
+ @required @JsonKey(name: 'firebase_api_key') String firebaseApiKey,
+ @required @JsonKey(name: 'firebase_auth_domain') String firebaseAuthDomain,
+ @required @JsonKey(name: 'firebase_database_url') String firebaseDatabaseUrl,
+ @required @JsonKey(name: 'firebase_project_id') String firebaseProjectId,
+ @required @JsonKey(name: 'firebase_storage_bucket') String firebaseStorageBucket,
+ @required @JsonKey(name: 'calls') bool calls,
+ @required @JsonKey(name: 'mobile_calls') bool mobileCalls,
+ @required @JsonKey(name: 'calls_record') bool callsRecord,
+ @JsonKey(name: 'only_one_device_per_call') bool onlyOneDevicePerCall,
+ @JsonKey(name: 'max_participants_per_call') int maxParticipantsPerCall,
+ @required @JsonKey(name: 'safari_push_id') String safariPushId,
+ @required @JsonKey(name: 'message_uploads') bool messageUploads,
+ @required @JsonKey(name: 'terms') Terms terms,
+ @required @JsonKey(name: 'single_group_teams') bool singleGroupTeams,
+ @required @JsonKey(name: 'wiki_pages') bool wikiPages,
+ @JsonKey(name: 'allow_admin_mute') bool allowAdminMute,
+ @required @deprecated @JsonKey(name: 'task_checklist') bool taskChecklist,
+ @required @deprecated @JsonKey(name: 'readonly_groups') bool readonlyGroups,
+ @required @deprecated @JsonKey(name: 'task_dashboard') bool taskDashboard,
+ @required @deprecated @JsonKey(name: 'task_messages') bool taskMessages,
+ @required @deprecated @JsonKey(name: 'task_public') bool taskPublic,
+ @required @deprecated @JsonKey(name: 'task_tags') bool taskTags}) {
+ return _Features(
+ host: host,
+ build: build,
+ desktopVersion: desktopVersion,
+ frontVersion: frontVersion,
+ appTitle: appTitle,
+ appSchemes: appSchemes,
+ userver: userver,
+ iOSApp: iOSApp,
+ androidApp: androidApp,
+ theme: theme,
+ minAppVersion: minAppVersion,
+ freeRegistration: freeRegistration,
+ maxUploadMb: maxUploadMb,
+ maxLinkedMessages: maxLinkedMessages,
+ maxMessageUploads: maxMessageUploads,
+ maxUsernamePartLength: maxUsernamePartLength,
+ maxGroupTitleLength: maxGroupTitleLength,
+ maxRoleLength: maxRoleLength,
+ maxMoodLength: maxMoodLength,
+ maxMessageLength: maxMessageLength,
+ maxSectionLength: maxSectionLength,
+ maxTagLength: maxTagLength,
+ maxTaskTitleLength: maxTaskTitleLength,
+ maxColorRuleDescriptionLength: maxColorRuleDescriptionLength,
+ maxUrlLength: maxUrlLength,
+ maxIntegrationCommentLength: maxIntegrationCommentLength,
+ maxTeams: maxTeams,
+ afkAge: afkAge,
+ authByPassword: authByPassword,
+ authByQrCode: authByQrCode,
+ authBySms: authBySms,
+ iceServers: iceServers,
+ customServer: customServer,
+ installationType: installationType,
+ isTesting: isTesting,
+ metrika: metrika,
+ minSearchLength: minSearchLength,
+ resendTimeout: resendTimeout,
+ sentryDsnJS: sentryDsnJS,
+ serverDrafts: serverDrafts,
+ firebaseAppId: firebaseAppId,
+ firebaseSenderId: firebaseSenderId,
+ firebaseApiKey: firebaseApiKey,
+ firebaseAuthDomain: firebaseAuthDomain,
+ firebaseDatabaseUrl: firebaseDatabaseUrl,
+ firebaseProjectId: firebaseProjectId,
+ firebaseStorageBucket: firebaseStorageBucket,
+ calls: calls,
+ mobileCalls: mobileCalls,
+ callsRecord: callsRecord,
+ onlyOneDevicePerCall: onlyOneDevicePerCall,
+ maxParticipantsPerCall: maxParticipantsPerCall,
+ safariPushId: safariPushId,
+ messageUploads: messageUploads,
+ terms: terms,
+ singleGroupTeams: singleGroupTeams,
+ wikiPages: wikiPages,
+ allowAdminMute: allowAdminMute,
+ taskChecklist: taskChecklist,
+ readonlyGroups: readonlyGroups,
+ taskDashboard: taskDashboard,
+ taskMessages: taskMessages,
+ taskPublic: taskPublic,
+ taskTags: taskTags,
+ );
+ }
+
+// ignore: unused_element
+ Features fromJson(Map json) {
+ return Features.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $Features = _$FeaturesTearOff();
+
+/// @nodoc
+mixin _$Features {
+ /// Current host.
+ @JsonKey(name: 'host')
+ String get host;
+
+ /// Build/revision of server side.
+ @JsonKey(name: 'build')
+ String get build;
+
+ /// Desktop application version.
+ @JsonKey(name: 'desktop_version')
+ String get desktopVersion;
+
+ /// Webclient version.
+ @JsonKey(name: 'front_version')
+ String get frontVersion;
+
+ /// Application title.
+ @JsonKey(name: 'app_title')
+ String get appTitle;
+
+ /// Local applications urls.
+ @JsonKey(name: 'app_schemes')
+ List get appSchemes;
+
+ /// Static files server address.
+ @JsonKey(name: 'userver')
+ String get userver;
+
+ /// Link to AppStore.
+ @JsonKey(name: 'ios_app')
+ String get iOSApp;
+
+ /// Link to Google Play.
+ @JsonKey(name: 'android_app')
+ String get androidApp;
+
+ /// Default UI theme.
+ @JsonKey(name: 'theme')
+ String get theme;
+
+ /// Minimal application version required for this server. Used for breaking changes.
+ @JsonKey(name: 'min_app_version')
+ String get minAppVersion;
+
+ /// Free registration allowed.
+ @JsonKey(name: 'free_registration')
+ bool get freeRegistration;
+
+ /// Maximum size of user's upload.
+ @JsonKey(name: 'max_upload_mb')
+ int get maxUploadMb;
+
+ /// Maximum number of forwarded messages.
+ @JsonKey(name: 'max_linked_messages')
+ int get maxLinkedMessages;
+
+ /// Maximum number of message uploads.
+ @JsonKey(name: 'max_message_uploads')
+ int get maxMessageUploads;
+
+ /// Maximum chars for: family_name, given_name, patronymic if any.
+ @JsonKey(name: 'max_username_part_length')
+ int get maxUsernamePartLength;
+
+ /// Maximum chars for group chat name.
+ @JsonKey(name: 'max_group_title_length')
+ int get maxGroupTitleLength;
+
+ /// Maximum chars for role in team.
+ @JsonKey(name: 'max_role_length')
+ int get maxRoleLength;
+
+ /// Maximum chars for mood in team.
+ @JsonKey(name: 'max_mood_length')
+ int get maxMoodLength;
+
+ /// Maximum chars for text message.
+ @JsonKey(name: 'max_message_length')
+ int get maxMessageLength;
+
+ /// Maximum length for project and contact's sections names.
+ @JsonKey(name: 'max_section_length')
+ int get maxSectionLength;
+
+ /// Maximum length for tags.
+ @JsonKey(name: 'max_tag_length')
+ int get maxTagLength;
+
+ /// Maximum length for task title.
+ @JsonKey(name: 'max_task_title_length')
+ int get maxTaskTitleLength;
+
+ /// Maximum length for ColorRule description.
+ @JsonKey(name: 'max_color_rule_description_length')
+ int get maxColorRuleDescriptionLength;
+
+ /// Maximum length for urls.
+ @JsonKey(name: 'max_url_length')
+ int get maxUrlLength;
+
+ /// Maximum length for Integration comment.
+ @JsonKey(name: 'max_integration_comment_length')
+ int get maxIntegrationCommentLength;
+
+ /// Maximum teams for one account.
+ @JsonKey(name: 'max_teams')
+ int get maxTeams;
+
+ /// Max inactivity seconds.
+ @JsonKey(name: 'afk_age')
+ int get afkAge;
+
+ /// Password authentication enabled.
+ @JsonKey(name: 'auth_by_password')
+ bool get authByPassword;
+
+ /// QR-code / link authentication enabled.
+ @JsonKey(name: 'auth_by_qr_code')
+ bool get authByQrCode;
+
+ /// SMS authentication enabled.
+ @JsonKey(name: 'auth_by_sms')
+ bool get authBySms;
+
+ /// ICE servers for WebRTC.
+ @JsonKey(name: 'ice_servers')
+ List get iceServers;
+
+ /// True for on-premise installation.
+ @JsonKey(name: 'custom_server')
+ bool get customServer;
+
+ /// Name of installation.
+ @JsonKey(name: 'installation_type')
+ String get installationType;
+
+ /// Testing installation.
+ @JsonKey(name: 'is_testing')
+ bool get isTesting;
+
+ /// Yandex metrika counter id.
+ @JsonKey(name: 'metrika')
+ String get metrika;
+
+ /// Minimal chars number for starting global search.
+ @JsonKey(name: 'min_search_length')
+ int get minSearchLength;
+
+ /// Resend message in n seconds if no confirmation from server given.
+ @JsonKey(name: 'resend_timeout')
+ int get resendTimeout;
+
+ /// Frontend sentry.io settings.
+ @JsonKey(name: 'sentry_dsn_js')
+ String get sentryDsnJS;
+
+ /// Message drafts saved on server.
+ @JsonKey(name: 'server_drafts')
+ bool get serverDrafts;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_app_id')
+ String get firebaseAppId;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_sender_id')
+ String get firebaseSenderId;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_api_key')
+ String get firebaseApiKey;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_auth_domain')
+ String get firebaseAuthDomain;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_database_url')
+ String get firebaseDatabaseUrl;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_project_id')
+ String get firebaseProjectId;
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_storage_bucket')
+ String get firebaseStorageBucket;
+
+ /// Calls functions enabled.
+ @JsonKey(name: 'calls')
+ bool get calls;
+
+ /// Calls functions enabled for mobile applications.
+ @JsonKey(name: 'mobile_calls')
+ bool get mobileCalls;
+
+ /// Calls record enabled.
+ @JsonKey(name: 'calls_record')
+ bool get callsRecord;
+
+ /// Disallow call from multiply devices. Experimental.
+ @JsonKey(name: 'only_one_device_per_call')
+ bool get onlyOneDevicePerCall;
+
+ /// Maximum number of participants per call.
+ @JsonKey(name: 'max_participants_per_call')
+ int get maxParticipantsPerCall;
+
+ /// Safari push id for web-push notifications.
+ @JsonKey(name: 'safari_push_id')
+ String get safariPushId;
+
+ /// Multiple message uploads.
+ @JsonKey(name: 'message_uploads')
+ bool get messageUploads;
+
+ /// Team entity naming. Experimental.
+ @JsonKey(name: 'terms')
+ Terms get terms;
+
+ /// Cross team communication. Experimental.
+ @JsonKey(name: 'single_group_teams')
+ bool get singleGroupTeams;
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'wiki_pages')
+ bool get wikiPages;
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'allow_admin_mute')
+ bool get allowAdminMute;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_checklist')
+ bool get taskChecklist;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'readonly_groups')
+ bool get readonlyGroups;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_dashboard')
+ bool get taskDashboard;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_messages')
+ bool get taskMessages;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_public')
+ bool get taskPublic;
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_tags')
+ bool get taskTags;
+
+ Map toJson();
+ $FeaturesCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $FeaturesCopyWith<$Res> {
+ factory $FeaturesCopyWith(Features value, $Res Function(Features) then) = _$FeaturesCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'host') String host,
+ @JsonKey(name: 'build') String build,
+ @JsonKey(name: 'desktop_version') String desktopVersion,
+ @JsonKey(name: 'front_version') String frontVersion,
+ @JsonKey(name: 'app_title') String appTitle,
+ @JsonKey(name: 'app_schemes') List appSchemes,
+ @JsonKey(name: 'userver') String userver,
+ @JsonKey(name: 'ios_app') String iOSApp,
+ @JsonKey(name: 'android_app') String androidApp,
+ @JsonKey(name: 'theme') String theme,
+ @JsonKey(name: 'min_app_version') String minAppVersion,
+ @JsonKey(name: 'free_registration') bool freeRegistration,
+ @JsonKey(name: 'max_upload_mb') int maxUploadMb,
+ @JsonKey(name: 'max_linked_messages') int maxLinkedMessages,
+ @JsonKey(name: 'max_message_uploads') int maxMessageUploads,
+ @JsonKey(name: 'max_username_part_length') int maxUsernamePartLength,
+ @JsonKey(name: 'max_group_title_length') int maxGroupTitleLength,
+ @JsonKey(name: 'max_role_length') int maxRoleLength,
+ @JsonKey(name: 'max_mood_length') int maxMoodLength,
+ @JsonKey(name: 'max_message_length') int maxMessageLength,
+ @JsonKey(name: 'max_section_length') int maxSectionLength,
+ @JsonKey(name: 'max_tag_length') int maxTagLength,
+ @JsonKey(name: 'max_task_title_length') int maxTaskTitleLength,
+ @JsonKey(name: 'max_color_rule_description_length') int maxColorRuleDescriptionLength,
+ @JsonKey(name: 'max_url_length') int maxUrlLength,
+ @JsonKey(name: 'max_integration_comment_length') int maxIntegrationCommentLength,
+ @JsonKey(name: 'max_teams') int maxTeams,
+ @JsonKey(name: 'afk_age') int afkAge,
+ @JsonKey(name: 'auth_by_password') bool authByPassword,
+ @JsonKey(name: 'auth_by_qr_code') bool authByQrCode,
+ @JsonKey(name: 'auth_by_sms') bool authBySms,
+ @JsonKey(name: 'ice_servers') List iceServers,
+ @JsonKey(name: 'custom_server') bool customServer,
+ @JsonKey(name: 'installation_type') String installationType,
+ @JsonKey(name: 'is_testing') bool isTesting,
+ @JsonKey(name: 'metrika') String metrika,
+ @JsonKey(name: 'min_search_length') int minSearchLength,
+ @JsonKey(name: 'resend_timeout') int resendTimeout,
+ @JsonKey(name: 'sentry_dsn_js') String sentryDsnJS,
+ @JsonKey(name: 'server_drafts') bool serverDrafts,
+ @JsonKey(name: 'firebase_app_id') String firebaseAppId,
+ @JsonKey(name: 'firebase_sender_id') String firebaseSenderId,
+ @JsonKey(name: 'firebase_api_key') String firebaseApiKey,
+ @JsonKey(name: 'firebase_auth_domain') String firebaseAuthDomain,
+ @JsonKey(name: 'firebase_database_url') String firebaseDatabaseUrl,
+ @JsonKey(name: 'firebase_project_id') String firebaseProjectId,
+ @JsonKey(name: 'firebase_storage_bucket') String firebaseStorageBucket,
+ @JsonKey(name: 'calls') bool calls,
+ @JsonKey(name: 'mobile_calls') bool mobileCalls,
+ @JsonKey(name: 'calls_record') bool callsRecord,
+ @JsonKey(name: 'only_one_device_per_call') bool onlyOneDevicePerCall,
+ @JsonKey(name: 'max_participants_per_call') int maxParticipantsPerCall,
+ @JsonKey(name: 'safari_push_id') String safariPushId,
+ @JsonKey(name: 'message_uploads') bool messageUploads,
+ @JsonKey(name: 'terms') Terms terms,
+ @JsonKey(name: 'single_group_teams') bool singleGroupTeams,
+ @JsonKey(name: 'wiki_pages') bool wikiPages,
+ @JsonKey(name: 'allow_admin_mute') bool allowAdminMute,
+ @deprecated @JsonKey(name: 'task_checklist') bool taskChecklist,
+ @deprecated @JsonKey(name: 'readonly_groups') bool readonlyGroups,
+ @deprecated @JsonKey(name: 'task_dashboard') bool taskDashboard,
+ @deprecated @JsonKey(name: 'task_messages') bool taskMessages,
+ @deprecated @JsonKey(name: 'task_public') bool taskPublic,
+ @deprecated @JsonKey(name: 'task_tags') bool taskTags});
+
+ $TermsCopyWith<$Res> get terms;
+}
+
+/// @nodoc
+class _$FeaturesCopyWithImpl<$Res> implements $FeaturesCopyWith<$Res> {
+ _$FeaturesCopyWithImpl(this._value, this._then);
+
+ final Features _value;
+ // ignore: unused_field
+ final $Res Function(Features) _then;
+
+ @override
+ $Res call({
+ Object host = freezed,
+ Object build = freezed,
+ Object desktopVersion = freezed,
+ Object frontVersion = freezed,
+ Object appTitle = freezed,
+ Object appSchemes = freezed,
+ Object userver = freezed,
+ Object iOSApp = freezed,
+ Object androidApp = freezed,
+ Object theme = freezed,
+ Object minAppVersion = freezed,
+ Object freeRegistration = freezed,
+ Object maxUploadMb = freezed,
+ Object maxLinkedMessages = freezed,
+ Object maxMessageUploads = freezed,
+ Object maxUsernamePartLength = freezed,
+ Object maxGroupTitleLength = freezed,
+ Object maxRoleLength = freezed,
+ Object maxMoodLength = freezed,
+ Object maxMessageLength = freezed,
+ Object maxSectionLength = freezed,
+ Object maxTagLength = freezed,
+ Object maxTaskTitleLength = freezed,
+ Object maxColorRuleDescriptionLength = freezed,
+ Object maxUrlLength = freezed,
+ Object maxIntegrationCommentLength = freezed,
+ Object maxTeams = freezed,
+ Object afkAge = freezed,
+ Object authByPassword = freezed,
+ Object authByQrCode = freezed,
+ Object authBySms = freezed,
+ Object iceServers = freezed,
+ Object customServer = freezed,
+ Object installationType = freezed,
+ Object isTesting = freezed,
+ Object metrika = freezed,
+ Object minSearchLength = freezed,
+ Object resendTimeout = freezed,
+ Object sentryDsnJS = freezed,
+ Object serverDrafts = freezed,
+ Object firebaseAppId = freezed,
+ Object firebaseSenderId = freezed,
+ Object firebaseApiKey = freezed,
+ Object firebaseAuthDomain = freezed,
+ Object firebaseDatabaseUrl = freezed,
+ Object firebaseProjectId = freezed,
+ Object firebaseStorageBucket = freezed,
+ Object calls = freezed,
+ Object mobileCalls = freezed,
+ Object callsRecord = freezed,
+ Object onlyOneDevicePerCall = freezed,
+ Object maxParticipantsPerCall = freezed,
+ Object safariPushId = freezed,
+ Object messageUploads = freezed,
+ Object terms = freezed,
+ Object singleGroupTeams = freezed,
+ Object wikiPages = freezed,
+ Object allowAdminMute = freezed,
+ Object taskChecklist = freezed,
+ Object readonlyGroups = freezed,
+ Object taskDashboard = freezed,
+ Object taskMessages = freezed,
+ Object taskPublic = freezed,
+ Object taskTags = freezed,
+ }) {
+ return _then(_value.copyWith(
+ host: host == freezed ? _value.host : host as String,
+ build: build == freezed ? _value.build : build as String,
+ desktopVersion: desktopVersion == freezed ? _value.desktopVersion : desktopVersion as String,
+ frontVersion: frontVersion == freezed ? _value.frontVersion : frontVersion as String,
+ appTitle: appTitle == freezed ? _value.appTitle : appTitle as String,
+ appSchemes: appSchemes == freezed ? _value.appSchemes : appSchemes as List,
+ userver: userver == freezed ? _value.userver : userver as String,
+ iOSApp: iOSApp == freezed ? _value.iOSApp : iOSApp as String,
+ androidApp: androidApp == freezed ? _value.androidApp : androidApp as String,
+ theme: theme == freezed ? _value.theme : theme as String,
+ minAppVersion: minAppVersion == freezed ? _value.minAppVersion : minAppVersion as String,
+ freeRegistration: freeRegistration == freezed ? _value.freeRegistration : freeRegistration as bool,
+ maxUploadMb: maxUploadMb == freezed ? _value.maxUploadMb : maxUploadMb as int,
+ maxLinkedMessages: maxLinkedMessages == freezed ? _value.maxLinkedMessages : maxLinkedMessages as int,
+ maxMessageUploads: maxMessageUploads == freezed ? _value.maxMessageUploads : maxMessageUploads as int,
+ maxUsernamePartLength:
+ maxUsernamePartLength == freezed ? _value.maxUsernamePartLength : maxUsernamePartLength as int,
+ maxGroupTitleLength: maxGroupTitleLength == freezed ? _value.maxGroupTitleLength : maxGroupTitleLength as int,
+ maxRoleLength: maxRoleLength == freezed ? _value.maxRoleLength : maxRoleLength as int,
+ maxMoodLength: maxMoodLength == freezed ? _value.maxMoodLength : maxMoodLength as int,
+ maxMessageLength: maxMessageLength == freezed ? _value.maxMessageLength : maxMessageLength as int,
+ maxSectionLength: maxSectionLength == freezed ? _value.maxSectionLength : maxSectionLength as int,
+ maxTagLength: maxTagLength == freezed ? _value.maxTagLength : maxTagLength as int,
+ maxTaskTitleLength: maxTaskTitleLength == freezed ? _value.maxTaskTitleLength : maxTaskTitleLength as int,
+ maxColorRuleDescriptionLength: maxColorRuleDescriptionLength == freezed
+ ? _value.maxColorRuleDescriptionLength
+ : maxColorRuleDescriptionLength as int,
+ maxUrlLength: maxUrlLength == freezed ? _value.maxUrlLength : maxUrlLength as int,
+ maxIntegrationCommentLength: maxIntegrationCommentLength == freezed
+ ? _value.maxIntegrationCommentLength
+ : maxIntegrationCommentLength as int,
+ maxTeams: maxTeams == freezed ? _value.maxTeams : maxTeams as int,
+ afkAge: afkAge == freezed ? _value.afkAge : afkAge as int,
+ authByPassword: authByPassword == freezed ? _value.authByPassword : authByPassword as bool,
+ authByQrCode: authByQrCode == freezed ? _value.authByQrCode : authByQrCode as bool,
+ authBySms: authBySms == freezed ? _value.authBySms : authBySms as bool,
+ iceServers: iceServers == freezed ? _value.iceServers : iceServers as List,
+ customServer: customServer == freezed ? _value.customServer : customServer as bool,
+ installationType: installationType == freezed ? _value.installationType : installationType as String,
+ isTesting: isTesting == freezed ? _value.isTesting : isTesting as bool,
+ metrika: metrika == freezed ? _value.metrika : metrika as String,
+ minSearchLength: minSearchLength == freezed ? _value.minSearchLength : minSearchLength as int,
+ resendTimeout: resendTimeout == freezed ? _value.resendTimeout : resendTimeout as int,
+ sentryDsnJS: sentryDsnJS == freezed ? _value.sentryDsnJS : sentryDsnJS as String,
+ serverDrafts: serverDrafts == freezed ? _value.serverDrafts : serverDrafts as bool,
+ firebaseAppId: firebaseAppId == freezed ? _value.firebaseAppId : firebaseAppId as String,
+ firebaseSenderId: firebaseSenderId == freezed ? _value.firebaseSenderId : firebaseSenderId as String,
+ firebaseApiKey: firebaseApiKey == freezed ? _value.firebaseApiKey : firebaseApiKey as String,
+ firebaseAuthDomain: firebaseAuthDomain == freezed ? _value.firebaseAuthDomain : firebaseAuthDomain as String,
+ firebaseDatabaseUrl: firebaseDatabaseUrl == freezed ? _value.firebaseDatabaseUrl : firebaseDatabaseUrl as String,
+ firebaseProjectId: firebaseProjectId == freezed ? _value.firebaseProjectId : firebaseProjectId as String,
+ firebaseStorageBucket:
+ firebaseStorageBucket == freezed ? _value.firebaseStorageBucket : firebaseStorageBucket as String,
+ calls: calls == freezed ? _value.calls : calls as bool,
+ mobileCalls: mobileCalls == freezed ? _value.mobileCalls : mobileCalls as bool,
+ callsRecord: callsRecord == freezed ? _value.callsRecord : callsRecord as bool,
+ onlyOneDevicePerCall:
+ onlyOneDevicePerCall == freezed ? _value.onlyOneDevicePerCall : onlyOneDevicePerCall as bool,
+ maxParticipantsPerCall:
+ maxParticipantsPerCall == freezed ? _value.maxParticipantsPerCall : maxParticipantsPerCall as int,
+ safariPushId: safariPushId == freezed ? _value.safariPushId : safariPushId as String,
+ messageUploads: messageUploads == freezed ? _value.messageUploads : messageUploads as bool,
+ terms: terms == freezed ? _value.terms : terms as Terms,
+ singleGroupTeams: singleGroupTeams == freezed ? _value.singleGroupTeams : singleGroupTeams as bool,
+ wikiPages: wikiPages == freezed ? _value.wikiPages : wikiPages as bool,
+ allowAdminMute: allowAdminMute == freezed ? _value.allowAdminMute : allowAdminMute as bool,
+ taskChecklist: taskChecklist == freezed ? _value.taskChecklist : taskChecklist as bool,
+ readonlyGroups: readonlyGroups == freezed ? _value.readonlyGroups : readonlyGroups as bool,
+ taskDashboard: taskDashboard == freezed ? _value.taskDashboard : taskDashboard as bool,
+ taskMessages: taskMessages == freezed ? _value.taskMessages : taskMessages as bool,
+ taskPublic: taskPublic == freezed ? _value.taskPublic : taskPublic as bool,
+ taskTags: taskTags == freezed ? _value.taskTags : taskTags as bool,
+ ));
+ }
+
+ @override
+ $TermsCopyWith<$Res> get terms {
+ if (_value.terms == null) {
+ return null;
+ }
+ return $TermsCopyWith<$Res>(_value.terms, (value) {
+ return _then(_value.copyWith(terms: value));
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$FeaturesCopyWith<$Res> implements $FeaturesCopyWith<$Res> {
+ factory _$FeaturesCopyWith(_Features value, $Res Function(_Features) then) = __$FeaturesCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'host') String host,
+ @JsonKey(name: 'build') String build,
+ @JsonKey(name: 'desktop_version') String desktopVersion,
+ @JsonKey(name: 'front_version') String frontVersion,
+ @JsonKey(name: 'app_title') String appTitle,
+ @JsonKey(name: 'app_schemes') List appSchemes,
+ @JsonKey(name: 'userver') String userver,
+ @JsonKey(name: 'ios_app') String iOSApp,
+ @JsonKey(name: 'android_app') String androidApp,
+ @JsonKey(name: 'theme') String theme,
+ @JsonKey(name: 'min_app_version') String minAppVersion,
+ @JsonKey(name: 'free_registration') bool freeRegistration,
+ @JsonKey(name: 'max_upload_mb') int maxUploadMb,
+ @JsonKey(name: 'max_linked_messages') int maxLinkedMessages,
+ @JsonKey(name: 'max_message_uploads') int maxMessageUploads,
+ @JsonKey(name: 'max_username_part_length') int maxUsernamePartLength,
+ @JsonKey(name: 'max_group_title_length') int maxGroupTitleLength,
+ @JsonKey(name: 'max_role_length') int maxRoleLength,
+ @JsonKey(name: 'max_mood_length') int maxMoodLength,
+ @JsonKey(name: 'max_message_length') int maxMessageLength,
+ @JsonKey(name: 'max_section_length') int maxSectionLength,
+ @JsonKey(name: 'max_tag_length') int maxTagLength,
+ @JsonKey(name: 'max_task_title_length') int maxTaskTitleLength,
+ @JsonKey(name: 'max_color_rule_description_length') int maxColorRuleDescriptionLength,
+ @JsonKey(name: 'max_url_length') int maxUrlLength,
+ @JsonKey(name: 'max_integration_comment_length') int maxIntegrationCommentLength,
+ @JsonKey(name: 'max_teams') int maxTeams,
+ @JsonKey(name: 'afk_age') int afkAge,
+ @JsonKey(name: 'auth_by_password') bool authByPassword,
+ @JsonKey(name: 'auth_by_qr_code') bool authByQrCode,
+ @JsonKey(name: 'auth_by_sms') bool authBySms,
+ @JsonKey(name: 'ice_servers') List iceServers,
+ @JsonKey(name: 'custom_server') bool customServer,
+ @JsonKey(name: 'installation_type') String installationType,
+ @JsonKey(name: 'is_testing') bool isTesting,
+ @JsonKey(name: 'metrika') String metrika,
+ @JsonKey(name: 'min_search_length') int minSearchLength,
+ @JsonKey(name: 'resend_timeout') int resendTimeout,
+ @JsonKey(name: 'sentry_dsn_js') String sentryDsnJS,
+ @JsonKey(name: 'server_drafts') bool serverDrafts,
+ @JsonKey(name: 'firebase_app_id') String firebaseAppId,
+ @JsonKey(name: 'firebase_sender_id') String firebaseSenderId,
+ @JsonKey(name: 'firebase_api_key') String firebaseApiKey,
+ @JsonKey(name: 'firebase_auth_domain') String firebaseAuthDomain,
+ @JsonKey(name: 'firebase_database_url') String firebaseDatabaseUrl,
+ @JsonKey(name: 'firebase_project_id') String firebaseProjectId,
+ @JsonKey(name: 'firebase_storage_bucket') String firebaseStorageBucket,
+ @JsonKey(name: 'calls') bool calls,
+ @JsonKey(name: 'mobile_calls') bool mobileCalls,
+ @JsonKey(name: 'calls_record') bool callsRecord,
+ @JsonKey(name: 'only_one_device_per_call') bool onlyOneDevicePerCall,
+ @JsonKey(name: 'max_participants_per_call') int maxParticipantsPerCall,
+ @JsonKey(name: 'safari_push_id') String safariPushId,
+ @JsonKey(name: 'message_uploads') bool messageUploads,
+ @JsonKey(name: 'terms') Terms terms,
+ @JsonKey(name: 'single_group_teams') bool singleGroupTeams,
+ @JsonKey(name: 'wiki_pages') bool wikiPages,
+ @JsonKey(name: 'allow_admin_mute') bool allowAdminMute,
+ @deprecated @JsonKey(name: 'task_checklist') bool taskChecklist,
+ @deprecated @JsonKey(name: 'readonly_groups') bool readonlyGroups,
+ @deprecated @JsonKey(name: 'task_dashboard') bool taskDashboard,
+ @deprecated @JsonKey(name: 'task_messages') bool taskMessages,
+ @deprecated @JsonKey(name: 'task_public') bool taskPublic,
+ @deprecated @JsonKey(name: 'task_tags') bool taskTags});
+
+ @override
+ $TermsCopyWith<$Res> get terms;
+}
+
+/// @nodoc
+class __$FeaturesCopyWithImpl<$Res> extends _$FeaturesCopyWithImpl<$Res> implements _$FeaturesCopyWith<$Res> {
+ __$FeaturesCopyWithImpl(_Features _value, $Res Function(_Features) _then)
+ : super(_value, (v) => _then(v as _Features));
+
+ @override
+ _Features get _value => super._value as _Features;
+
+ @override
+ $Res call({
+ Object host = freezed,
+ Object build = freezed,
+ Object desktopVersion = freezed,
+ Object frontVersion = freezed,
+ Object appTitle = freezed,
+ Object appSchemes = freezed,
+ Object userver = freezed,
+ Object iOSApp = freezed,
+ Object androidApp = freezed,
+ Object theme = freezed,
+ Object minAppVersion = freezed,
+ Object freeRegistration = freezed,
+ Object maxUploadMb = freezed,
+ Object maxLinkedMessages = freezed,
+ Object maxMessageUploads = freezed,
+ Object maxUsernamePartLength = freezed,
+ Object maxGroupTitleLength = freezed,
+ Object maxRoleLength = freezed,
+ Object maxMoodLength = freezed,
+ Object maxMessageLength = freezed,
+ Object maxSectionLength = freezed,
+ Object maxTagLength = freezed,
+ Object maxTaskTitleLength = freezed,
+ Object maxColorRuleDescriptionLength = freezed,
+ Object maxUrlLength = freezed,
+ Object maxIntegrationCommentLength = freezed,
+ Object maxTeams = freezed,
+ Object afkAge = freezed,
+ Object authByPassword = freezed,
+ Object authByQrCode = freezed,
+ Object authBySms = freezed,
+ Object iceServers = freezed,
+ Object customServer = freezed,
+ Object installationType = freezed,
+ Object isTesting = freezed,
+ Object metrika = freezed,
+ Object minSearchLength = freezed,
+ Object resendTimeout = freezed,
+ Object sentryDsnJS = freezed,
+ Object serverDrafts = freezed,
+ Object firebaseAppId = freezed,
+ Object firebaseSenderId = freezed,
+ Object firebaseApiKey = freezed,
+ Object firebaseAuthDomain = freezed,
+ Object firebaseDatabaseUrl = freezed,
+ Object firebaseProjectId = freezed,
+ Object firebaseStorageBucket = freezed,
+ Object calls = freezed,
+ Object mobileCalls = freezed,
+ Object callsRecord = freezed,
+ Object onlyOneDevicePerCall = freezed,
+ Object maxParticipantsPerCall = freezed,
+ Object safariPushId = freezed,
+ Object messageUploads = freezed,
+ Object terms = freezed,
+ Object singleGroupTeams = freezed,
+ Object wikiPages = freezed,
+ Object allowAdminMute = freezed,
+ Object taskChecklist = freezed,
+ Object readonlyGroups = freezed,
+ Object taskDashboard = freezed,
+ Object taskMessages = freezed,
+ Object taskPublic = freezed,
+ Object taskTags = freezed,
+ }) {
+ return _then(_Features(
+ host: host == freezed ? _value.host : host as String,
+ build: build == freezed ? _value.build : build as String,
+ desktopVersion: desktopVersion == freezed ? _value.desktopVersion : desktopVersion as String,
+ frontVersion: frontVersion == freezed ? _value.frontVersion : frontVersion as String,
+ appTitle: appTitle == freezed ? _value.appTitle : appTitle as String,
+ appSchemes: appSchemes == freezed ? _value.appSchemes : appSchemes as List,
+ userver: userver == freezed ? _value.userver : userver as String,
+ iOSApp: iOSApp == freezed ? _value.iOSApp : iOSApp as String,
+ androidApp: androidApp == freezed ? _value.androidApp : androidApp as String,
+ theme: theme == freezed ? _value.theme : theme as String,
+ minAppVersion: minAppVersion == freezed ? _value.minAppVersion : minAppVersion as String,
+ freeRegistration: freeRegistration == freezed ? _value.freeRegistration : freeRegistration as bool,
+ maxUploadMb: maxUploadMb == freezed ? _value.maxUploadMb : maxUploadMb as int,
+ maxLinkedMessages: maxLinkedMessages == freezed ? _value.maxLinkedMessages : maxLinkedMessages as int,
+ maxMessageUploads: maxMessageUploads == freezed ? _value.maxMessageUploads : maxMessageUploads as int,
+ maxUsernamePartLength:
+ maxUsernamePartLength == freezed ? _value.maxUsernamePartLength : maxUsernamePartLength as int,
+ maxGroupTitleLength: maxGroupTitleLength == freezed ? _value.maxGroupTitleLength : maxGroupTitleLength as int,
+ maxRoleLength: maxRoleLength == freezed ? _value.maxRoleLength : maxRoleLength as int,
+ maxMoodLength: maxMoodLength == freezed ? _value.maxMoodLength : maxMoodLength as int,
+ maxMessageLength: maxMessageLength == freezed ? _value.maxMessageLength : maxMessageLength as int,
+ maxSectionLength: maxSectionLength == freezed ? _value.maxSectionLength : maxSectionLength as int,
+ maxTagLength: maxTagLength == freezed ? _value.maxTagLength : maxTagLength as int,
+ maxTaskTitleLength: maxTaskTitleLength == freezed ? _value.maxTaskTitleLength : maxTaskTitleLength as int,
+ maxColorRuleDescriptionLength: maxColorRuleDescriptionLength == freezed
+ ? _value.maxColorRuleDescriptionLength
+ : maxColorRuleDescriptionLength as int,
+ maxUrlLength: maxUrlLength == freezed ? _value.maxUrlLength : maxUrlLength as int,
+ maxIntegrationCommentLength: maxIntegrationCommentLength == freezed
+ ? _value.maxIntegrationCommentLength
+ : maxIntegrationCommentLength as int,
+ maxTeams: maxTeams == freezed ? _value.maxTeams : maxTeams as int,
+ afkAge: afkAge == freezed ? _value.afkAge : afkAge as int,
+ authByPassword: authByPassword == freezed ? _value.authByPassword : authByPassword as bool,
+ authByQrCode: authByQrCode == freezed ? _value.authByQrCode : authByQrCode as bool,
+ authBySms: authBySms == freezed ? _value.authBySms : authBySms as bool,
+ iceServers: iceServers == freezed ? _value.iceServers : iceServers as List,
+ customServer: customServer == freezed ? _value.customServer : customServer as bool,
+ installationType: installationType == freezed ? _value.installationType : installationType as String,
+ isTesting: isTesting == freezed ? _value.isTesting : isTesting as bool,
+ metrika: metrika == freezed ? _value.metrika : metrika as String,
+ minSearchLength: minSearchLength == freezed ? _value.minSearchLength : minSearchLength as int,
+ resendTimeout: resendTimeout == freezed ? _value.resendTimeout : resendTimeout as int,
+ sentryDsnJS: sentryDsnJS == freezed ? _value.sentryDsnJS : sentryDsnJS as String,
+ serverDrafts: serverDrafts == freezed ? _value.serverDrafts : serverDrafts as bool,
+ firebaseAppId: firebaseAppId == freezed ? _value.firebaseAppId : firebaseAppId as String,
+ firebaseSenderId: firebaseSenderId == freezed ? _value.firebaseSenderId : firebaseSenderId as String,
+ firebaseApiKey: firebaseApiKey == freezed ? _value.firebaseApiKey : firebaseApiKey as String,
+ firebaseAuthDomain: firebaseAuthDomain == freezed ? _value.firebaseAuthDomain : firebaseAuthDomain as String,
+ firebaseDatabaseUrl: firebaseDatabaseUrl == freezed ? _value.firebaseDatabaseUrl : firebaseDatabaseUrl as String,
+ firebaseProjectId: firebaseProjectId == freezed ? _value.firebaseProjectId : firebaseProjectId as String,
+ firebaseStorageBucket:
+ firebaseStorageBucket == freezed ? _value.firebaseStorageBucket : firebaseStorageBucket as String,
+ calls: calls == freezed ? _value.calls : calls as bool,
+ mobileCalls: mobileCalls == freezed ? _value.mobileCalls : mobileCalls as bool,
+ callsRecord: callsRecord == freezed ? _value.callsRecord : callsRecord as bool,
+ onlyOneDevicePerCall:
+ onlyOneDevicePerCall == freezed ? _value.onlyOneDevicePerCall : onlyOneDevicePerCall as bool,
+ maxParticipantsPerCall:
+ maxParticipantsPerCall == freezed ? _value.maxParticipantsPerCall : maxParticipantsPerCall as int,
+ safariPushId: safariPushId == freezed ? _value.safariPushId : safariPushId as String,
+ messageUploads: messageUploads == freezed ? _value.messageUploads : messageUploads as bool,
+ terms: terms == freezed ? _value.terms : terms as Terms,
+ singleGroupTeams: singleGroupTeams == freezed ? _value.singleGroupTeams : singleGroupTeams as bool,
+ wikiPages: wikiPages == freezed ? _value.wikiPages : wikiPages as bool,
+ allowAdminMute: allowAdminMute == freezed ? _value.allowAdminMute : allowAdminMute as bool,
+ taskChecklist: taskChecklist == freezed ? _value.taskChecklist : taskChecklist as bool,
+ readonlyGroups: readonlyGroups == freezed ? _value.readonlyGroups : readonlyGroups as bool,
+ taskDashboard: taskDashboard == freezed ? _value.taskDashboard : taskDashboard as bool,
+ taskMessages: taskMessages == freezed ? _value.taskMessages : taskMessages as bool,
+ taskPublic: taskPublic == freezed ? _value.taskPublic : taskPublic as bool,
+ taskTags: taskTags == freezed ? _value.taskTags : taskTags as bool,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_Features implements _Features {
+ const _$_Features(
+ {@required @JsonKey(name: 'host') this.host,
+ @required @JsonKey(name: 'build') this.build,
+ @required @JsonKey(name: 'desktop_version') this.desktopVersion,
+ @required @JsonKey(name: 'front_version') this.frontVersion,
+ @required @JsonKey(name: 'app_title') this.appTitle,
+ @required @JsonKey(name: 'app_schemes') this.appSchemes,
+ @required @JsonKey(name: 'userver') this.userver,
+ @required @JsonKey(name: 'ios_app') this.iOSApp,
+ @required @JsonKey(name: 'android_app') this.androidApp,
+ @required @JsonKey(name: 'theme') this.theme,
+ @required @JsonKey(name: 'min_app_version') this.minAppVersion,
+ @required @JsonKey(name: 'free_registration') this.freeRegistration,
+ @required @JsonKey(name: 'max_upload_mb') this.maxUploadMb,
+ @required @JsonKey(name: 'max_linked_messages') this.maxLinkedMessages,
+ @required @JsonKey(name: 'max_message_uploads') this.maxMessageUploads,
+ @required @JsonKey(name: 'max_username_part_length') this.maxUsernamePartLength,
+ @required @JsonKey(name: 'max_group_title_length') this.maxGroupTitleLength,
+ @required @JsonKey(name: 'max_role_length') this.maxRoleLength,
+ @required @JsonKey(name: 'max_mood_length') this.maxMoodLength,
+ @required @JsonKey(name: 'max_message_length') this.maxMessageLength,
+ @required @JsonKey(name: 'max_section_length') this.maxSectionLength,
+ @required @JsonKey(name: 'max_tag_length') this.maxTagLength,
+ @required @JsonKey(name: 'max_task_title_length') this.maxTaskTitleLength,
+ @required @JsonKey(name: 'max_color_rule_description_length') this.maxColorRuleDescriptionLength,
+ @required @JsonKey(name: 'max_url_length') this.maxUrlLength,
+ @required @JsonKey(name: 'max_integration_comment_length') this.maxIntegrationCommentLength,
+ @required @JsonKey(name: 'max_teams') this.maxTeams,
+ @required @JsonKey(name: 'afk_age') this.afkAge,
+ @JsonKey(name: 'auth_by_password') this.authByPassword,
+ @JsonKey(name: 'auth_by_qr_code') this.authByQrCode,
+ @JsonKey(name: 'auth_by_sms') this.authBySms,
+ @required @JsonKey(name: 'ice_servers') this.iceServers,
+ @required @JsonKey(name: 'custom_server') this.customServer,
+ @required @JsonKey(name: 'installation_type') this.installationType,
+ @required @JsonKey(name: 'is_testing') this.isTesting,
+ @required @JsonKey(name: 'metrika') this.metrika,
+ @required @JsonKey(name: 'min_search_length') this.minSearchLength,
+ @required @JsonKey(name: 'resend_timeout') this.resendTimeout,
+ @required @JsonKey(name: 'sentry_dsn_js') this.sentryDsnJS,
+ @required @JsonKey(name: 'server_drafts') this.serverDrafts,
+ @required @JsonKey(name: 'firebase_app_id') this.firebaseAppId,
+ @required @JsonKey(name: 'firebase_sender_id') this.firebaseSenderId,
+ @required @JsonKey(name: 'firebase_api_key') this.firebaseApiKey,
+ @required @JsonKey(name: 'firebase_auth_domain') this.firebaseAuthDomain,
+ @required @JsonKey(name: 'firebase_database_url') this.firebaseDatabaseUrl,
+ @required @JsonKey(name: 'firebase_project_id') this.firebaseProjectId,
+ @required @JsonKey(name: 'firebase_storage_bucket') this.firebaseStorageBucket,
+ @required @JsonKey(name: 'calls') this.calls,
+ @required @JsonKey(name: 'mobile_calls') this.mobileCalls,
+ @required @JsonKey(name: 'calls_record') this.callsRecord,
+ @JsonKey(name: 'only_one_device_per_call') this.onlyOneDevicePerCall,
+ @JsonKey(name: 'max_participants_per_call') this.maxParticipantsPerCall,
+ @required @JsonKey(name: 'safari_push_id') this.safariPushId,
+ @required @JsonKey(name: 'message_uploads') this.messageUploads,
+ @required @JsonKey(name: 'terms') this.terms,
+ @required @JsonKey(name: 'single_group_teams') this.singleGroupTeams,
+ @required @JsonKey(name: 'wiki_pages') this.wikiPages,
+ @JsonKey(name: 'allow_admin_mute') this.allowAdminMute,
+ @required @deprecated @JsonKey(name: 'task_checklist') this.taskChecklist,
+ @required @deprecated @JsonKey(name: 'readonly_groups') this.readonlyGroups,
+ @required @deprecated @JsonKey(name: 'task_dashboard') this.taskDashboard,
+ @required @deprecated @JsonKey(name: 'task_messages') this.taskMessages,
+ @required @deprecated @JsonKey(name: 'task_public') this.taskPublic,
+ @required @deprecated @JsonKey(name: 'task_tags') this.taskTags})
+ : assert(host != null),
+ assert(build != null),
+ assert(desktopVersion != null),
+ assert(frontVersion != null),
+ assert(appTitle != null),
+ assert(appSchemes != null),
+ assert(userver != null),
+ assert(iOSApp != null),
+ assert(androidApp != null),
+ assert(theme != null),
+ assert(minAppVersion != null),
+ assert(freeRegistration != null),
+ assert(maxUploadMb != null),
+ assert(maxLinkedMessages != null),
+ assert(maxMessageUploads != null),
+ assert(maxUsernamePartLength != null),
+ assert(maxGroupTitleLength != null),
+ assert(maxRoleLength != null),
+ assert(maxMoodLength != null),
+ assert(maxMessageLength != null),
+ assert(maxSectionLength != null),
+ assert(maxTagLength != null),
+ assert(maxTaskTitleLength != null),
+ assert(maxColorRuleDescriptionLength != null),
+ assert(maxUrlLength != null),
+ assert(maxIntegrationCommentLength != null),
+ assert(maxTeams != null),
+ assert(afkAge != null),
+ assert(iceServers != null),
+ assert(customServer != null),
+ assert(installationType != null),
+ assert(isTesting != null),
+ assert(metrika != null),
+ assert(minSearchLength != null),
+ assert(resendTimeout != null),
+ assert(sentryDsnJS != null),
+ assert(serverDrafts != null),
+ assert(firebaseAppId != null),
+ assert(firebaseSenderId != null),
+ assert(firebaseApiKey != null),
+ assert(firebaseAuthDomain != null),
+ assert(firebaseDatabaseUrl != null),
+ assert(firebaseProjectId != null),
+ assert(firebaseStorageBucket != null),
+ assert(calls != null),
+ assert(mobileCalls != null),
+ assert(callsRecord != null),
+ assert(safariPushId != null),
+ assert(messageUploads != null),
+ assert(terms != null),
+ assert(singleGroupTeams != null),
+ assert(wikiPages != null),
+ assert(taskChecklist != null),
+ assert(readonlyGroups != null),
+ assert(taskDashboard != null),
+ assert(taskMessages != null),
+ assert(taskPublic != null),
+ assert(taskTags != null);
+
+ factory _$_Features.fromJson(Map json) => _$_$_FeaturesFromJson(json);
+
+ @override
+
+ /// Current host.
+ @JsonKey(name: 'host')
+ final String host;
+ @override
+
+ /// Build/revision of server side.
+ @JsonKey(name: 'build')
+ final String build;
+ @override
+
+ /// Desktop application version.
+ @JsonKey(name: 'desktop_version')
+ final String desktopVersion;
+ @override
+
+ /// Webclient version.
+ @JsonKey(name: 'front_version')
+ final String frontVersion;
+ @override
+
+ /// Application title.
+ @JsonKey(name: 'app_title')
+ final String appTitle;
+ @override
+
+ /// Local applications urls.
+ @JsonKey(name: 'app_schemes')
+ final List appSchemes;
+ @override
+
+ /// Static files server address.
+ @JsonKey(name: 'userver')
+ final String userver;
+ @override
+
+ /// Link to AppStore.
+ @JsonKey(name: 'ios_app')
+ final String iOSApp;
+ @override
+
+ /// Link to Google Play.
+ @JsonKey(name: 'android_app')
+ final String androidApp;
+ @override
+
+ /// Default UI theme.
+ @JsonKey(name: 'theme')
+ final String theme;
+ @override
+
+ /// Minimal application version required for this server. Used for breaking changes.
+ @JsonKey(name: 'min_app_version')
+ final String minAppVersion;
+ @override
+
+ /// Free registration allowed.
+ @JsonKey(name: 'free_registration')
+ final bool freeRegistration;
+ @override
+
+ /// Maximum size of user's upload.
+ @JsonKey(name: 'max_upload_mb')
+ final int maxUploadMb;
+ @override
+
+ /// Maximum number of forwarded messages.
+ @JsonKey(name: 'max_linked_messages')
+ final int maxLinkedMessages;
+ @override
+
+ /// Maximum number of message uploads.
+ @JsonKey(name: 'max_message_uploads')
+ final int maxMessageUploads;
+ @override
+
+ /// Maximum chars for: family_name, given_name, patronymic if any.
+ @JsonKey(name: 'max_username_part_length')
+ final int maxUsernamePartLength;
+ @override
+
+ /// Maximum chars for group chat name.
+ @JsonKey(name: 'max_group_title_length')
+ final int maxGroupTitleLength;
+ @override
+
+ /// Maximum chars for role in team.
+ @JsonKey(name: 'max_role_length')
+ final int maxRoleLength;
+ @override
+
+ /// Maximum chars for mood in team.
+ @JsonKey(name: 'max_mood_length')
+ final int maxMoodLength;
+ @override
+
+ /// Maximum chars for text message.
+ @JsonKey(name: 'max_message_length')
+ final int maxMessageLength;
+ @override
+
+ /// Maximum length for project and contact's sections names.
+ @JsonKey(name: 'max_section_length')
+ final int maxSectionLength;
+ @override
+
+ /// Maximum length for tags.
+ @JsonKey(name: 'max_tag_length')
+ final int maxTagLength;
+ @override
+
+ /// Maximum length for task title.
+ @JsonKey(name: 'max_task_title_length')
+ final int maxTaskTitleLength;
+ @override
+
+ /// Maximum length for ColorRule description.
+ @JsonKey(name: 'max_color_rule_description_length')
+ final int maxColorRuleDescriptionLength;
+ @override
+
+ /// Maximum length for urls.
+ @JsonKey(name: 'max_url_length')
+ final int maxUrlLength;
+ @override
+
+ /// Maximum length for Integration comment.
+ @JsonKey(name: 'max_integration_comment_length')
+ final int maxIntegrationCommentLength;
+ @override
+
+ /// Maximum teams for one account.
+ @JsonKey(name: 'max_teams')
+ final int maxTeams;
+ @override
+
+ /// Max inactivity seconds.
+ @JsonKey(name: 'afk_age')
+ final int afkAge;
+ @override
+
+ /// Password authentication enabled.
+ @JsonKey(name: 'auth_by_password')
+ final bool authByPassword;
+ @override
+
+ /// QR-code / link authentication enabled.
+ @JsonKey(name: 'auth_by_qr_code')
+ final bool authByQrCode;
+ @override
+
+ /// SMS authentication enabled.
+ @JsonKey(name: 'auth_by_sms')
+ final bool authBySms;
+ @override
+
+ /// ICE servers for WebRTC.
+ @JsonKey(name: 'ice_servers')
+ final List iceServers;
+ @override
+
+ /// True for on-premise installation.
+ @JsonKey(name: 'custom_server')
+ final bool customServer;
+ @override
+
+ /// Name of installation.
+ @JsonKey(name: 'installation_type')
+ final String installationType;
+ @override
+
+ /// Testing installation.
+ @JsonKey(name: 'is_testing')
+ final bool isTesting;
+ @override
+
+ /// Yandex metrika counter id.
+ @JsonKey(name: 'metrika')
+ final String metrika;
+ @override
+
+ /// Minimal chars number for starting global search.
+ @JsonKey(name: 'min_search_length')
+ final int minSearchLength;
+ @override
+
+ /// Resend message in n seconds if no confirmation from server given.
+ @JsonKey(name: 'resend_timeout')
+ final int resendTimeout;
+ @override
+
+ /// Frontend sentry.io settings.
+ @JsonKey(name: 'sentry_dsn_js')
+ final String sentryDsnJS;
+ @override
+
+ /// Message drafts saved on server.
+ @JsonKey(name: 'server_drafts')
+ final bool serverDrafts;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_app_id')
+ final String firebaseAppId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_sender_id')
+ final String firebaseSenderId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_api_key')
+ final String firebaseApiKey;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_auth_domain')
+ final String firebaseAuthDomain;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_database_url')
+ final String firebaseDatabaseUrl;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_project_id')
+ final String firebaseProjectId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_storage_bucket')
+ final String firebaseStorageBucket;
+ @override
+
+ /// Calls functions enabled.
+ @JsonKey(name: 'calls')
+ final bool calls;
+ @override
+
+ /// Calls functions enabled for mobile applications.
+ @JsonKey(name: 'mobile_calls')
+ final bool mobileCalls;
+ @override
+
+ /// Calls record enabled.
+ @JsonKey(name: 'calls_record')
+ final bool callsRecord;
+ @override
+
+ /// Disallow call from multiply devices. Experimental.
+ @JsonKey(name: 'only_one_device_per_call')
+ final bool onlyOneDevicePerCall;
+ @override
+
+ /// Maximum number of participants per call.
+ @JsonKey(name: 'max_participants_per_call')
+ final int maxParticipantsPerCall;
+ @override
+
+ /// Safari push id for web-push notifications.
+ @JsonKey(name: 'safari_push_id')
+ final String safariPushId;
+ @override
+
+ /// Multiple message uploads.
+ @JsonKey(name: 'message_uploads')
+ final bool messageUploads;
+ @override
+
+ /// Team entity naming. Experimental.
+ @JsonKey(name: 'terms')
+ final Terms terms;
+ @override
+
+ /// Cross team communication. Experimental.
+ @JsonKey(name: 'single_group_teams')
+ final bool singleGroupTeams;
+ @override
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'wiki_pages')
+ final bool wikiPages;
+ @override
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'allow_admin_mute')
+ final bool allowAdminMute;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_checklist')
+ final bool taskChecklist;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'readonly_groups')
+ final bool readonlyGroups;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_dashboard')
+ final bool taskDashboard;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_messages')
+ final bool taskMessages;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_public')
+ final bool taskPublic;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_tags')
+ final bool taskTags;
+
+ @override
+ String toString() {
+ return 'Features(host: $host, build: $build, desktopVersion: $desktopVersion, frontVersion: $frontVersion, appTitle: $appTitle, appSchemes: $appSchemes, userver: $userver, iOSApp: $iOSApp, androidApp: $androidApp, theme: $theme, minAppVersion: $minAppVersion, freeRegistration: $freeRegistration, maxUploadMb: $maxUploadMb, maxLinkedMessages: $maxLinkedMessages, maxMessageUploads: $maxMessageUploads, maxUsernamePartLength: $maxUsernamePartLength, maxGroupTitleLength: $maxGroupTitleLength, maxRoleLength: $maxRoleLength, maxMoodLength: $maxMoodLength, maxMessageLength: $maxMessageLength, maxSectionLength: $maxSectionLength, maxTagLength: $maxTagLength, maxTaskTitleLength: $maxTaskTitleLength, maxColorRuleDescriptionLength: $maxColorRuleDescriptionLength, maxUrlLength: $maxUrlLength, maxIntegrationCommentLength: $maxIntegrationCommentLength, maxTeams: $maxTeams, afkAge: $afkAge, authByPassword: $authByPassword, authByQrCode: $authByQrCode, authBySms: $authBySms, iceServers: $iceServers, customServer: $customServer, installationType: $installationType, isTesting: $isTesting, metrika: $metrika, minSearchLength: $minSearchLength, resendTimeout: $resendTimeout, sentryDsnJS: $sentryDsnJS, serverDrafts: $serverDrafts, firebaseAppId: $firebaseAppId, firebaseSenderId: $firebaseSenderId, firebaseApiKey: $firebaseApiKey, firebaseAuthDomain: $firebaseAuthDomain, firebaseDatabaseUrl: $firebaseDatabaseUrl, firebaseProjectId: $firebaseProjectId, firebaseStorageBucket: $firebaseStorageBucket, calls: $calls, mobileCalls: $mobileCalls, callsRecord: $callsRecord, onlyOneDevicePerCall: $onlyOneDevicePerCall, maxParticipantsPerCall: $maxParticipantsPerCall, safariPushId: $safariPushId, messageUploads: $messageUploads, terms: $terms, singleGroupTeams: $singleGroupTeams, wikiPages: $wikiPages, allowAdminMute: $allowAdminMute, taskChecklist: $taskChecklist, readonlyGroups: $readonlyGroups, taskDashboard: $taskDashboard, taskMessages: $taskMessages, taskPublic: $taskPublic, taskTags: $taskTags)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _Features &&
+ (identical(other.host, host) || const DeepCollectionEquality().equals(other.host, host)) &&
+ (identical(other.build, build) || const DeepCollectionEquality().equals(other.build, build)) &&
+ (identical(other.desktopVersion, desktopVersion) ||
+ const DeepCollectionEquality().equals(other.desktopVersion, desktopVersion)) &&
+ (identical(other.frontVersion, frontVersion) ||
+ const DeepCollectionEquality().equals(other.frontVersion, frontVersion)) &&
+ (identical(other.appTitle, appTitle) || const DeepCollectionEquality().equals(other.appTitle, appTitle)) &&
+ (identical(other.appSchemes, appSchemes) ||
+ const DeepCollectionEquality().equals(other.appSchemes, appSchemes)) &&
+ (identical(other.userver, userver) || const DeepCollectionEquality().equals(other.userver, userver)) &&
+ (identical(other.iOSApp, iOSApp) || const DeepCollectionEquality().equals(other.iOSApp, iOSApp)) &&
+ (identical(other.androidApp, androidApp) ||
+ const DeepCollectionEquality().equals(other.androidApp, androidApp)) &&
+ (identical(other.theme, theme) || const DeepCollectionEquality().equals(other.theme, theme)) &&
+ (identical(other.minAppVersion, minAppVersion) ||
+ const DeepCollectionEquality().equals(other.minAppVersion, minAppVersion)) &&
+ (identical(other.freeRegistration, freeRegistration) ||
+ const DeepCollectionEquality().equals(other.freeRegistration, freeRegistration)) &&
+ (identical(other.maxUploadMb, maxUploadMb) ||
+ const DeepCollectionEquality().equals(other.maxUploadMb, maxUploadMb)) &&
+ (identical(other.maxLinkedMessages, maxLinkedMessages) ||
+ const DeepCollectionEquality().equals(other.maxLinkedMessages, maxLinkedMessages)) &&
+ (identical(other.maxMessageUploads, maxMessageUploads) ||
+ const DeepCollectionEquality().equals(other.maxMessageUploads, maxMessageUploads)) &&
+ (identical(other.maxUsernamePartLength, maxUsernamePartLength) ||
+ const DeepCollectionEquality().equals(other.maxUsernamePartLength, maxUsernamePartLength)) &&
+ (identical(other.maxGroupTitleLength, maxGroupTitleLength) ||
+ const DeepCollectionEquality().equals(other.maxGroupTitleLength, maxGroupTitleLength)) &&
+ (identical(other.maxRoleLength, maxRoleLength) ||
+ const DeepCollectionEquality().equals(other.maxRoleLength, maxRoleLength)) &&
+ (identical(other.maxMoodLength, maxMoodLength) ||
+ const DeepCollectionEquality().equals(other.maxMoodLength, maxMoodLength)) &&
+ (identical(other.maxMessageLength, maxMessageLength) ||
+ const DeepCollectionEquality().equals(other.maxMessageLength, maxMessageLength)) &&
+ (identical(other.maxSectionLength, maxSectionLength) ||
+ const DeepCollectionEquality().equals(other.maxSectionLength, maxSectionLength)) &&
+ (identical(other.maxTagLength, maxTagLength) ||
+ const DeepCollectionEquality().equals(other.maxTagLength, maxTagLength)) &&
+ (identical(other.maxTaskTitleLength, maxTaskTitleLength) ||
+ const DeepCollectionEquality().equals(other.maxTaskTitleLength, maxTaskTitleLength)) &&
+ (identical(other.maxColorRuleDescriptionLength, maxColorRuleDescriptionLength) ||
+ const DeepCollectionEquality()
+ .equals(other.maxColorRuleDescriptionLength, maxColorRuleDescriptionLength)) &&
+ (identical(other.maxUrlLength, maxUrlLength) ||
+ const DeepCollectionEquality().equals(other.maxUrlLength, maxUrlLength)) &&
+ (identical(other.maxIntegrationCommentLength, maxIntegrationCommentLength) ||
+ const DeepCollectionEquality()
+ .equals(other.maxIntegrationCommentLength, maxIntegrationCommentLength)) &&
+ (identical(other.maxTeams, maxTeams) || const DeepCollectionEquality().equals(other.maxTeams, maxTeams)) &&
+ (identical(other.afkAge, afkAge) || const DeepCollectionEquality().equals(other.afkAge, afkAge)) &&
+ (identical(other.authByPassword, authByPassword) ||
+ const DeepCollectionEquality().equals(other.authByPassword, authByPassword)) &&
+ (identical(other.authByQrCode, authByQrCode) ||
+ const DeepCollectionEquality().equals(other.authByQrCode, authByQrCode)) &&
+ (identical(other.authBySms, authBySms) ||
+ const DeepCollectionEquality().equals(other.authBySms, authBySms)) &&
+ (identical(other.iceServers, iceServers) ||
+ const DeepCollectionEquality().equals(other.iceServers, iceServers)) &&
+ (identical(other.customServer, customServer) ||
+ const DeepCollectionEquality().equals(other.customServer, customServer)) &&
+ (identical(other.installationType, installationType) ||
+ const DeepCollectionEquality().equals(other.installationType, installationType)) &&
+ (identical(other.isTesting, isTesting) ||
+ const DeepCollectionEquality().equals(other.isTesting, isTesting)) &&
+ (identical(other.metrika, metrika) || const DeepCollectionEquality().equals(other.metrika, metrika)) &&
+ (identical(other.minSearchLength, minSearchLength) ||
+ const DeepCollectionEquality().equals(other.minSearchLength, minSearchLength)) &&
+ (identical(other.resendTimeout, resendTimeout) ||
+ const DeepCollectionEquality().equals(other.resendTimeout, resendTimeout)) &&
+ (identical(other.sentryDsnJS, sentryDsnJS) ||
+ const DeepCollectionEquality().equals(other.sentryDsnJS, sentryDsnJS)) &&
+ (identical(other.serverDrafts, serverDrafts) ||
+ const DeepCollectionEquality().equals(other.serverDrafts, serverDrafts)) &&
+ (identical(other.firebaseAppId, firebaseAppId) ||
+ const DeepCollectionEquality().equals(other.firebaseAppId, firebaseAppId)) &&
+ (identical(other.firebaseSenderId, firebaseSenderId) ||
+ const DeepCollectionEquality().equals(other.firebaseSenderId, firebaseSenderId)) &&
+ (identical(other.firebaseApiKey, firebaseApiKey) ||
+ const DeepCollectionEquality().equals(other.firebaseApiKey, firebaseApiKey)) &&
+ (identical(other.firebaseAuthDomain, firebaseAuthDomain) ||
+ const DeepCollectionEquality().equals(other.firebaseAuthDomain, firebaseAuthDomain)) &&
+ (identical(other.firebaseDatabaseUrl, firebaseDatabaseUrl) ||
+ const DeepCollectionEquality().equals(other.firebaseDatabaseUrl, firebaseDatabaseUrl)) &&
+ (identical(other.firebaseProjectId, firebaseProjectId) ||
+ const DeepCollectionEquality().equals(other.firebaseProjectId, firebaseProjectId)) &&
+ (identical(other.firebaseStorageBucket, firebaseStorageBucket) ||
+ const DeepCollectionEquality().equals(other.firebaseStorageBucket, firebaseStorageBucket)) &&
+ (identical(other.calls, calls) || const DeepCollectionEquality().equals(other.calls, calls)) &&
+ (identical(other.mobileCalls, mobileCalls) ||
+ const DeepCollectionEquality().equals(other.mobileCalls, mobileCalls)) &&
+ (identical(other.callsRecord, callsRecord) ||
+ const DeepCollectionEquality().equals(other.callsRecord, callsRecord)) &&
+ (identical(other.onlyOneDevicePerCall, onlyOneDevicePerCall) ||
+ const DeepCollectionEquality().equals(other.onlyOneDevicePerCall, onlyOneDevicePerCall)) &&
+ (identical(other.maxParticipantsPerCall, maxParticipantsPerCall) || const DeepCollectionEquality().equals(other.maxParticipantsPerCall, maxParticipantsPerCall)) &&
+ (identical(other.safariPushId, safariPushId) || const DeepCollectionEquality().equals(other.safariPushId, safariPushId)) &&
+ (identical(other.messageUploads, messageUploads) || const DeepCollectionEquality().equals(other.messageUploads, messageUploads)) &&
+ (identical(other.terms, terms) || const DeepCollectionEquality().equals(other.terms, terms)) &&
+ (identical(other.singleGroupTeams, singleGroupTeams) || const DeepCollectionEquality().equals(other.singleGroupTeams, singleGroupTeams)) &&
+ (identical(other.wikiPages, wikiPages) || const DeepCollectionEquality().equals(other.wikiPages, wikiPages)) &&
+ (identical(other.allowAdminMute, allowAdminMute) || const DeepCollectionEquality().equals(other.allowAdminMute, allowAdminMute)) &&
+ (identical(other.taskChecklist, taskChecklist) || const DeepCollectionEquality().equals(other.taskChecklist, taskChecklist)) &&
+ (identical(other.readonlyGroups, readonlyGroups) || const DeepCollectionEquality().equals(other.readonlyGroups, readonlyGroups)) &&
+ (identical(other.taskDashboard, taskDashboard) || const DeepCollectionEquality().equals(other.taskDashboard, taskDashboard)) &&
+ (identical(other.taskMessages, taskMessages) || const DeepCollectionEquality().equals(other.taskMessages, taskMessages)) &&
+ (identical(other.taskPublic, taskPublic) || const DeepCollectionEquality().equals(other.taskPublic, taskPublic)) &&
+ (identical(other.taskTags, taskTags) || const DeepCollectionEquality().equals(other.taskTags, taskTags)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(host) ^
+ const DeepCollectionEquality().hash(build) ^
+ const DeepCollectionEquality().hash(desktopVersion) ^
+ const DeepCollectionEquality().hash(frontVersion) ^
+ const DeepCollectionEquality().hash(appTitle) ^
+ const DeepCollectionEquality().hash(appSchemes) ^
+ const DeepCollectionEquality().hash(userver) ^
+ const DeepCollectionEquality().hash(iOSApp) ^
+ const DeepCollectionEquality().hash(androidApp) ^
+ const DeepCollectionEquality().hash(theme) ^
+ const DeepCollectionEquality().hash(minAppVersion) ^
+ const DeepCollectionEquality().hash(freeRegistration) ^
+ const DeepCollectionEquality().hash(maxUploadMb) ^
+ const DeepCollectionEquality().hash(maxLinkedMessages) ^
+ const DeepCollectionEquality().hash(maxMessageUploads) ^
+ const DeepCollectionEquality().hash(maxUsernamePartLength) ^
+ const DeepCollectionEquality().hash(maxGroupTitleLength) ^
+ const DeepCollectionEquality().hash(maxRoleLength) ^
+ const DeepCollectionEquality().hash(maxMoodLength) ^
+ const DeepCollectionEquality().hash(maxMessageLength) ^
+ const DeepCollectionEquality().hash(maxSectionLength) ^
+ const DeepCollectionEquality().hash(maxTagLength) ^
+ const DeepCollectionEquality().hash(maxTaskTitleLength) ^
+ const DeepCollectionEquality().hash(maxColorRuleDescriptionLength) ^
+ const DeepCollectionEquality().hash(maxUrlLength) ^
+ const DeepCollectionEquality().hash(maxIntegrationCommentLength) ^
+ const DeepCollectionEquality().hash(maxTeams) ^
+ const DeepCollectionEquality().hash(afkAge) ^
+ const DeepCollectionEquality().hash(authByPassword) ^
+ const DeepCollectionEquality().hash(authByQrCode) ^
+ const DeepCollectionEquality().hash(authBySms) ^
+ const DeepCollectionEquality().hash(iceServers) ^
+ const DeepCollectionEquality().hash(customServer) ^
+ const DeepCollectionEquality().hash(installationType) ^
+ const DeepCollectionEquality().hash(isTesting) ^
+ const DeepCollectionEquality().hash(metrika) ^
+ const DeepCollectionEquality().hash(minSearchLength) ^
+ const DeepCollectionEquality().hash(resendTimeout) ^
+ const DeepCollectionEquality().hash(sentryDsnJS) ^
+ const DeepCollectionEquality().hash(serverDrafts) ^
+ const DeepCollectionEquality().hash(firebaseAppId) ^
+ const DeepCollectionEquality().hash(firebaseSenderId) ^
+ const DeepCollectionEquality().hash(firebaseApiKey) ^
+ const DeepCollectionEquality().hash(firebaseAuthDomain) ^
+ const DeepCollectionEquality().hash(firebaseDatabaseUrl) ^
+ const DeepCollectionEquality().hash(firebaseProjectId) ^
+ const DeepCollectionEquality().hash(firebaseStorageBucket) ^
+ const DeepCollectionEquality().hash(calls) ^
+ const DeepCollectionEquality().hash(mobileCalls) ^
+ const DeepCollectionEquality().hash(callsRecord) ^
+ const DeepCollectionEquality().hash(onlyOneDevicePerCall) ^
+ const DeepCollectionEquality().hash(maxParticipantsPerCall) ^
+ const DeepCollectionEquality().hash(safariPushId) ^
+ const DeepCollectionEquality().hash(messageUploads) ^
+ const DeepCollectionEquality().hash(terms) ^
+ const DeepCollectionEquality().hash(singleGroupTeams) ^
+ const DeepCollectionEquality().hash(wikiPages) ^
+ const DeepCollectionEquality().hash(allowAdminMute) ^
+ const DeepCollectionEquality().hash(taskChecklist) ^
+ const DeepCollectionEquality().hash(readonlyGroups) ^
+ const DeepCollectionEquality().hash(taskDashboard) ^
+ const DeepCollectionEquality().hash(taskMessages) ^
+ const DeepCollectionEquality().hash(taskPublic) ^
+ const DeepCollectionEquality().hash(taskTags);
+
+ @override
+ _$FeaturesCopyWith<_Features> get copyWith => __$FeaturesCopyWithImpl<_Features>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_FeaturesToJson(this);
+ }
+}
+
+abstract class _Features implements Features {
+ const factory _Features(
+ {@required @JsonKey(name: 'host') String host,
+ @required @JsonKey(name: 'build') String build,
+ @required @JsonKey(name: 'desktop_version') String desktopVersion,
+ @required @JsonKey(name: 'front_version') String frontVersion,
+ @required @JsonKey(name: 'app_title') String appTitle,
+ @required @JsonKey(name: 'app_schemes') List appSchemes,
+ @required @JsonKey(name: 'userver') String userver,
+ @required @JsonKey(name: 'ios_app') String iOSApp,
+ @required @JsonKey(name: 'android_app') String androidApp,
+ @required @JsonKey(name: 'theme') String theme,
+ @required @JsonKey(name: 'min_app_version') String minAppVersion,
+ @required @JsonKey(name: 'free_registration') bool freeRegistration,
+ @required @JsonKey(name: 'max_upload_mb') int maxUploadMb,
+ @required @JsonKey(name: 'max_linked_messages') int maxLinkedMessages,
+ @required @JsonKey(name: 'max_message_uploads') int maxMessageUploads,
+ @required @JsonKey(name: 'max_username_part_length') int maxUsernamePartLength,
+ @required @JsonKey(name: 'max_group_title_length') int maxGroupTitleLength,
+ @required @JsonKey(name: 'max_role_length') int maxRoleLength,
+ @required @JsonKey(name: 'max_mood_length') int maxMoodLength,
+ @required @JsonKey(name: 'max_message_length') int maxMessageLength,
+ @required @JsonKey(name: 'max_section_length') int maxSectionLength,
+ @required @JsonKey(name: 'max_tag_length') int maxTagLength,
+ @required @JsonKey(name: 'max_task_title_length') int maxTaskTitleLength,
+ @required @JsonKey(name: 'max_color_rule_description_length') int maxColorRuleDescriptionLength,
+ @required @JsonKey(name: 'max_url_length') int maxUrlLength,
+ @required @JsonKey(name: 'max_integration_comment_length') int maxIntegrationCommentLength,
+ @required @JsonKey(name: 'max_teams') int maxTeams,
+ @required @JsonKey(name: 'afk_age') int afkAge,
+ @JsonKey(name: 'auth_by_password') bool authByPassword,
+ @JsonKey(name: 'auth_by_qr_code') bool authByQrCode,
+ @JsonKey(name: 'auth_by_sms') bool authBySms,
+ @required @JsonKey(name: 'ice_servers') List iceServers,
+ @required @JsonKey(name: 'custom_server') bool customServer,
+ @required @JsonKey(name: 'installation_type') String installationType,
+ @required @JsonKey(name: 'is_testing') bool isTesting,
+ @required @JsonKey(name: 'metrika') String metrika,
+ @required @JsonKey(name: 'min_search_length') int minSearchLength,
+ @required @JsonKey(name: 'resend_timeout') int resendTimeout,
+ @required @JsonKey(name: 'sentry_dsn_js') String sentryDsnJS,
+ @required @JsonKey(name: 'server_drafts') bool serverDrafts,
+ @required @JsonKey(name: 'firebase_app_id') String firebaseAppId,
+ @required @JsonKey(name: 'firebase_sender_id') String firebaseSenderId,
+ @required @JsonKey(name: 'firebase_api_key') String firebaseApiKey,
+ @required @JsonKey(name: 'firebase_auth_domain') String firebaseAuthDomain,
+ @required @JsonKey(name: 'firebase_database_url') String firebaseDatabaseUrl,
+ @required @JsonKey(name: 'firebase_project_id') String firebaseProjectId,
+ @required @JsonKey(name: 'firebase_storage_bucket') String firebaseStorageBucket,
+ @required @JsonKey(name: 'calls') bool calls,
+ @required @JsonKey(name: 'mobile_calls') bool mobileCalls,
+ @required @JsonKey(name: 'calls_record') bool callsRecord,
+ @JsonKey(name: 'only_one_device_per_call') bool onlyOneDevicePerCall,
+ @JsonKey(name: 'max_participants_per_call') int maxParticipantsPerCall,
+ @required @JsonKey(name: 'safari_push_id') String safariPushId,
+ @required @JsonKey(name: 'message_uploads') bool messageUploads,
+ @required @JsonKey(name: 'terms') Terms terms,
+ @required @JsonKey(name: 'single_group_teams') bool singleGroupTeams,
+ @required @JsonKey(name: 'wiki_pages') bool wikiPages,
+ @JsonKey(name: 'allow_admin_mute') bool allowAdminMute,
+ @required @deprecated @JsonKey(name: 'task_checklist') bool taskChecklist,
+ @required @deprecated @JsonKey(name: 'readonly_groups') bool readonlyGroups,
+ @required @deprecated @JsonKey(name: 'task_dashboard') bool taskDashboard,
+ @required @deprecated @JsonKey(name: 'task_messages') bool taskMessages,
+ @required @deprecated @JsonKey(name: 'task_public') bool taskPublic,
+ @required @deprecated @JsonKey(name: 'task_tags') bool taskTags}) = _$_Features;
+
+ factory _Features.fromJson(Map json) = _$_Features.fromJson;
+
+ @override
+
+ /// Current host.
+ @JsonKey(name: 'host')
+ String get host;
+ @override
+
+ /// Build/revision of server side.
+ @JsonKey(name: 'build')
+ String get build;
+ @override
+
+ /// Desktop application version.
+ @JsonKey(name: 'desktop_version')
+ String get desktopVersion;
+ @override
+
+ /// Webclient version.
+ @JsonKey(name: 'front_version')
+ String get frontVersion;
+ @override
+
+ /// Application title.
+ @JsonKey(name: 'app_title')
+ String get appTitle;
+ @override
+
+ /// Local applications urls.
+ @JsonKey(name: 'app_schemes')
+ List get appSchemes;
+ @override
+
+ /// Static files server address.
+ @JsonKey(name: 'userver')
+ String get userver;
+ @override
+
+ /// Link to AppStore.
+ @JsonKey(name: 'ios_app')
+ String get iOSApp;
+ @override
+
+ /// Link to Google Play.
+ @JsonKey(name: 'android_app')
+ String get androidApp;
+ @override
+
+ /// Default UI theme.
+ @JsonKey(name: 'theme')
+ String get theme;
+ @override
+
+ /// Minimal application version required for this server. Used for breaking changes.
+ @JsonKey(name: 'min_app_version')
+ String get minAppVersion;
+ @override
+
+ /// Free registration allowed.
+ @JsonKey(name: 'free_registration')
+ bool get freeRegistration;
+ @override
+
+ /// Maximum size of user's upload.
+ @JsonKey(name: 'max_upload_mb')
+ int get maxUploadMb;
+ @override
+
+ /// Maximum number of forwarded messages.
+ @JsonKey(name: 'max_linked_messages')
+ int get maxLinkedMessages;
+ @override
+
+ /// Maximum number of message uploads.
+ @JsonKey(name: 'max_message_uploads')
+ int get maxMessageUploads;
+ @override
+
+ /// Maximum chars for: family_name, given_name, patronymic if any.
+ @JsonKey(name: 'max_username_part_length')
+ int get maxUsernamePartLength;
+ @override
+
+ /// Maximum chars for group chat name.
+ @JsonKey(name: 'max_group_title_length')
+ int get maxGroupTitleLength;
+ @override
+
+ /// Maximum chars for role in team.
+ @JsonKey(name: 'max_role_length')
+ int get maxRoleLength;
+ @override
+
+ /// Maximum chars for mood in team.
+ @JsonKey(name: 'max_mood_length')
+ int get maxMoodLength;
+ @override
+
+ /// Maximum chars for text message.
+ @JsonKey(name: 'max_message_length')
+ int get maxMessageLength;
+ @override
+
+ /// Maximum length for project and contact's sections names.
+ @JsonKey(name: 'max_section_length')
+ int get maxSectionLength;
+ @override
+
+ /// Maximum length for tags.
+ @JsonKey(name: 'max_tag_length')
+ int get maxTagLength;
+ @override
+
+ /// Maximum length for task title.
+ @JsonKey(name: 'max_task_title_length')
+ int get maxTaskTitleLength;
+ @override
+
+ /// Maximum length for ColorRule description.
+ @JsonKey(name: 'max_color_rule_description_length')
+ int get maxColorRuleDescriptionLength;
+ @override
+
+ /// Maximum length for urls.
+ @JsonKey(name: 'max_url_length')
+ int get maxUrlLength;
+ @override
+
+ /// Maximum length for Integration comment.
+ @JsonKey(name: 'max_integration_comment_length')
+ int get maxIntegrationCommentLength;
+ @override
+
+ /// Maximum teams for one account.
+ @JsonKey(name: 'max_teams')
+ int get maxTeams;
+ @override
+
+ /// Max inactivity seconds.
+ @JsonKey(name: 'afk_age')
+ int get afkAge;
+ @override
+
+ /// Password authentication enabled.
+ @JsonKey(name: 'auth_by_password')
+ bool get authByPassword;
+ @override
+
+ /// QR-code / link authentication enabled.
+ @JsonKey(name: 'auth_by_qr_code')
+ bool get authByQrCode;
+ @override
+
+ /// SMS authentication enabled.
+ @JsonKey(name: 'auth_by_sms')
+ bool get authBySms;
+ @override
+
+ /// ICE servers for WebRTC.
+ @JsonKey(name: 'ice_servers')
+ List get iceServers;
+ @override
+
+ /// True for on-premise installation.
+ @JsonKey(name: 'custom_server')
+ bool get customServer;
+ @override
+
+ /// Name of installation.
+ @JsonKey(name: 'installation_type')
+ String get installationType;
+ @override
+
+ /// Testing installation.
+ @JsonKey(name: 'is_testing')
+ bool get isTesting;
+ @override
+
+ /// Yandex metrika counter id.
+ @JsonKey(name: 'metrika')
+ String get metrika;
+ @override
+
+ /// Minimal chars number for starting global search.
+ @JsonKey(name: 'min_search_length')
+ int get minSearchLength;
+ @override
+
+ /// Resend message in n seconds if no confirmation from server given.
+ @JsonKey(name: 'resend_timeout')
+ int get resendTimeout;
+ @override
+
+ /// Frontend sentry.io settings.
+ @JsonKey(name: 'sentry_dsn_js')
+ String get sentryDsnJS;
+ @override
+
+ /// Message drafts saved on server.
+ @JsonKey(name: 'server_drafts')
+ bool get serverDrafts;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_app_id')
+ String get firebaseAppId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_sender_id')
+ String get firebaseSenderId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_api_key')
+ String get firebaseApiKey;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_auth_domain')
+ String get firebaseAuthDomain;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_database_url')
+ String get firebaseDatabaseUrl;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_project_id')
+ String get firebaseProjectId;
+ @override
+
+ /// Firebase settings for web-push notifications.
+ @JsonKey(name: 'firebase_storage_bucket')
+ String get firebaseStorageBucket;
+ @override
+
+ /// Calls functions enabled.
+ @JsonKey(name: 'calls')
+ bool get calls;
+ @override
+
+ /// Calls functions enabled for mobile applications.
+ @JsonKey(name: 'mobile_calls')
+ bool get mobileCalls;
+ @override
+
+ /// Calls record enabled.
+ @JsonKey(name: 'calls_record')
+ bool get callsRecord;
+ @override
+
+ /// Disallow call from multiply devices. Experimental.
+ @JsonKey(name: 'only_one_device_per_call')
+ bool get onlyOneDevicePerCall;
+ @override
+
+ /// Maximum number of participants per call.
+ @JsonKey(name: 'max_participants_per_call')
+ int get maxParticipantsPerCall;
+ @override
+
+ /// Safari push id for web-push notifications.
+ @JsonKey(name: 'safari_push_id')
+ String get safariPushId;
+ @override
+
+ /// Multiple message uploads.
+ @JsonKey(name: 'message_uploads')
+ bool get messageUploads;
+ @override
+
+ /// Team entity naming. Experimental.
+ @JsonKey(name: 'terms')
+ Terms get terms;
+ @override
+
+ /// Cross team communication. Experimental.
+ @JsonKey(name: 'single_group_teams')
+ bool get singleGroupTeams;
+ @override
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'wiki_pages')
+ bool get wikiPages;
+ @override
+
+ /// Wiki pages in chats. Experimental.
+ @JsonKey(name: 'allow_admin_mute')
+ bool get allowAdminMute;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_checklist')
+ bool get taskChecklist;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'readonly_groups')
+ bool get readonlyGroups;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_dashboard')
+ bool get taskDashboard;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_messages')
+ bool get taskMessages;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_public')
+ bool get taskPublic;
+ @override
+
+ /// Deprecated.
+ @deprecated
+ @JsonKey(name: 'task_tags')
+ bool get taskTags;
+ @override
+ _$FeaturesCopyWith<_Features> get copyWith;
+}
diff --git a/lib/src/models/features/features.g.dart b/lib/src/models/features/features.g.dart
new file mode 100644
index 00000000..bb6e5c63
--- /dev/null
+++ b/lib/src/models/features/features.g.dart
@@ -0,0 +1,145 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'features.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_Features _$_$_FeaturesFromJson(Map json) {
+ return _$_Features(
+ host: json['host'] as String,
+ build: json['build'] as String,
+ desktopVersion: json['desktop_version'] as String,
+ frontVersion: json['front_version'] as String,
+ appTitle: json['app_title'] as String,
+ appSchemes: (json['app_schemes'] as List)?.map((e) => e as String)?.toList(),
+ userver: json['userver'] as String,
+ iOSApp: json['ios_app'] as String,
+ androidApp: json['android_app'] as String,
+ theme: json['theme'] as String,
+ minAppVersion: json['min_app_version'] as String,
+ freeRegistration: json['free_registration'] as bool,
+ maxUploadMb: json['max_upload_mb'] as int,
+ maxLinkedMessages: json['max_linked_messages'] as int,
+ maxMessageUploads: json['max_message_uploads'] as int,
+ maxUsernamePartLength: json['max_username_part_length'] as int,
+ maxGroupTitleLength: json['max_group_title_length'] as int,
+ maxRoleLength: json['max_role_length'] as int,
+ maxMoodLength: json['max_mood_length'] as int,
+ maxMessageLength: json['max_message_length'] as int,
+ maxSectionLength: json['max_section_length'] as int,
+ maxTagLength: json['max_tag_length'] as int,
+ maxTaskTitleLength: json['max_task_title_length'] as int,
+ maxColorRuleDescriptionLength: json['max_color_rule_description_length'] as int,
+ maxUrlLength: json['max_url_length'] as int,
+ maxIntegrationCommentLength: json['max_integration_comment_length'] as int,
+ maxTeams: json['max_teams'] as int,
+ afkAge: json['afk_age'] as int,
+ authByPassword: json['auth_by_password'] as bool,
+ authByQrCode: json['auth_by_qr_code'] as bool,
+ authBySms: json['auth_by_sms'] as bool,
+ iceServers: (json['ice_servers'] as List)
+ ?.map((e) => e == null ? null : ICEServer.fromJson(e as Map))
+ ?.toList(),
+ customServer: json['custom_server'] as bool,
+ installationType: json['installation_type'] as String,
+ isTesting: json['is_testing'] as bool,
+ metrika: json['metrika'] as String,
+ minSearchLength: json['min_search_length'] as int,
+ resendTimeout: json['resend_timeout'] as int,
+ sentryDsnJS: json['sentry_dsn_js'] as String,
+ serverDrafts: json['server_drafts'] as bool,
+ firebaseAppId: json['firebase_app_id'] as String,
+ firebaseSenderId: json['firebase_sender_id'] as String,
+ firebaseApiKey: json['firebase_api_key'] as String,
+ firebaseAuthDomain: json['firebase_auth_domain'] as String,
+ firebaseDatabaseUrl: json['firebase_database_url'] as String,
+ firebaseProjectId: json['firebase_project_id'] as String,
+ firebaseStorageBucket: json['firebase_storage_bucket'] as String,
+ calls: json['calls'] as bool,
+ mobileCalls: json['mobile_calls'] as bool,
+ callsRecord: json['calls_record'] as bool,
+ onlyOneDevicePerCall: json['only_one_device_per_call'] as bool,
+ maxParticipantsPerCall: json['max_participants_per_call'] as int,
+ safariPushId: json['safari_push_id'] as String,
+ messageUploads: json['message_uploads'] as bool,
+ terms: json['terms'] == null ? null : Terms.fromJson(json['terms'] as Map),
+ singleGroupTeams: json['single_group_teams'] as bool,
+ wikiPages: json['wiki_pages'] as bool,
+ allowAdminMute: json['allow_admin_mute'] as bool,
+ taskChecklist: json['task_checklist'] as bool,
+ readonlyGroups: json['readonly_groups'] as bool,
+ taskDashboard: json['task_dashboard'] as bool,
+ taskMessages: json['task_messages'] as bool,
+ taskPublic: json['task_public'] as bool,
+ taskTags: json['task_tags'] as bool,
+ );
+}
+
+Map _$_$_FeaturesToJson(_$_Features instance) => {
+ 'host': instance.host,
+ 'build': instance.build,
+ 'desktop_version': instance.desktopVersion,
+ 'front_version': instance.frontVersion,
+ 'app_title': instance.appTitle,
+ 'app_schemes': instance.appSchemes,
+ 'userver': instance.userver,
+ 'ios_app': instance.iOSApp,
+ 'android_app': instance.androidApp,
+ 'theme': instance.theme,
+ 'min_app_version': instance.minAppVersion,
+ 'free_registration': instance.freeRegistration,
+ 'max_upload_mb': instance.maxUploadMb,
+ 'max_linked_messages': instance.maxLinkedMessages,
+ 'max_message_uploads': instance.maxMessageUploads,
+ 'max_username_part_length': instance.maxUsernamePartLength,
+ 'max_group_title_length': instance.maxGroupTitleLength,
+ 'max_role_length': instance.maxRoleLength,
+ 'max_mood_length': instance.maxMoodLength,
+ 'max_message_length': instance.maxMessageLength,
+ 'max_section_length': instance.maxSectionLength,
+ 'max_tag_length': instance.maxTagLength,
+ 'max_task_title_length': instance.maxTaskTitleLength,
+ 'max_color_rule_description_length': instance.maxColorRuleDescriptionLength,
+ 'max_url_length': instance.maxUrlLength,
+ 'max_integration_comment_length': instance.maxIntegrationCommentLength,
+ 'max_teams': instance.maxTeams,
+ 'afk_age': instance.afkAge,
+ 'auth_by_password': instance.authByPassword,
+ 'auth_by_qr_code': instance.authByQrCode,
+ 'auth_by_sms': instance.authBySms,
+ 'ice_servers': instance.iceServers?.map((e) => e?.toJson())?.toList(),
+ 'custom_server': instance.customServer,
+ 'installation_type': instance.installationType,
+ 'is_testing': instance.isTesting,
+ 'metrika': instance.metrika,
+ 'min_search_length': instance.minSearchLength,
+ 'resend_timeout': instance.resendTimeout,
+ 'sentry_dsn_js': instance.sentryDsnJS,
+ 'server_drafts': instance.serverDrafts,
+ 'firebase_app_id': instance.firebaseAppId,
+ 'firebase_sender_id': instance.firebaseSenderId,
+ 'firebase_api_key': instance.firebaseApiKey,
+ 'firebase_auth_domain': instance.firebaseAuthDomain,
+ 'firebase_database_url': instance.firebaseDatabaseUrl,
+ 'firebase_project_id': instance.firebaseProjectId,
+ 'firebase_storage_bucket': instance.firebaseStorageBucket,
+ 'calls': instance.calls,
+ 'mobile_calls': instance.mobileCalls,
+ 'calls_record': instance.callsRecord,
+ 'only_one_device_per_call': instance.onlyOneDevicePerCall,
+ 'max_participants_per_call': instance.maxParticipantsPerCall,
+ 'safari_push_id': instance.safariPushId,
+ 'message_uploads': instance.messageUploads,
+ 'terms': instance.terms?.toJson(),
+ 'single_group_teams': instance.singleGroupTeams,
+ 'wiki_pages': instance.wikiPages,
+ 'allow_admin_mute': instance.allowAdminMute,
+ 'task_checklist': instance.taskChecklist,
+ 'readonly_groups': instance.readonlyGroups,
+ 'task_dashboard': instance.taskDashboard,
+ 'task_messages': instance.taskMessages,
+ 'task_public': instance.taskPublic,
+ 'task_tags': instance.taskTags,
+ };
diff --git a/lib/src/models/ice_server/ice_server.dart b/lib/src/models/ice_server/ice_server.dart
new file mode 100644
index 00000000..b09a3386
--- /dev/null
+++ b/lib/src/models/ice_server/ice_server.dart
@@ -0,0 +1,15 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'ice_server.freezed.dart';
+part 'ice_server.g.dart';
+
+/// Interactive Connectivity Establishment Server for WEB Rtc connection. Readonly
+@freezed
+abstract class ICEServer with _$ICEServer {
+ const factory ICEServer({
+ /// URls.
+ @JsonKey(name: 'urls') @required String urls,
+ }) = _ICEServer;
+
+ factory ICEServer.fromJson(Map json) => _$ICEServerFromJson(json);
+}
diff --git a/lib/src/models/ice_server/ice_server.freezed.dart b/lib/src/models/ice_server/ice_server.freezed.dart
new file mode 100644
index 00000000..1cd83b8b
--- /dev/null
+++ b/lib/src/models/ice_server/ice_server.freezed.dart
@@ -0,0 +1,145 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'ice_server.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+ICEServer _$ICEServerFromJson(Map json) {
+ return _ICEServer.fromJson(json);
+}
+
+/// @nodoc
+class _$ICEServerTearOff {
+ const _$ICEServerTearOff();
+
+// ignore: unused_element
+ _ICEServer call({@required @JsonKey(name: 'urls') String urls}) {
+ return _ICEServer(
+ urls: urls,
+ );
+ }
+
+// ignore: unused_element
+ ICEServer fromJson(Map json) {
+ return ICEServer.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $ICEServer = _$ICEServerTearOff();
+
+/// @nodoc
+mixin _$ICEServer {
+ /// URls.
+ @JsonKey(name: 'urls')
+ String get urls;
+
+ Map toJson();
+ $ICEServerCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $ICEServerCopyWith<$Res> {
+ factory $ICEServerCopyWith(ICEServer value, $Res Function(ICEServer) then) = _$ICEServerCopyWithImpl<$Res>;
+ $Res call({@JsonKey(name: 'urls') String urls});
+}
+
+/// @nodoc
+class _$ICEServerCopyWithImpl<$Res> implements $ICEServerCopyWith<$Res> {
+ _$ICEServerCopyWithImpl(this._value, this._then);
+
+ final ICEServer _value;
+ // ignore: unused_field
+ final $Res Function(ICEServer) _then;
+
+ @override
+ $Res call({
+ Object urls = freezed,
+ }) {
+ return _then(_value.copyWith(
+ urls: urls == freezed ? _value.urls : urls as String,
+ ));
+ }
+}
+
+/// @nodoc
+abstract class _$ICEServerCopyWith<$Res> implements $ICEServerCopyWith<$Res> {
+ factory _$ICEServerCopyWith(_ICEServer value, $Res Function(_ICEServer) then) = __$ICEServerCopyWithImpl<$Res>;
+ @override
+ $Res call({@JsonKey(name: 'urls') String urls});
+}
+
+/// @nodoc
+class __$ICEServerCopyWithImpl<$Res> extends _$ICEServerCopyWithImpl<$Res> implements _$ICEServerCopyWith<$Res> {
+ __$ICEServerCopyWithImpl(_ICEServer _value, $Res Function(_ICEServer) _then)
+ : super(_value, (v) => _then(v as _ICEServer));
+
+ @override
+ _ICEServer get _value => super._value as _ICEServer;
+
+ @override
+ $Res call({
+ Object urls = freezed,
+ }) {
+ return _then(_ICEServer(
+ urls: urls == freezed ? _value.urls : urls as String,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_ICEServer implements _ICEServer {
+ const _$_ICEServer({@required @JsonKey(name: 'urls') this.urls}) : assert(urls != null);
+
+ factory _$_ICEServer.fromJson(Map json) => _$_$_ICEServerFromJson(json);
+
+ @override
+
+ /// URls.
+ @JsonKey(name: 'urls')
+ final String urls;
+
+ @override
+ String toString() {
+ return 'ICEServer(urls: $urls)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _ICEServer &&
+ (identical(other.urls, urls) || const DeepCollectionEquality().equals(other.urls, urls)));
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode ^ const DeepCollectionEquality().hash(urls);
+
+ @override
+ _$ICEServerCopyWith<_ICEServer> get copyWith => __$ICEServerCopyWithImpl<_ICEServer>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_ICEServerToJson(this);
+ }
+}
+
+abstract class _ICEServer implements ICEServer {
+ const factory _ICEServer({@required @JsonKey(name: 'urls') String urls}) = _$_ICEServer;
+
+ factory _ICEServer.fromJson(Map json) = _$_ICEServer.fromJson;
+
+ @override
+
+ /// URls.
+ @JsonKey(name: 'urls')
+ String get urls;
+ @override
+ _$ICEServerCopyWith<_ICEServer> get copyWith;
+}
diff --git a/lib/src/models/ice_server/ice_server.g.dart b/lib/src/models/ice_server/ice_server.g.dart
new file mode 100644
index 00000000..a62e0a16
--- /dev/null
+++ b/lib/src/models/ice_server/ice_server.g.dart
@@ -0,0 +1,17 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'ice_server.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_ICEServer _$_$_ICEServerFromJson(Map json) {
+ return _$_ICEServer(
+ urls: json['urls'] as String,
+ );
+}
+
+Map _$_$_ICEServerToJson(_$_ICEServer instance) => {
+ 'urls': instance.urls,
+ };
diff --git a/lib/src/markup_entity/markup_entity.dart b/lib/src/models/markup_entity/markup_entity.dart
similarity index 94%
rename from lib/src/markup_entity/markup_entity.dart
rename to lib/src/models/markup_entity/markup_entity.dart
index e5b58c39..79fb2cbb 100644
--- a/lib/src/markup_entity/markup_entity.dart
+++ b/lib/src/models/markup_entity/markup_entity.dart
@@ -30,7 +30,7 @@ abstract class MarkupEntity with _$MarkupEntity {
@JsonKey(name: 'repl') String repl,
/// Time, for Time type.
- @JsonKey(name: 'time') String time,
+ @DateTimeConverter() @JsonKey(name: 'time') DateTime time,
/// List of internal markup entities.
@JsonKey(name: 'childs') List childs,
diff --git a/lib/src/markup_entity/markup_entity.freezed.dart b/lib/src/models/markup_entity/markup_entity.freezed.dart
similarity index 94%
rename from lib/src/markup_entity/markup_entity.freezed.dart
rename to lib/src/models/markup_entity/markup_entity.freezed.dart
index c63fd9aa..a6ac0112 100644
--- a/lib/src/markup_entity/markup_entity.freezed.dart
+++ b/lib/src/models/markup_entity/markup_entity.freezed.dart
@@ -25,7 +25,7 @@ class _$MarkupEntityTearOff {
@required @JsonKey(name: 'typ') MarkupType type,
@JsonKey(name: 'url') String url,
@JsonKey(name: 'repl') String repl,
- @JsonKey(name: 'time') String time,
+ @DateTimeConverter() @JsonKey(name: 'time') DateTime time,
@JsonKey(name: 'childs') List childs}) {
return _MarkupEntity(
open: open,
@@ -81,8 +81,9 @@ mixin _$MarkupEntity {
String get repl;
/// Time, for Time type.
+ @DateTimeConverter()
@JsonKey(name: 'time')
- String get time;
+ DateTime get time;
/// List of internal markup entities.
@JsonKey(name: 'childs')
@@ -104,7 +105,7 @@ abstract class $MarkupEntityCopyWith<$Res> {
@JsonKey(name: 'typ') MarkupType type,
@JsonKey(name: 'url') String url,
@JsonKey(name: 'repl') String repl,
- @JsonKey(name: 'time') String time,
+ @DateTimeConverter() @JsonKey(name: 'time') DateTime time,
@JsonKey(name: 'childs') List childs});
}
@@ -136,7 +137,7 @@ class _$MarkupEntityCopyWithImpl<$Res> implements $MarkupEntityCopyWith<$Res> {
type: type == freezed ? _value.type : type as MarkupType,
url: url == freezed ? _value.url : url as String,
repl: repl == freezed ? _value.repl : repl as String,
- time: time == freezed ? _value.time : time as String,
+ time: time == freezed ? _value.time : time as DateTime,
childs: childs == freezed ? _value.childs : childs as List,
));
}
@@ -155,7 +156,7 @@ abstract class _$MarkupEntityCopyWith<$Res> implements $MarkupEntityCopyWith<$Re
@JsonKey(name: 'typ') MarkupType type,
@JsonKey(name: 'url') String url,
@JsonKey(name: 'repl') String repl,
- @JsonKey(name: 'time') String time,
+ @DateTimeConverter() @JsonKey(name: 'time') DateTime time,
@JsonKey(name: 'childs') List childs});
}
@@ -188,7 +189,7 @@ class __$MarkupEntityCopyWithImpl<$Res> extends _$MarkupEntityCopyWithImpl<$Res>
type: type == freezed ? _value.type : type as MarkupType,
url: url == freezed ? _value.url : url as String,
repl: repl == freezed ? _value.repl : repl as String,
- time: time == freezed ? _value.time : time as String,
+ time: time == freezed ? _value.time : time as DateTime,
childs: childs == freezed ? _value.childs : childs as List,
));
}
@@ -206,7 +207,7 @@ class _$_MarkupEntity implements _MarkupEntity {
@required @JsonKey(name: 'typ') this.type,
@JsonKey(name: 'url') this.url,
@JsonKey(name: 'repl') this.repl,
- @JsonKey(name: 'time') this.time,
+ @DateTimeConverter() @JsonKey(name: 'time') this.time,
@JsonKey(name: 'childs') this.childs})
: assert(open != null),
assert(close != null),
@@ -252,8 +253,9 @@ class _$_MarkupEntity implements _MarkupEntity {
@override
/// Time, for Time type.
+ @DateTimeConverter()
@JsonKey(name: 'time')
- final String time;
+ final DateTime time;
@override
/// List of internal markup entities.
@@ -313,7 +315,7 @@ abstract class _MarkupEntity implements MarkupEntity {
@required @JsonKey(name: 'typ') MarkupType type,
@JsonKey(name: 'url') String url,
@JsonKey(name: 'repl') String repl,
- @JsonKey(name: 'time') String time,
+ @DateTimeConverter() @JsonKey(name: 'time') DateTime time,
@JsonKey(name: 'childs') List childs}) = _$_MarkupEntity;
factory _MarkupEntity.fromJson(Map json) = _$_MarkupEntity.fromJson;
@@ -356,8 +358,9 @@ abstract class _MarkupEntity implements MarkupEntity {
@override
/// Time, for Time type.
+ @DateTimeConverter()
@JsonKey(name: 'time')
- String get time;
+ DateTime get time;
@override
/// List of internal markup entities.
diff --git a/lib/src/markup_entity/markup_entity.g.dart b/lib/src/models/markup_entity/markup_entity.g.dart
similarity index 94%
rename from lib/src/markup_entity/markup_entity.g.dart
rename to lib/src/models/markup_entity/markup_entity.g.dart
index 70d0b926..010d3318 100644
--- a/lib/src/markup_entity/markup_entity.g.dart
+++ b/lib/src/models/markup_entity/markup_entity.g.dart
@@ -15,7 +15,7 @@ _$_MarkupEntity _$_$_MarkupEntityFromJson(Map json) {
type: _$enumDecodeNullable(_$MarkupTypeEnumMap, json['typ']),
url: json['url'] as String,
repl: json['repl'] as String,
- time: json['time'] as String,
+ time: const DateTimeConverter().fromJson(json['time'] as String),
childs: (json['childs'] as List)
?.map((e) => e == null ? null : MarkupEntity.fromJson(e as Map))
?.toList(),
@@ -30,7 +30,7 @@ Map _$_$_MarkupEntityToJson(_$_MarkupEntity instance) => e?.toJson())?.toList(),
};
diff --git a/lib/src/models/message/message.dart b/lib/src/models/message/message.dart
new file mode 100644
index 00000000..3779419a
--- /dev/null
+++ b/lib/src/models/message/message.dart
@@ -0,0 +1,103 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'message.freezed.dart';
+part 'message.g.dart';
+
+/// Chat message
+@freezed
+abstract class Message with _$Message {
+ const factory Message({
+ /// Message content struct.
+ @JsonKey(name: 'content') @required MessageContent content,
+
+ /// Simple plaintext message representation. Readonly.
+ @JsonKey(name: 'push_text') String pushText,
+
+ /// Sender contact id. Readonly.
+ @JsonKey(name: 'from') @required String from,
+
+ /// Recipient id (group, task or contact).
+ @JsonKey(name: 'to') @required String to,
+
+ /// Message uid.
+ @JsonKey(name: 'message_id') @required String messageId,
+
+ /// Message creation datetime (set by server side) or sending datetime in future for draft messages. Readonly.
+ @JsonKey(name: 'created') @DateTimeConverter() @required DateTime created,
+
+ /// Creation datetime for draft messages. Readonly.
+ @JsonKey(name: 'drafted') @DateTimeConverter() DateTime drafted,
+
+ /// Object version. Readonly.
+ @JsonKey(name: 'gentime') @required int gentime,
+
+ /// Chat type. Readonly.
+ @JsonKey(name: 'chat_type') @required ChatType chatType,
+
+ /// Chat id. Readonly.
+ @JsonKey(name: 'chat') @required String chat,
+
+ /// External/internals links. Readonly.
+ @JsonKey(name: 'links') List links,
+
+ /// Markup entities. Experimental. Readonly.
+ @JsonKey(name: 'markup') List markup,
+
+ /// Importance flag.
+ @JsonKey(name: 'important') bool important,
+
+ /// ISODateTimeString of message modification or deletion. Readonly.
+ @JsonKey(name: 'edited') @DateTimeConverter() DateTime edited,
+
+ /// Message was seen by anybody in chat. True or null. Readonly.
+ @JsonKey(name: 'received') bool received,
+
+ /// Unused yet. Readonly.
+ @JsonKey(name: 'num_received') int numReceived,
+
+ /// Disable link previews. True or null.
+ @JsonKey(name: 'nopreview') bool nopreview,
+
+ /// Has link previews. True or null. Readonly.
+ @JsonKey(name: 'has_previews') bool hasPreviews,
+
+ /// Previous message id in this chat. Uid or null. Readonly.
+ @JsonKey(name: 'prev') String prev,
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_first') bool isFirst,
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_last') bool isLast,
+
+ /// Message uploads.
+ @JsonKey(name: 'uploads') List uploads,
+
+ /// Message reactions struct. Can be null. Readonly.
+ @JsonKey(name: 'reactions') List reactions,
+
+ /// Message that was replied to, if any.
+ @JsonKey(name: 'reply_to') Message replyTo,
+
+ /// Forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility.
+ @JsonKey(name: 'linked_messages') List linkedMessages,
+
+ /// Has mention (@). True or null. Readonly.
+ @JsonKey(name: 'notice') bool notice,
+
+ /// Message has no pushes and did not affect any counters. Readonly.
+ @JsonKey(name: 'silently') bool silently,
+
+ /// Author can change this message until date. Can be null. Readonly.
+ @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime editableUntil,
+
+ /// Index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted. Readonly.
+ @JsonKey(name: 'num') int num,
+
+ /// Debug information, if any. Readonly.
+ @JsonKey(name: '_debug') String debug,
+ }) = _Message;
+
+ factory Message.fromJson(Map json) => _$MessageFromJson(json);
+}
diff --git a/lib/src/models/message/message.freezed.dart b/lib/src/models/message/message.freezed.dart
new file mode 100644
index 00000000..1fc3397c
--- /dev/null
+++ b/lib/src/models/message/message.freezed.dart
@@ -0,0 +1,961 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+Message _$MessageFromJson(Map json) {
+ return _Message.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageTearOff {
+ const _$MessageTearOff();
+
+// ignore: unused_element
+ _Message call(
+ {@required @JsonKey(name: 'content') MessageContent content,
+ @JsonKey(name: 'push_text') String pushText,
+ @required @JsonKey(name: 'from') String from,
+ @required @JsonKey(name: 'to') String to,
+ @required @JsonKey(name: 'message_id') String messageId,
+ @required @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'drafted') @DateTimeConverter() DateTime drafted,
+ @required @JsonKey(name: 'gentime') int gentime,
+ @required @JsonKey(name: 'chat_type') ChatType chatType,
+ @required @JsonKey(name: 'chat') String chat,
+ @JsonKey(name: 'links') List links,
+ @JsonKey(name: 'markup') List markup,
+ @JsonKey(name: 'important') bool important,
+ @JsonKey(name: 'edited') @DateTimeConverter() DateTime edited,
+ @JsonKey(name: 'received') bool received,
+ @JsonKey(name: 'num_received') int numReceived,
+ @JsonKey(name: 'nopreview') bool nopreview,
+ @JsonKey(name: 'has_previews') bool hasPreviews,
+ @JsonKey(name: 'prev') String prev,
+ @JsonKey(name: 'is_first') bool isFirst,
+ @JsonKey(name: 'is_last') bool isLast,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'reactions') List reactions,
+ @JsonKey(name: 'reply_to') Message replyTo,
+ @JsonKey(name: 'linked_messages') List linkedMessages,
+ @JsonKey(name: 'notice') bool notice,
+ @JsonKey(name: 'silently') bool silently,
+ @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime editableUntil,
+ @JsonKey(name: 'num') int num,
+ @JsonKey(name: '_debug') String debug}) {
+ return _Message(
+ content: content,
+ pushText: pushText,
+ from: from,
+ to: to,
+ messageId: messageId,
+ created: created,
+ drafted: drafted,
+ gentime: gentime,
+ chatType: chatType,
+ chat: chat,
+ links: links,
+ markup: markup,
+ important: important,
+ edited: edited,
+ received: received,
+ numReceived: numReceived,
+ nopreview: nopreview,
+ hasPreviews: hasPreviews,
+ prev: prev,
+ isFirst: isFirst,
+ isLast: isLast,
+ uploads: uploads,
+ reactions: reactions,
+ replyTo: replyTo,
+ linkedMessages: linkedMessages,
+ notice: notice,
+ silently: silently,
+ editableUntil: editableUntil,
+ num: num,
+ debug: debug,
+ );
+ }
+
+// ignore: unused_element
+ Message fromJson(Map json) {
+ return Message.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $Message = _$MessageTearOff();
+
+/// @nodoc
+mixin _$Message {
+ /// Message content struct.
+ @JsonKey(name: 'content')
+ MessageContent get content;
+
+ /// Simple plaintext message representation. Readonly.
+ @JsonKey(name: 'push_text')
+ String get pushText;
+
+ /// Sender contact id. Readonly.
+ @JsonKey(name: 'from')
+ String get from;
+
+ /// Recipient id (group, task or contact).
+ @JsonKey(name: 'to')
+ String get to;
+
+ /// Message uid.
+ @JsonKey(name: 'message_id')
+ String get messageId;
+
+ /// Message creation datetime (set by server side) or sending datetime in future for draft messages. Readonly.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ DateTime get created;
+
+ /// Creation datetime for draft messages. Readonly.
+ @JsonKey(name: 'drafted')
+ @DateTimeConverter()
+ DateTime get drafted;
+
+ /// Object version. Readonly.
+ @JsonKey(name: 'gentime')
+ int get gentime;
+
+ /// Chat type. Readonly.
+ @JsonKey(name: 'chat_type')
+ ChatType get chatType;
+
+ /// Chat id. Readonly.
+ @JsonKey(name: 'chat')
+ String get chat;
+
+ /// External/internals links. Readonly.
+ @JsonKey(name: 'links')
+ List get links;
+
+ /// Markup entities. Experimental. Readonly.
+ @JsonKey(name: 'markup')
+ List get markup;
+
+ /// Importance flag.
+ @JsonKey(name: 'important')
+ bool get important;
+
+ /// ISODateTimeString of message modification or deletion. Readonly.
+ @JsonKey(name: 'edited')
+ @DateTimeConverter()
+ DateTime get edited;
+
+ /// Message was seen by anybody in chat. True or null. Readonly.
+ @JsonKey(name: 'received')
+ bool get received;
+
+ /// Unused yet. Readonly.
+ @JsonKey(name: 'num_received')
+ int get numReceived;
+
+ /// Disable link previews. True or null.
+ @JsonKey(name: 'nopreview')
+ bool get nopreview;
+
+ /// Has link previews. True or null. Readonly.
+ @JsonKey(name: 'has_previews')
+ bool get hasPreviews;
+
+ /// Previous message id in this chat. Uid or null. Readonly.
+ @JsonKey(name: 'prev')
+ String get prev;
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_first')
+ bool get isFirst;
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_last')
+ bool get isLast;
+
+ /// Message uploads.
+ @JsonKey(name: 'uploads')
+ List get uploads;
+
+ /// Message reactions struct. Can be null. Readonly.
+ @JsonKey(name: 'reactions')
+ List get reactions;
+
+ /// Message that was replied to, if any.
+ @JsonKey(name: 'reply_to')
+ Message get replyTo;
+
+ /// Forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility.
+ @JsonKey(name: 'linked_messages')
+ List get linkedMessages;
+
+ /// Has mention (@). True or null. Readonly.
+ @JsonKey(name: 'notice')
+ bool get notice;
+
+ /// Message has no pushes and did not affect any counters. Readonly.
+ @JsonKey(name: 'silently')
+ bool get silently;
+
+ /// Author can change this message until date. Can be null. Readonly.
+ @JsonKey(name: 'editable_until')
+ @DateTimeConverter()
+ DateTime get editableUntil;
+
+ /// Index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted. Readonly.
+ @JsonKey(name: 'num')
+ int get num;
+
+ /// Debug information, if any. Readonly.
+ @JsonKey(name: '_debug')
+ String get debug;
+
+ Map toJson();
+ $MessageCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageCopyWith<$Res> {
+ factory $MessageCopyWith(Message value, $Res Function(Message) then) = _$MessageCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'content') MessageContent content,
+ @JsonKey(name: 'push_text') String pushText,
+ @JsonKey(name: 'from') String from,
+ @JsonKey(name: 'to') String to,
+ @JsonKey(name: 'message_id') String messageId,
+ @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'drafted') @DateTimeConverter() DateTime drafted,
+ @JsonKey(name: 'gentime') int gentime,
+ @JsonKey(name: 'chat_type') ChatType chatType,
+ @JsonKey(name: 'chat') String chat,
+ @JsonKey(name: 'links') List links,
+ @JsonKey(name: 'markup') List markup,
+ @JsonKey(name: 'important') bool important,
+ @JsonKey(name: 'edited') @DateTimeConverter() DateTime edited,
+ @JsonKey(name: 'received') bool received,
+ @JsonKey(name: 'num_received') int numReceived,
+ @JsonKey(name: 'nopreview') bool nopreview,
+ @JsonKey(name: 'has_previews') bool hasPreviews,
+ @JsonKey(name: 'prev') String prev,
+ @JsonKey(name: 'is_first') bool isFirst,
+ @JsonKey(name: 'is_last') bool isLast,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'reactions') List reactions,
+ @JsonKey(name: 'reply_to') Message replyTo,
+ @JsonKey(name: 'linked_messages') List linkedMessages,
+ @JsonKey(name: 'notice') bool notice,
+ @JsonKey(name: 'silently') bool silently,
+ @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime editableUntil,
+ @JsonKey(name: 'num') int num,
+ @JsonKey(name: '_debug') String debug});
+
+ $MessageContentCopyWith<$Res> get content;
+ $MessageCopyWith<$Res> get replyTo;
+}
+
+/// @nodoc
+class _$MessageCopyWithImpl<$Res> implements $MessageCopyWith<$Res> {
+ _$MessageCopyWithImpl(this._value, this._then);
+
+ final Message _value;
+ // ignore: unused_field
+ final $Res Function(Message) _then;
+
+ @override
+ $Res call({
+ Object content = freezed,
+ Object pushText = freezed,
+ Object from = freezed,
+ Object to = freezed,
+ Object messageId = freezed,
+ Object created = freezed,
+ Object drafted = freezed,
+ Object gentime = freezed,
+ Object chatType = freezed,
+ Object chat = freezed,
+ Object links = freezed,
+ Object markup = freezed,
+ Object important = freezed,
+ Object edited = freezed,
+ Object received = freezed,
+ Object numReceived = freezed,
+ Object nopreview = freezed,
+ Object hasPreviews = freezed,
+ Object prev = freezed,
+ Object isFirst = freezed,
+ Object isLast = freezed,
+ Object uploads = freezed,
+ Object reactions = freezed,
+ Object replyTo = freezed,
+ Object linkedMessages = freezed,
+ Object notice = freezed,
+ Object silently = freezed,
+ Object editableUntil = freezed,
+ Object num = freezed,
+ Object debug = freezed,
+ }) {
+ return _then(_value.copyWith(
+ content: content == freezed ? _value.content : content as MessageContent,
+ pushText: pushText == freezed ? _value.pushText : pushText as String,
+ from: from == freezed ? _value.from : from as String,
+ to: to == freezed ? _value.to : to as String,
+ messageId: messageId == freezed ? _value.messageId : messageId as String,
+ created: created == freezed ? _value.created : created as DateTime,
+ drafted: drafted == freezed ? _value.drafted : drafted as DateTime,
+ gentime: gentime == freezed ? _value.gentime : gentime as int,
+ chatType: chatType == freezed ? _value.chatType : chatType as ChatType,
+ chat: chat == freezed ? _value.chat : chat as String,
+ links: links == freezed ? _value.links : links as List,
+ markup: markup == freezed ? _value.markup : markup as List,
+ important: important == freezed ? _value.important : important as bool,
+ edited: edited == freezed ? _value.edited : edited as DateTime,
+ received: received == freezed ? _value.received : received as bool,
+ numReceived: numReceived == freezed ? _value.numReceived : numReceived as int,
+ nopreview: nopreview == freezed ? _value.nopreview : nopreview as bool,
+ hasPreviews: hasPreviews == freezed ? _value.hasPreviews : hasPreviews as bool,
+ prev: prev == freezed ? _value.prev : prev as String,
+ isFirst: isFirst == freezed ? _value.isFirst : isFirst as bool,
+ isLast: isLast == freezed ? _value.isLast : isLast as bool,
+ uploads: uploads == freezed ? _value.uploads : uploads as List,
+ reactions: reactions == freezed ? _value.reactions : reactions as List,
+ replyTo: replyTo == freezed ? _value.replyTo : replyTo as Message,
+ linkedMessages: linkedMessages == freezed ? _value.linkedMessages : linkedMessages as List,
+ notice: notice == freezed ? _value.notice : notice as bool,
+ silently: silently == freezed ? _value.silently : silently as bool,
+ editableUntil: editableUntil == freezed ? _value.editableUntil : editableUntil as DateTime,
+ num: num == freezed ? _value.num : num as int,
+ debug: debug == freezed ? _value.debug : debug as String,
+ ));
+ }
+
+ @override
+ $MessageContentCopyWith<$Res> get content {
+ if (_value.content == null) {
+ return null;
+ }
+ return $MessageContentCopyWith<$Res>(_value.content, (value) {
+ return _then(_value.copyWith(content: value));
+ });
+ }
+
+ @override
+ $MessageCopyWith<$Res> get replyTo {
+ if (_value.replyTo == null) {
+ return null;
+ }
+ return $MessageCopyWith<$Res>(_value.replyTo, (value) {
+ return _then(_value.copyWith(replyTo: value));
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$MessageCopyWith<$Res> implements $MessageCopyWith<$Res> {
+ factory _$MessageCopyWith(_Message value, $Res Function(_Message) then) = __$MessageCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'content') MessageContent content,
+ @JsonKey(name: 'push_text') String pushText,
+ @JsonKey(name: 'from') String from,
+ @JsonKey(name: 'to') String to,
+ @JsonKey(name: 'message_id') String messageId,
+ @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'drafted') @DateTimeConverter() DateTime drafted,
+ @JsonKey(name: 'gentime') int gentime,
+ @JsonKey(name: 'chat_type') ChatType chatType,
+ @JsonKey(name: 'chat') String chat,
+ @JsonKey(name: 'links') List links,
+ @JsonKey(name: 'markup') List markup,
+ @JsonKey(name: 'important') bool important,
+ @JsonKey(name: 'edited') @DateTimeConverter() DateTime edited,
+ @JsonKey(name: 'received') bool received,
+ @JsonKey(name: 'num_received') int numReceived,
+ @JsonKey(name: 'nopreview') bool nopreview,
+ @JsonKey(name: 'has_previews') bool hasPreviews,
+ @JsonKey(name: 'prev') String prev,
+ @JsonKey(name: 'is_first') bool isFirst,
+ @JsonKey(name: 'is_last') bool isLast,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'reactions') List reactions,
+ @JsonKey(name: 'reply_to') Message replyTo,
+ @JsonKey(name: 'linked_messages') List linkedMessages,
+ @JsonKey(name: 'notice') bool notice,
+ @JsonKey(name: 'silently') bool silently,
+ @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime editableUntil,
+ @JsonKey(name: 'num') int num,
+ @JsonKey(name: '_debug') String debug});
+
+ @override
+ $MessageContentCopyWith<$Res> get content;
+ @override
+ $MessageCopyWith<$Res> get replyTo;
+}
+
+/// @nodoc
+class __$MessageCopyWithImpl<$Res> extends _$MessageCopyWithImpl<$Res> implements _$MessageCopyWith<$Res> {
+ __$MessageCopyWithImpl(_Message _value, $Res Function(_Message) _then) : super(_value, (v) => _then(v as _Message));
+
+ @override
+ _Message get _value => super._value as _Message;
+
+ @override
+ $Res call({
+ Object content = freezed,
+ Object pushText = freezed,
+ Object from = freezed,
+ Object to = freezed,
+ Object messageId = freezed,
+ Object created = freezed,
+ Object drafted = freezed,
+ Object gentime = freezed,
+ Object chatType = freezed,
+ Object chat = freezed,
+ Object links = freezed,
+ Object markup = freezed,
+ Object important = freezed,
+ Object edited = freezed,
+ Object received = freezed,
+ Object numReceived = freezed,
+ Object nopreview = freezed,
+ Object hasPreviews = freezed,
+ Object prev = freezed,
+ Object isFirst = freezed,
+ Object isLast = freezed,
+ Object uploads = freezed,
+ Object reactions = freezed,
+ Object replyTo = freezed,
+ Object linkedMessages = freezed,
+ Object notice = freezed,
+ Object silently = freezed,
+ Object editableUntil = freezed,
+ Object num = freezed,
+ Object debug = freezed,
+ }) {
+ return _then(_Message(
+ content: content == freezed ? _value.content : content as MessageContent,
+ pushText: pushText == freezed ? _value.pushText : pushText as String,
+ from: from == freezed ? _value.from : from as String,
+ to: to == freezed ? _value.to : to as String,
+ messageId: messageId == freezed ? _value.messageId : messageId as String,
+ created: created == freezed ? _value.created : created as DateTime,
+ drafted: drafted == freezed ? _value.drafted : drafted as DateTime,
+ gentime: gentime == freezed ? _value.gentime : gentime as int,
+ chatType: chatType == freezed ? _value.chatType : chatType as ChatType,
+ chat: chat == freezed ? _value.chat : chat as String,
+ links: links == freezed ? _value.links : links as List,
+ markup: markup == freezed ? _value.markup : markup as List,
+ important: important == freezed ? _value.important : important as bool,
+ edited: edited == freezed ? _value.edited : edited as DateTime,
+ received: received == freezed ? _value.received : received as bool,
+ numReceived: numReceived == freezed ? _value.numReceived : numReceived as int,
+ nopreview: nopreview == freezed ? _value.nopreview : nopreview as bool,
+ hasPreviews: hasPreviews == freezed ? _value.hasPreviews : hasPreviews as bool,
+ prev: prev == freezed ? _value.prev : prev as String,
+ isFirst: isFirst == freezed ? _value.isFirst : isFirst as bool,
+ isLast: isLast == freezed ? _value.isLast : isLast as bool,
+ uploads: uploads == freezed ? _value.uploads : uploads as List,
+ reactions: reactions == freezed ? _value.reactions : reactions as List,
+ replyTo: replyTo == freezed ? _value.replyTo : replyTo as Message,
+ linkedMessages: linkedMessages == freezed ? _value.linkedMessages : linkedMessages as List,
+ notice: notice == freezed ? _value.notice : notice as bool,
+ silently: silently == freezed ? _value.silently : silently as bool,
+ editableUntil: editableUntil == freezed ? _value.editableUntil : editableUntil as DateTime,
+ num: num == freezed ? _value.num : num as int,
+ debug: debug == freezed ? _value.debug : debug as String,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_Message implements _Message {
+ const _$_Message(
+ {@required @JsonKey(name: 'content') this.content,
+ @JsonKey(name: 'push_text') this.pushText,
+ @required @JsonKey(name: 'from') this.from,
+ @required @JsonKey(name: 'to') this.to,
+ @required @JsonKey(name: 'message_id') this.messageId,
+ @required @JsonKey(name: 'created') @DateTimeConverter() this.created,
+ @JsonKey(name: 'drafted') @DateTimeConverter() this.drafted,
+ @required @JsonKey(name: 'gentime') this.gentime,
+ @required @JsonKey(name: 'chat_type') this.chatType,
+ @required @JsonKey(name: 'chat') this.chat,
+ @JsonKey(name: 'links') this.links,
+ @JsonKey(name: 'markup') this.markup,
+ @JsonKey(name: 'important') this.important,
+ @JsonKey(name: 'edited') @DateTimeConverter() this.edited,
+ @JsonKey(name: 'received') this.received,
+ @JsonKey(name: 'num_received') this.numReceived,
+ @JsonKey(name: 'nopreview') this.nopreview,
+ @JsonKey(name: 'has_previews') this.hasPreviews,
+ @JsonKey(name: 'prev') this.prev,
+ @JsonKey(name: 'is_first') this.isFirst,
+ @JsonKey(name: 'is_last') this.isLast,
+ @JsonKey(name: 'uploads') this.uploads,
+ @JsonKey(name: 'reactions') this.reactions,
+ @JsonKey(name: 'reply_to') this.replyTo,
+ @JsonKey(name: 'linked_messages') this.linkedMessages,
+ @JsonKey(name: 'notice') this.notice,
+ @JsonKey(name: 'silently') this.silently,
+ @JsonKey(name: 'editable_until') @DateTimeConverter() this.editableUntil,
+ @JsonKey(name: 'num') this.num,
+ @JsonKey(name: '_debug') this.debug})
+ : assert(content != null),
+ assert(from != null),
+ assert(to != null),
+ assert(messageId != null),
+ assert(created != null),
+ assert(gentime != null),
+ assert(chatType != null),
+ assert(chat != null);
+
+ factory _$_Message.fromJson(Map json) => _$_$_MessageFromJson(json);
+
+ @override
+
+ /// Message content struct.
+ @JsonKey(name: 'content')
+ final MessageContent content;
+ @override
+
+ /// Simple plaintext message representation. Readonly.
+ @JsonKey(name: 'push_text')
+ final String pushText;
+ @override
+
+ /// Sender contact id. Readonly.
+ @JsonKey(name: 'from')
+ final String from;
+ @override
+
+ /// Recipient id (group, task or contact).
+ @JsonKey(name: 'to')
+ final String to;
+ @override
+
+ /// Message uid.
+ @JsonKey(name: 'message_id')
+ final String messageId;
+ @override
+
+ /// Message creation datetime (set by server side) or sending datetime in future for draft messages. Readonly.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ final DateTime created;
+ @override
+
+ /// Creation datetime for draft messages. Readonly.
+ @JsonKey(name: 'drafted')
+ @DateTimeConverter()
+ final DateTime drafted;
+ @override
+
+ /// Object version. Readonly.
+ @JsonKey(name: 'gentime')
+ final int gentime;
+ @override
+
+ /// Chat type. Readonly.
+ @JsonKey(name: 'chat_type')
+ final ChatType chatType;
+ @override
+
+ /// Chat id. Readonly.
+ @JsonKey(name: 'chat')
+ final String chat;
+ @override
+
+ /// External/internals links. Readonly.
+ @JsonKey(name: 'links')
+ final List links;
+ @override
+
+ /// Markup entities. Experimental. Readonly.
+ @JsonKey(name: 'markup')
+ final List markup;
+ @override
+
+ /// Importance flag.
+ @JsonKey(name: 'important')
+ final bool important;
+ @override
+
+ /// ISODateTimeString of message modification or deletion. Readonly.
+ @JsonKey(name: 'edited')
+ @DateTimeConverter()
+ final DateTime edited;
+ @override
+
+ /// Message was seen by anybody in chat. True or null. Readonly.
+ @JsonKey(name: 'received')
+ final bool received;
+ @override
+
+ /// Unused yet. Readonly.
+ @JsonKey(name: 'num_received')
+ final int numReceived;
+ @override
+
+ /// Disable link previews. True or null.
+ @JsonKey(name: 'nopreview')
+ final bool nopreview;
+ @override
+
+ /// Has link previews. True or null. Readonly.
+ @JsonKey(name: 'has_previews')
+ final bool hasPreviews;
+ @override
+
+ /// Previous message id in this chat. Uid or null. Readonly.
+ @JsonKey(name: 'prev')
+ final String prev;
+ @override
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_first')
+ final bool isFirst;
+ @override
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_last')
+ final bool isLast;
+ @override
+
+ /// Message uploads.
+ @JsonKey(name: 'uploads')
+ final List uploads;
+ @override
+
+ /// Message reactions struct. Can be null. Readonly.
+ @JsonKey(name: 'reactions')
+ final List reactions;
+ @override
+
+ /// Message that was replied to, if any.
+ @JsonKey(name: 'reply_to')
+ final Message replyTo;
+ @override
+
+ /// Forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility.
+ @JsonKey(name: 'linked_messages')
+ final List linkedMessages;
+ @override
+
+ /// Has mention (@). True or null. Readonly.
+ @JsonKey(name: 'notice')
+ final bool notice;
+ @override
+
+ /// Message has no pushes and did not affect any counters. Readonly.
+ @JsonKey(name: 'silently')
+ final bool silently;
+ @override
+
+ /// Author can change this message until date. Can be null. Readonly.
+ @JsonKey(name: 'editable_until')
+ @DateTimeConverter()
+ final DateTime editableUntil;
+ @override
+
+ /// Index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted. Readonly.
+ @JsonKey(name: 'num')
+ final int num;
+ @override
+
+ /// Debug information, if any. Readonly.
+ @JsonKey(name: '_debug')
+ final String debug;
+
+ @override
+ String toString() {
+ return 'Message(content: $content, pushText: $pushText, from: $from, to: $to, messageId: $messageId, created: $created, drafted: $drafted, gentime: $gentime, chatType: $chatType, chat: $chat, links: $links, markup: $markup, important: $important, edited: $edited, received: $received, numReceived: $numReceived, nopreview: $nopreview, hasPreviews: $hasPreviews, prev: $prev, isFirst: $isFirst, isLast: $isLast, uploads: $uploads, reactions: $reactions, replyTo: $replyTo, linkedMessages: $linkedMessages, notice: $notice, silently: $silently, editableUntil: $editableUntil, num: $num, debug: $debug)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _Message &&
+ (identical(other.content, content) || const DeepCollectionEquality().equals(other.content, content)) &&
+ (identical(other.pushText, pushText) || const DeepCollectionEquality().equals(other.pushText, pushText)) &&
+ (identical(other.from, from) || const DeepCollectionEquality().equals(other.from, from)) &&
+ (identical(other.to, to) || const DeepCollectionEquality().equals(other.to, to)) &&
+ (identical(other.messageId, messageId) ||
+ const DeepCollectionEquality().equals(other.messageId, messageId)) &&
+ (identical(other.created, created) || const DeepCollectionEquality().equals(other.created, created)) &&
+ (identical(other.drafted, drafted) || const DeepCollectionEquality().equals(other.drafted, drafted)) &&
+ (identical(other.gentime, gentime) || const DeepCollectionEquality().equals(other.gentime, gentime)) &&
+ (identical(other.chatType, chatType) || const DeepCollectionEquality().equals(other.chatType, chatType)) &&
+ (identical(other.chat, chat) || const DeepCollectionEquality().equals(other.chat, chat)) &&
+ (identical(other.links, links) || const DeepCollectionEquality().equals(other.links, links)) &&
+ (identical(other.markup, markup) || const DeepCollectionEquality().equals(other.markup, markup)) &&
+ (identical(other.important, important) ||
+ const DeepCollectionEquality().equals(other.important, important)) &&
+ (identical(other.edited, edited) || const DeepCollectionEquality().equals(other.edited, edited)) &&
+ (identical(other.received, received) || const DeepCollectionEquality().equals(other.received, received)) &&
+ (identical(other.numReceived, numReceived) ||
+ const DeepCollectionEquality().equals(other.numReceived, numReceived)) &&
+ (identical(other.nopreview, nopreview) ||
+ const DeepCollectionEquality().equals(other.nopreview, nopreview)) &&
+ (identical(other.hasPreviews, hasPreviews) ||
+ const DeepCollectionEquality().equals(other.hasPreviews, hasPreviews)) &&
+ (identical(other.prev, prev) || const DeepCollectionEquality().equals(other.prev, prev)) &&
+ (identical(other.isFirst, isFirst) || const DeepCollectionEquality().equals(other.isFirst, isFirst)) &&
+ (identical(other.isLast, isLast) || const DeepCollectionEquality().equals(other.isLast, isLast)) &&
+ (identical(other.uploads, uploads) || const DeepCollectionEquality().equals(other.uploads, uploads)) &&
+ (identical(other.reactions, reactions) ||
+ const DeepCollectionEquality().equals(other.reactions, reactions)) &&
+ (identical(other.replyTo, replyTo) || const DeepCollectionEquality().equals(other.replyTo, replyTo)) &&
+ (identical(other.linkedMessages, linkedMessages) ||
+ const DeepCollectionEquality().equals(other.linkedMessages, linkedMessages)) &&
+ (identical(other.notice, notice) || const DeepCollectionEquality().equals(other.notice, notice)) &&
+ (identical(other.silently, silently) || const DeepCollectionEquality().equals(other.silently, silently)) &&
+ (identical(other.editableUntil, editableUntil) ||
+ const DeepCollectionEquality().equals(other.editableUntil, editableUntil)) &&
+ (identical(other.num, num) || const DeepCollectionEquality().equals(other.num, num)) &&
+ (identical(other.debug, debug) || const DeepCollectionEquality().equals(other.debug, debug)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(content) ^
+ const DeepCollectionEquality().hash(pushText) ^
+ const DeepCollectionEquality().hash(from) ^
+ const DeepCollectionEquality().hash(to) ^
+ const DeepCollectionEquality().hash(messageId) ^
+ const DeepCollectionEquality().hash(created) ^
+ const DeepCollectionEquality().hash(drafted) ^
+ const DeepCollectionEquality().hash(gentime) ^
+ const DeepCollectionEquality().hash(chatType) ^
+ const DeepCollectionEquality().hash(chat) ^
+ const DeepCollectionEquality().hash(links) ^
+ const DeepCollectionEquality().hash(markup) ^
+ const DeepCollectionEquality().hash(important) ^
+ const DeepCollectionEquality().hash(edited) ^
+ const DeepCollectionEquality().hash(received) ^
+ const DeepCollectionEquality().hash(numReceived) ^
+ const DeepCollectionEquality().hash(nopreview) ^
+ const DeepCollectionEquality().hash(hasPreviews) ^
+ const DeepCollectionEquality().hash(prev) ^
+ const DeepCollectionEquality().hash(isFirst) ^
+ const DeepCollectionEquality().hash(isLast) ^
+ const DeepCollectionEquality().hash(uploads) ^
+ const DeepCollectionEquality().hash(reactions) ^
+ const DeepCollectionEquality().hash(replyTo) ^
+ const DeepCollectionEquality().hash(linkedMessages) ^
+ const DeepCollectionEquality().hash(notice) ^
+ const DeepCollectionEquality().hash(silently) ^
+ const DeepCollectionEquality().hash(editableUntil) ^
+ const DeepCollectionEquality().hash(num) ^
+ const DeepCollectionEquality().hash(debug);
+
+ @override
+ _$MessageCopyWith<_Message> get copyWith => __$MessageCopyWithImpl<_Message>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageToJson(this);
+ }
+}
+
+abstract class _Message implements Message {
+ const factory _Message(
+ {@required @JsonKey(name: 'content') MessageContent content,
+ @JsonKey(name: 'push_text') String pushText,
+ @required @JsonKey(name: 'from') String from,
+ @required @JsonKey(name: 'to') String to,
+ @required @JsonKey(name: 'message_id') String messageId,
+ @required @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'drafted') @DateTimeConverter() DateTime drafted,
+ @required @JsonKey(name: 'gentime') int gentime,
+ @required @JsonKey(name: 'chat_type') ChatType chatType,
+ @required @JsonKey(name: 'chat') String chat,
+ @JsonKey(name: 'links') List links,
+ @JsonKey(name: 'markup') List markup,
+ @JsonKey(name: 'important') bool important,
+ @JsonKey(name: 'edited') @DateTimeConverter() DateTime edited,
+ @JsonKey(name: 'received') bool received,
+ @JsonKey(name: 'num_received') int numReceived,
+ @JsonKey(name: 'nopreview') bool nopreview,
+ @JsonKey(name: 'has_previews') bool hasPreviews,
+ @JsonKey(name: 'prev') String prev,
+ @JsonKey(name: 'is_first') bool isFirst,
+ @JsonKey(name: 'is_last') bool isLast,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'reactions') List reactions,
+ @JsonKey(name: 'reply_to') Message replyTo,
+ @JsonKey(name: 'linked_messages') List linkedMessages,
+ @JsonKey(name: 'notice') bool notice,
+ @JsonKey(name: 'silently') bool silently,
+ @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime editableUntil,
+ @JsonKey(name: 'num') int num,
+ @JsonKey(name: '_debug') String debug}) = _$_Message;
+
+ factory _Message.fromJson(Map json) = _$_Message.fromJson;
+
+ @override
+
+ /// Message content struct.
+ @JsonKey(name: 'content')
+ MessageContent get content;
+ @override
+
+ /// Simple plaintext message representation. Readonly.
+ @JsonKey(name: 'push_text')
+ String get pushText;
+ @override
+
+ /// Sender contact id. Readonly.
+ @JsonKey(name: 'from')
+ String get from;
+ @override
+
+ /// Recipient id (group, task or contact).
+ @JsonKey(name: 'to')
+ String get to;
+ @override
+
+ /// Message uid.
+ @JsonKey(name: 'message_id')
+ String get messageId;
+ @override
+
+ /// Message creation datetime (set by server side) or sending datetime in future for draft messages. Readonly.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ DateTime get created;
+ @override
+
+ /// Creation datetime for draft messages. Readonly.
+ @JsonKey(name: 'drafted')
+ @DateTimeConverter()
+ DateTime get drafted;
+ @override
+
+ /// Object version. Readonly.
+ @JsonKey(name: 'gentime')
+ int get gentime;
+ @override
+
+ /// Chat type. Readonly.
+ @JsonKey(name: 'chat_type')
+ ChatType get chatType;
+ @override
+
+ /// Chat id. Readonly.
+ @JsonKey(name: 'chat')
+ String get chat;
+ @override
+
+ /// External/internals links. Readonly.
+ @JsonKey(name: 'links')
+ List get links;
+ @override
+
+ /// Markup entities. Experimental. Readonly.
+ @JsonKey(name: 'markup')
+ List get markup;
+ @override
+
+ /// Importance flag.
+ @JsonKey(name: 'important')
+ bool get important;
+ @override
+
+ /// ISODateTimeString of message modification or deletion. Readonly.
+ @JsonKey(name: 'edited')
+ @DateTimeConverter()
+ DateTime get edited;
+ @override
+
+ /// Message was seen by anybody in chat. True or null. Readonly.
+ @JsonKey(name: 'received')
+ bool get received;
+ @override
+
+ /// Unused yet. Readonly.
+ @JsonKey(name: 'num_received')
+ int get numReceived;
+ @override
+
+ /// Disable link previews. True or null.
+ @JsonKey(name: 'nopreview')
+ bool get nopreview;
+ @override
+
+ /// Has link previews. True or null. Readonly.
+ @JsonKey(name: 'has_previews')
+ bool get hasPreviews;
+ @override
+
+ /// Previous message id in this chat. Uid or null. Readonly.
+ @JsonKey(name: 'prev')
+ String get prev;
+ @override
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_first')
+ bool get isFirst;
+ @override
+
+ /// This message is first in this chat. True or null. Readonly.
+ @JsonKey(name: 'is_last')
+ bool get isLast;
+ @override
+
+ /// Message uploads.
+ @JsonKey(name: 'uploads')
+ List get uploads;
+ @override
+
+ /// Message reactions struct. Can be null. Readonly.
+ @JsonKey(name: 'reactions')
+ List get reactions;
+ @override
+
+ /// Message that was replied to, if any.
+ @JsonKey(name: 'reply_to')
+ Message get replyTo;
+ @override
+
+ /// Forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility.
+ @JsonKey(name: 'linked_messages')
+ List get linkedMessages;
+ @override
+
+ /// Has mention (@). True or null. Readonly.
+ @JsonKey(name: 'notice')
+ bool get notice;
+ @override
+
+ /// Message has no pushes and did not affect any counters. Readonly.
+ @JsonKey(name: 'silently')
+ bool get silently;
+ @override
+
+ /// Author can change this message until date. Can be null. Readonly.
+ @JsonKey(name: 'editable_until')
+ @DateTimeConverter()
+ DateTime get editableUntil;
+ @override
+
+ /// Index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted. Readonly.
+ @JsonKey(name: 'num')
+ int get num;
+ @override
+
+ /// Debug information, if any. Readonly.
+ @JsonKey(name: '_debug')
+ String get debug;
+ @override
+ _$MessageCopyWith<_Message> get copyWith;
+}
diff --git a/lib/src/models/message/message.g.dart b/lib/src/models/message/message.g.dart
new file mode 100644
index 00000000..a2c4eac7
--- /dev/null
+++ b/lib/src/models/message/message.g.dart
@@ -0,0 +1,120 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_Message _$_$_MessageFromJson(Map json) {
+ return _$_Message(
+ content: json['content'] == null ? null : MessageContent.fromJson(json['content'] as Map),
+ pushText: json['push_text'] as String,
+ from: json['from'] as String,
+ to: json['to'] as String,
+ messageId: json['message_id'] as String,
+ created: const DateTimeConverter().fromJson(json['created'] as String),
+ drafted: const DateTimeConverter().fromJson(json['drafted'] as String),
+ gentime: json['gentime'] as int,
+ chatType: _$enumDecodeNullable(_$ChatTypeEnumMap, json['chat_type']),
+ chat: json['chat'] as String,
+ links: (json['links'] as List)
+ ?.map((e) => e == null ? null : MessageLink.fromJson(e as Map))
+ ?.toList(),
+ markup: (json['markup'] as List)
+ ?.map((e) => e == null ? null : MarkupEntity.fromJson(e as Map))
+ ?.toList(),
+ important: json['important'] as bool,
+ edited: const DateTimeConverter().fromJson(json['edited'] as String),
+ received: json['received'] as bool,
+ numReceived: json['num_received'] as int,
+ nopreview: json['nopreview'] as bool,
+ hasPreviews: json['has_previews'] as bool,
+ prev: json['prev'] as String,
+ isFirst: json['is_first'] as bool,
+ isLast: json['is_last'] as bool,
+ uploads:
+ (json['uploads'] as List)?.map((e) => e == null ? null : Upload.fromJson(e as Map))?.toList(),
+ reactions: (json['reactions'] as List)
+ ?.map((e) => e == null ? null : MessageReaction.fromJson(e as Map))
+ ?.toList(),
+ replyTo: json['reply_to'] == null ? null : Message.fromJson(json['reply_to'] as Map),
+ linkedMessages: (json['linked_messages'] as List)
+ ?.map((e) => e == null ? null : Message.fromJson(e as Map))
+ ?.toList(),
+ notice: json['notice'] as bool,
+ silently: json['silently'] as bool,
+ editableUntil: const DateTimeConverter().fromJson(json['editable_until'] as String),
+ num: json['num'] as int,
+ debug: json['_debug'] as String,
+ );
+}
+
+Map _$_$_MessageToJson(_$_Message instance) => {
+ 'content': instance.content?.toJson(),
+ 'push_text': instance.pushText,
+ 'from': instance.from,
+ 'to': instance.to,
+ 'message_id': instance.messageId,
+ 'created': const DateTimeConverter().toJson(instance.created),
+ 'drafted': const DateTimeConverter().toJson(instance.drafted),
+ 'gentime': instance.gentime,
+ 'chat_type': _$ChatTypeEnumMap[instance.chatType],
+ 'chat': instance.chat,
+ 'links': instance.links?.map((e) => e?.toJson())?.toList(),
+ 'markup': instance.markup?.map((e) => e?.toJson())?.toList(),
+ 'important': instance.important,
+ 'edited': const DateTimeConverter().toJson(instance.edited),
+ 'received': instance.received,
+ 'num_received': instance.numReceived,
+ 'nopreview': instance.nopreview,
+ 'has_previews': instance.hasPreviews,
+ 'prev': instance.prev,
+ 'is_first': instance.isFirst,
+ 'is_last': instance.isLast,
+ 'uploads': instance.uploads?.map((e) => e?.toJson())?.toList(),
+ 'reactions': instance.reactions?.map((e) => e?.toJson())?.toList(),
+ 'reply_to': instance.replyTo?.toJson(),
+ 'linked_messages': instance.linkedMessages?.map((e) => e?.toJson())?.toList(),
+ 'notice': instance.notice,
+ 'silently': instance.silently,
+ 'editable_until': const DateTimeConverter().toJson(instance.editableUntil),
+ 'num': instance.num,
+ '_debug': instance.debug,
+ };
+
+T _$enumDecode(
+ Map enumValues,
+ dynamic source, {
+ T unknownValue,
+}) {
+ if (source == null) {
+ throw ArgumentError('A value must be provided. Supported values: '
+ '${enumValues.values.join(', ')}');
+ }
+
+ final value = enumValues.entries.singleWhere((e) => e.value == source, orElse: () => null)?.key;
+
+ if (value == null && unknownValue == null) {
+ throw ArgumentError('`$source` is not one of the supported values: '
+ '${enumValues.values.join(', ')}');
+ }
+ return value ?? unknownValue;
+}
+
+T _$enumDecodeNullable(
+ Map enumValues,
+ dynamic source, {
+ T unknownValue,
+}) {
+ if (source == null) {
+ return null;
+ }
+ return _$enumDecode(enumValues, source, unknownValue: unknownValue);
+}
+
+const _$ChatTypeEnumMap = {
+ ChatType.direct: 'direct',
+ ChatType.group: 'group',
+ ChatType.task: 'task',
+};
diff --git a/lib/src/models/message_content/message_content.dart b/lib/src/models/message_content/message_content.dart
new file mode 100644
index 00000000..04332bdb
--- /dev/null
+++ b/lib/src/models/message_content/message_content.dart
@@ -0,0 +1,91 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'message_content.freezed.dart';
+part 'message_content.g.dart';
+
+/// Chat message content.
+@freezed
+abstract class MessageContent with _$MessageContent {
+ const factory MessageContent({
+ /// Text repesentation of message.
+ @JsonKey(name: 'text') @required String text,
+
+ /// Message type.
+ @JsonKey(name: 'type') @required MediaType type,
+
+ /// Message subtype, if any.
+ @JsonKey(name: 'subtype') MediaSubtype subtype,
+
+ /// Upload id, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') String upload,
+
+ /// Upload url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') String mediaUrl,
+
+ /// Upload size, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') int size,
+
+ /// Upload duration, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') int duration,
+
+ /// Upload stil processing, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') bool processing,
+
+ /// Upload preview height, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') int previewHeight,
+
+ /// Upload width, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') int previewWidth,
+
+ /// Upload preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') String previewUrl,
+
+ /// Upload high resolution preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') String preview2xUrl,
+
+ /// Upload name, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') String name,
+
+ /// Upload is animated image, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') bool animated,
+
+ /// Change title (for "change" mediatype).
+ @JsonKey(name: 'title') String title,
+
+ /// Change old value (for "change" mediatype).
+ @JsonKey(name: 'old') String old,
+
+ /// Change new value (for "change" mediatype).
+ @JsonKey(name: 'new') String newOne,
+
+ /// Change actor contact id (for "change" mediatype).
+ @JsonKey(name: 'actor') String actor,
+
+ /// Comment. For audimessage.
+ @JsonKey(name: 'comment') String comment,
+
+ /// Given name (for "contact" mediatype).
+ @JsonKey(name: 'given_name') String givenName,
+
+ /// Family name (for "contact" mediatype).
+ @JsonKey(name: 'family_name') String familyName,
+
+ /// Patronymic name (for "contact" mediatype).
+ @JsonKey(name: 'patronymic') String patronymic,
+
+ /// Contact phones list (for "contact" mediatype).
+ @JsonKey(name: 'phones') List phones,
+
+ /// Emails list (for "contact" mediatype).
+ @JsonKey(name: 'emails') List emails,
+
+ /// Stickerpack name (for "sticker" subtype).
+ @JsonKey(name: 'stickerpack') String stickerPack,
+
+ /// Pdf version, if any.
+ @JsonKey(name: 'pdf_version') PdfVersion pdfVersion,
+ }) = _MessageContent;
+
+ factory MessageContent.fromJson(Map json) => _$MessageContentFromJson(json);
+}
diff --git a/lib/src/models/message_content/message_content.freezed.dart b/lib/src/models/message_content/message_content.freezed.dart
new file mode 100644
index 00000000..055804b4
--- /dev/null
+++ b/lib/src/models/message_content/message_content.freezed.dart
@@ -0,0 +1,866 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message_content.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+MessageContent _$MessageContentFromJson(Map json) {
+ return _MessageContent.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageContentTearOff {
+ const _$MessageContentTearOff();
+
+// ignore: unused_element
+ _MessageContent call(
+ {@required @JsonKey(name: 'text') String text,
+ @required @JsonKey(name: 'type') MediaType type,
+ @JsonKey(name: 'subtype') MediaSubtype subtype,
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') String upload,
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') String mediaUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') int size,
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') int duration,
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') bool processing,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') int previewHeight,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') int previewWidth,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') String previewUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') String preview2xUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') String name,
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') bool animated,
+ @JsonKey(name: 'title') String title,
+ @JsonKey(name: 'old') String old,
+ @JsonKey(name: 'new') String newOne,
+ @JsonKey(name: 'actor') String actor,
+ @JsonKey(name: 'comment') String comment,
+ @JsonKey(name: 'given_name') String givenName,
+ @JsonKey(name: 'family_name') String familyName,
+ @JsonKey(name: 'patronymic') String patronymic,
+ @JsonKey(name: 'phones') List phones,
+ @JsonKey(name: 'emails') List emails,
+ @JsonKey(name: 'stickerpack') String stickerPack,
+ @JsonKey(name: 'pdf_version') PdfVersion pdfVersion}) {
+ return _MessageContent(
+ text: text,
+ type: type,
+ subtype: subtype,
+ upload: upload,
+ mediaUrl: mediaUrl,
+ size: size,
+ duration: duration,
+ processing: processing,
+ previewHeight: previewHeight,
+ previewWidth: previewWidth,
+ previewUrl: previewUrl,
+ preview2xUrl: preview2xUrl,
+ name: name,
+ animated: animated,
+ title: title,
+ old: old,
+ newOne: newOne,
+ actor: actor,
+ comment: comment,
+ givenName: givenName,
+ familyName: familyName,
+ patronymic: patronymic,
+ phones: phones,
+ emails: emails,
+ stickerPack: stickerPack,
+ pdfVersion: pdfVersion,
+ );
+ }
+
+// ignore: unused_element
+ MessageContent fromJson(Map json) {
+ return MessageContent.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $MessageContent = _$MessageContentTearOff();
+
+/// @nodoc
+mixin _$MessageContent {
+ /// Text repesentation of message.
+ @JsonKey(name: 'text')
+ String get text;
+
+ /// Message type.
+ @JsonKey(name: 'type')
+ MediaType get type;
+
+ /// Message subtype, if any.
+ @JsonKey(name: 'subtype')
+ MediaSubtype get subtype;
+
+ /// Upload id, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'upload')
+ String get upload;
+
+ /// Upload url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'mediaURL')
+ String get mediaUrl;
+
+ /// Upload size, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'size')
+ int get size;
+
+ /// Upload duration, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'duration')
+ int get duration;
+
+ /// Upload stil processing, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'processing')
+ bool get processing;
+
+ /// Upload preview height, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewHeight')
+ int get previewHeight;
+
+ /// Upload width, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewWidth')
+ int get previewWidth;
+
+ /// Upload preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewURL')
+ String get previewUrl;
+
+ /// Upload high resolution preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'preview2xURL')
+ String get preview2xUrl;
+
+ /// Upload name, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'name')
+ String get name;
+
+ /// Upload is animated image, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'animated')
+ bool get animated;
+
+ /// Change title (for "change" mediatype).
+ @JsonKey(name: 'title')
+ String get title;
+
+ /// Change old value (for "change" mediatype).
+ @JsonKey(name: 'old')
+ String get old;
+
+ /// Change new value (for "change" mediatype).
+ @JsonKey(name: 'new')
+ String get newOne;
+
+ /// Change actor contact id (for "change" mediatype).
+ @JsonKey(name: 'actor')
+ String get actor;
+
+ /// Comment. For audimessage.
+ @JsonKey(name: 'comment')
+ String get comment;
+
+ /// Given name (for "contact" mediatype).
+ @JsonKey(name: 'given_name')
+ String get givenName;
+
+ /// Family name (for "contact" mediatype).
+ @JsonKey(name: 'family_name')
+ String get familyName;
+
+ /// Patronymic name (for "contact" mediatype).
+ @JsonKey(name: 'patronymic')
+ String get patronymic;
+
+ /// Contact phones list (for "contact" mediatype).
+ @JsonKey(name: 'phones')
+ List get phones;
+
+ /// Emails list (for "contact" mediatype).
+ @JsonKey(name: 'emails')
+ List get emails;
+
+ /// Stickerpack name (for "sticker" subtype).
+ @JsonKey(name: 'stickerpack')
+ String get stickerPack;
+
+ /// Pdf version, if any.
+ @JsonKey(name: 'pdf_version')
+ PdfVersion get pdfVersion;
+
+ Map toJson();
+ $MessageContentCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageContentCopyWith<$Res> {
+ factory $MessageContentCopyWith(MessageContent value, $Res Function(MessageContent) then) =
+ _$MessageContentCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'text') String text,
+ @JsonKey(name: 'type') MediaType type,
+ @JsonKey(name: 'subtype') MediaSubtype subtype,
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') String upload,
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') String mediaUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') int size,
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') int duration,
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') bool processing,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') int previewHeight,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') int previewWidth,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') String previewUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') String preview2xUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') String name,
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') bool animated,
+ @JsonKey(name: 'title') String title,
+ @JsonKey(name: 'old') String old,
+ @JsonKey(name: 'new') String newOne,
+ @JsonKey(name: 'actor') String actor,
+ @JsonKey(name: 'comment') String comment,
+ @JsonKey(name: 'given_name') String givenName,
+ @JsonKey(name: 'family_name') String familyName,
+ @JsonKey(name: 'patronymic') String patronymic,
+ @JsonKey(name: 'phones') List phones,
+ @JsonKey(name: 'emails') List emails,
+ @JsonKey(name: 'stickerpack') String stickerPack,
+ @JsonKey(name: 'pdf_version') PdfVersion pdfVersion});
+
+ $PdfVersionCopyWith<$Res> get pdfVersion;
+}
+
+/// @nodoc
+class _$MessageContentCopyWithImpl<$Res> implements $MessageContentCopyWith<$Res> {
+ _$MessageContentCopyWithImpl(this._value, this._then);
+
+ final MessageContent _value;
+ // ignore: unused_field
+ final $Res Function(MessageContent) _then;
+
+ @override
+ $Res call({
+ Object text = freezed,
+ Object type = freezed,
+ Object subtype = freezed,
+ Object upload = freezed,
+ Object mediaUrl = freezed,
+ Object size = freezed,
+ Object duration = freezed,
+ Object processing = freezed,
+ Object previewHeight = freezed,
+ Object previewWidth = freezed,
+ Object previewUrl = freezed,
+ Object preview2xUrl = freezed,
+ Object name = freezed,
+ Object animated = freezed,
+ Object title = freezed,
+ Object old = freezed,
+ Object newOne = freezed,
+ Object actor = freezed,
+ Object comment = freezed,
+ Object givenName = freezed,
+ Object familyName = freezed,
+ Object patronymic = freezed,
+ Object phones = freezed,
+ Object emails = freezed,
+ Object stickerPack = freezed,
+ Object pdfVersion = freezed,
+ }) {
+ return _then(_value.copyWith(
+ text: text == freezed ? _value.text : text as String,
+ type: type == freezed ? _value.type : type as MediaType,
+ subtype: subtype == freezed ? _value.subtype : subtype as MediaSubtype,
+ upload: upload == freezed ? _value.upload : upload as String,
+ mediaUrl: mediaUrl == freezed ? _value.mediaUrl : mediaUrl as String,
+ size: size == freezed ? _value.size : size as int,
+ duration: duration == freezed ? _value.duration : duration as int,
+ processing: processing == freezed ? _value.processing : processing as bool,
+ previewHeight: previewHeight == freezed ? _value.previewHeight : previewHeight as int,
+ previewWidth: previewWidth == freezed ? _value.previewWidth : previewWidth as int,
+ previewUrl: previewUrl == freezed ? _value.previewUrl : previewUrl as String,
+ preview2xUrl: preview2xUrl == freezed ? _value.preview2xUrl : preview2xUrl as String,
+ name: name == freezed ? _value.name : name as String,
+ animated: animated == freezed ? _value.animated : animated as bool,
+ title: title == freezed ? _value.title : title as String,
+ old: old == freezed ? _value.old : old as String,
+ newOne: newOne == freezed ? _value.newOne : newOne as String,
+ actor: actor == freezed ? _value.actor : actor as String,
+ comment: comment == freezed ? _value.comment : comment as String,
+ givenName: givenName == freezed ? _value.givenName : givenName as String,
+ familyName: familyName == freezed ? _value.familyName : familyName as String,
+ patronymic: patronymic == freezed ? _value.patronymic : patronymic as String,
+ phones: phones == freezed ? _value.phones : phones as List,
+ emails: emails == freezed ? _value.emails : emails as List,
+ stickerPack: stickerPack == freezed ? _value.stickerPack : stickerPack as String,
+ pdfVersion: pdfVersion == freezed ? _value.pdfVersion : pdfVersion as PdfVersion,
+ ));
+ }
+
+ @override
+ $PdfVersionCopyWith<$Res> get pdfVersion {
+ if (_value.pdfVersion == null) {
+ return null;
+ }
+ return $PdfVersionCopyWith<$Res>(_value.pdfVersion, (value) {
+ return _then(_value.copyWith(pdfVersion: value));
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$MessageContentCopyWith<$Res> implements $MessageContentCopyWith<$Res> {
+ factory _$MessageContentCopyWith(_MessageContent value, $Res Function(_MessageContent) then) =
+ __$MessageContentCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'text') String text,
+ @JsonKey(name: 'type') MediaType type,
+ @JsonKey(name: 'subtype') MediaSubtype subtype,
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') String upload,
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') String mediaUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') int size,
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') int duration,
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') bool processing,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') int previewHeight,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') int previewWidth,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') String previewUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') String preview2xUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') String name,
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') bool animated,
+ @JsonKey(name: 'title') String title,
+ @JsonKey(name: 'old') String old,
+ @JsonKey(name: 'new') String newOne,
+ @JsonKey(name: 'actor') String actor,
+ @JsonKey(name: 'comment') String comment,
+ @JsonKey(name: 'given_name') String givenName,
+ @JsonKey(name: 'family_name') String familyName,
+ @JsonKey(name: 'patronymic') String patronymic,
+ @JsonKey(name: 'phones') List phones,
+ @JsonKey(name: 'emails') List emails,
+ @JsonKey(name: 'stickerpack') String stickerPack,
+ @JsonKey(name: 'pdf_version') PdfVersion pdfVersion});
+
+ @override
+ $PdfVersionCopyWith<$Res> get pdfVersion;
+}
+
+/// @nodoc
+class __$MessageContentCopyWithImpl<$Res> extends _$MessageContentCopyWithImpl<$Res>
+ implements _$MessageContentCopyWith<$Res> {
+ __$MessageContentCopyWithImpl(_MessageContent _value, $Res Function(_MessageContent) _then)
+ : super(_value, (v) => _then(v as _MessageContent));
+
+ @override
+ _MessageContent get _value => super._value as _MessageContent;
+
+ @override
+ $Res call({
+ Object text = freezed,
+ Object type = freezed,
+ Object subtype = freezed,
+ Object upload = freezed,
+ Object mediaUrl = freezed,
+ Object size = freezed,
+ Object duration = freezed,
+ Object processing = freezed,
+ Object previewHeight = freezed,
+ Object previewWidth = freezed,
+ Object previewUrl = freezed,
+ Object preview2xUrl = freezed,
+ Object name = freezed,
+ Object animated = freezed,
+ Object title = freezed,
+ Object old = freezed,
+ Object newOne = freezed,
+ Object actor = freezed,
+ Object comment = freezed,
+ Object givenName = freezed,
+ Object familyName = freezed,
+ Object patronymic = freezed,
+ Object phones = freezed,
+ Object emails = freezed,
+ Object stickerPack = freezed,
+ Object pdfVersion = freezed,
+ }) {
+ return _then(_MessageContent(
+ text: text == freezed ? _value.text : text as String,
+ type: type == freezed ? _value.type : type as MediaType,
+ subtype: subtype == freezed ? _value.subtype : subtype as MediaSubtype,
+ upload: upload == freezed ? _value.upload : upload as String,
+ mediaUrl: mediaUrl == freezed ? _value.mediaUrl : mediaUrl as String,
+ size: size == freezed ? _value.size : size as int,
+ duration: duration == freezed ? _value.duration : duration as int,
+ processing: processing == freezed ? _value.processing : processing as bool,
+ previewHeight: previewHeight == freezed ? _value.previewHeight : previewHeight as int,
+ previewWidth: previewWidth == freezed ? _value.previewWidth : previewWidth as int,
+ previewUrl: previewUrl == freezed ? _value.previewUrl : previewUrl as String,
+ preview2xUrl: preview2xUrl == freezed ? _value.preview2xUrl : preview2xUrl as String,
+ name: name == freezed ? _value.name : name as String,
+ animated: animated == freezed ? _value.animated : animated as bool,
+ title: title == freezed ? _value.title : title as String,
+ old: old == freezed ? _value.old : old as String,
+ newOne: newOne == freezed ? _value.newOne : newOne as String,
+ actor: actor == freezed ? _value.actor : actor as String,
+ comment: comment == freezed ? _value.comment : comment as String,
+ givenName: givenName == freezed ? _value.givenName : givenName as String,
+ familyName: familyName == freezed ? _value.familyName : familyName as String,
+ patronymic: patronymic == freezed ? _value.patronymic : patronymic as String,
+ phones: phones == freezed ? _value.phones : phones as List,
+ emails: emails == freezed ? _value.emails : emails as List,
+ stickerPack: stickerPack == freezed ? _value.stickerPack : stickerPack as String,
+ pdfVersion: pdfVersion == freezed ? _value.pdfVersion : pdfVersion as PdfVersion,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_MessageContent implements _MessageContent {
+ const _$_MessageContent(
+ {@required @JsonKey(name: 'text') this.text,
+ @required @JsonKey(name: 'type') this.type,
+ @JsonKey(name: 'subtype') this.subtype,
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') this.upload,
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') this.mediaUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') this.size,
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') this.duration,
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') this.processing,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') this.previewHeight,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') this.previewWidth,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') this.previewUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') this.preview2xUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') this.name,
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') this.animated,
+ @JsonKey(name: 'title') this.title,
+ @JsonKey(name: 'old') this.old,
+ @JsonKey(name: 'new') this.newOne,
+ @JsonKey(name: 'actor') this.actor,
+ @JsonKey(name: 'comment') this.comment,
+ @JsonKey(name: 'given_name') this.givenName,
+ @JsonKey(name: 'family_name') this.familyName,
+ @JsonKey(name: 'patronymic') this.patronymic,
+ @JsonKey(name: 'phones') this.phones,
+ @JsonKey(name: 'emails') this.emails,
+ @JsonKey(name: 'stickerpack') this.stickerPack,
+ @JsonKey(name: 'pdf_version') this.pdfVersion})
+ : assert(text != null),
+ assert(type != null);
+
+ factory _$_MessageContent.fromJson(Map json) => _$_$_MessageContentFromJson(json);
+
+ @override
+
+ /// Text repesentation of message.
+ @JsonKey(name: 'text')
+ final String text;
+ @override
+
+ /// Message type.
+ @JsonKey(name: 'type')
+ final MediaType type;
+ @override
+
+ /// Message subtype, if any.
+ @JsonKey(name: 'subtype')
+ final MediaSubtype subtype;
+ @override
+
+ /// Upload id, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'upload')
+ final String upload;
+ @override
+
+ /// Upload url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'mediaURL')
+ final String mediaUrl;
+ @override
+
+ /// Upload size, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'size')
+ final int size;
+ @override
+
+ /// Upload duration, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'duration')
+ final int duration;
+ @override
+
+ /// Upload stil processing, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'processing')
+ final bool processing;
+ @override
+
+ /// Upload preview height, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewHeight')
+ final int previewHeight;
+ @override
+
+ /// Upload width, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewWidth')
+ final int previewWidth;
+ @override
+
+ /// Upload preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewURL')
+ final String previewUrl;
+ @override
+
+ /// Upload high resolution preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'preview2xURL')
+ final String preview2xUrl;
+ @override
+
+ /// Upload name, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'name')
+ final String name;
+ @override
+
+ /// Upload is animated image, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'animated')
+ final bool animated;
+ @override
+
+ /// Change title (for "change" mediatype).
+ @JsonKey(name: 'title')
+ final String title;
+ @override
+
+ /// Change old value (for "change" mediatype).
+ @JsonKey(name: 'old')
+ final String old;
+ @override
+
+ /// Change new value (for "change" mediatype).
+ @JsonKey(name: 'new')
+ final String newOne;
+ @override
+
+ /// Change actor contact id (for "change" mediatype).
+ @JsonKey(name: 'actor')
+ final String actor;
+ @override
+
+ /// Comment. For audimessage.
+ @JsonKey(name: 'comment')
+ final String comment;
+ @override
+
+ /// Given name (for "contact" mediatype).
+ @JsonKey(name: 'given_name')
+ final String givenName;
+ @override
+
+ /// Family name (for "contact" mediatype).
+ @JsonKey(name: 'family_name')
+ final String familyName;
+ @override
+
+ /// Patronymic name (for "contact" mediatype).
+ @JsonKey(name: 'patronymic')
+ final String patronymic;
+ @override
+
+ /// Contact phones list (for "contact" mediatype).
+ @JsonKey(name: 'phones')
+ final List phones;
+ @override
+
+ /// Emails list (for "contact" mediatype).
+ @JsonKey(name: 'emails')
+ final List emails;
+ @override
+
+ /// Stickerpack name (for "sticker" subtype).
+ @JsonKey(name: 'stickerpack')
+ final String stickerPack;
+ @override
+
+ /// Pdf version, if any.
+ @JsonKey(name: 'pdf_version')
+ final PdfVersion pdfVersion;
+
+ @override
+ String toString() {
+ return 'MessageContent(text: $text, type: $type, subtype: $subtype, upload: $upload, mediaUrl: $mediaUrl, size: $size, duration: $duration, processing: $processing, previewHeight: $previewHeight, previewWidth: $previewWidth, previewUrl: $previewUrl, preview2xUrl: $preview2xUrl, name: $name, animated: $animated, title: $title, old: $old, newOne: $newOne, actor: $actor, comment: $comment, givenName: $givenName, familyName: $familyName, patronymic: $patronymic, phones: $phones, emails: $emails, stickerPack: $stickerPack, pdfVersion: $pdfVersion)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _MessageContent &&
+ (identical(other.text, text) || const DeepCollectionEquality().equals(other.text, text)) &&
+ (identical(other.type, type) || const DeepCollectionEquality().equals(other.type, type)) &&
+ (identical(other.subtype, subtype) || const DeepCollectionEquality().equals(other.subtype, subtype)) &&
+ (identical(other.upload, upload) || const DeepCollectionEquality().equals(other.upload, upload)) &&
+ (identical(other.mediaUrl, mediaUrl) || const DeepCollectionEquality().equals(other.mediaUrl, mediaUrl)) &&
+ (identical(other.size, size) || const DeepCollectionEquality().equals(other.size, size)) &&
+ (identical(other.duration, duration) || const DeepCollectionEquality().equals(other.duration, duration)) &&
+ (identical(other.processing, processing) ||
+ const DeepCollectionEquality().equals(other.processing, processing)) &&
+ (identical(other.previewHeight, previewHeight) ||
+ const DeepCollectionEquality().equals(other.previewHeight, previewHeight)) &&
+ (identical(other.previewWidth, previewWidth) ||
+ const DeepCollectionEquality().equals(other.previewWidth, previewWidth)) &&
+ (identical(other.previewUrl, previewUrl) ||
+ const DeepCollectionEquality().equals(other.previewUrl, previewUrl)) &&
+ (identical(other.preview2xUrl, preview2xUrl) ||
+ const DeepCollectionEquality().equals(other.preview2xUrl, preview2xUrl)) &&
+ (identical(other.name, name) || const DeepCollectionEquality().equals(other.name, name)) &&
+ (identical(other.animated, animated) || const DeepCollectionEquality().equals(other.animated, animated)) &&
+ (identical(other.title, title) || const DeepCollectionEquality().equals(other.title, title)) &&
+ (identical(other.old, old) || const DeepCollectionEquality().equals(other.old, old)) &&
+ (identical(other.newOne, newOne) || const DeepCollectionEquality().equals(other.newOne, newOne)) &&
+ (identical(other.actor, actor) || const DeepCollectionEquality().equals(other.actor, actor)) &&
+ (identical(other.comment, comment) || const DeepCollectionEquality().equals(other.comment, comment)) &&
+ (identical(other.givenName, givenName) ||
+ const DeepCollectionEquality().equals(other.givenName, givenName)) &&
+ (identical(other.familyName, familyName) ||
+ const DeepCollectionEquality().equals(other.familyName, familyName)) &&
+ (identical(other.patronymic, patronymic) ||
+ const DeepCollectionEquality().equals(other.patronymic, patronymic)) &&
+ (identical(other.phones, phones) || const DeepCollectionEquality().equals(other.phones, phones)) &&
+ (identical(other.emails, emails) || const DeepCollectionEquality().equals(other.emails, emails)) &&
+ (identical(other.stickerPack, stickerPack) ||
+ const DeepCollectionEquality().equals(other.stickerPack, stickerPack)) &&
+ (identical(other.pdfVersion, pdfVersion) ||
+ const DeepCollectionEquality().equals(other.pdfVersion, pdfVersion)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(text) ^
+ const DeepCollectionEquality().hash(type) ^
+ const DeepCollectionEquality().hash(subtype) ^
+ const DeepCollectionEquality().hash(upload) ^
+ const DeepCollectionEquality().hash(mediaUrl) ^
+ const DeepCollectionEquality().hash(size) ^
+ const DeepCollectionEquality().hash(duration) ^
+ const DeepCollectionEquality().hash(processing) ^
+ const DeepCollectionEquality().hash(previewHeight) ^
+ const DeepCollectionEquality().hash(previewWidth) ^
+ const DeepCollectionEquality().hash(previewUrl) ^
+ const DeepCollectionEquality().hash(preview2xUrl) ^
+ const DeepCollectionEquality().hash(name) ^
+ const DeepCollectionEquality().hash(animated) ^
+ const DeepCollectionEquality().hash(title) ^
+ const DeepCollectionEquality().hash(old) ^
+ const DeepCollectionEquality().hash(newOne) ^
+ const DeepCollectionEquality().hash(actor) ^
+ const DeepCollectionEquality().hash(comment) ^
+ const DeepCollectionEquality().hash(givenName) ^
+ const DeepCollectionEquality().hash(familyName) ^
+ const DeepCollectionEquality().hash(patronymic) ^
+ const DeepCollectionEquality().hash(phones) ^
+ const DeepCollectionEquality().hash(emails) ^
+ const DeepCollectionEquality().hash(stickerPack) ^
+ const DeepCollectionEquality().hash(pdfVersion);
+
+ @override
+ _$MessageContentCopyWith<_MessageContent> get copyWith =>
+ __$MessageContentCopyWithImpl<_MessageContent>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageContentToJson(this);
+ }
+}
+
+abstract class _MessageContent implements MessageContent {
+ const factory _MessageContent(
+ {@required @JsonKey(name: 'text') String text,
+ @required @JsonKey(name: 'type') MediaType type,
+ @JsonKey(name: 'subtype') MediaSubtype subtype,
+ @Deprecated('use uploads instead') @JsonKey(name: 'upload') String upload,
+ @Deprecated('use uploads instead') @JsonKey(name: 'mediaURL') String mediaUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'size') int size,
+ @Deprecated('use uploads instead') @JsonKey(name: 'duration') int duration,
+ @Deprecated('use uploads instead') @JsonKey(name: 'processing') bool processing,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewHeight') int previewHeight,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewWidth') int previewWidth,
+ @Deprecated('use uploads instead') @JsonKey(name: 'previewURL') String previewUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'preview2xURL') String preview2xUrl,
+ @Deprecated('use uploads instead') @JsonKey(name: 'name') String name,
+ @Deprecated('use uploads instead') @JsonKey(name: 'animated') bool animated,
+ @JsonKey(name: 'title') String title,
+ @JsonKey(name: 'old') String old,
+ @JsonKey(name: 'new') String newOne,
+ @JsonKey(name: 'actor') String actor,
+ @JsonKey(name: 'comment') String comment,
+ @JsonKey(name: 'given_name') String givenName,
+ @JsonKey(name: 'family_name') String familyName,
+ @JsonKey(name: 'patronymic') String patronymic,
+ @JsonKey(name: 'phones') List phones,
+ @JsonKey(name: 'emails') List emails,
+ @JsonKey(name: 'stickerpack') String stickerPack,
+ @JsonKey(name: 'pdf_version') PdfVersion pdfVersion}) = _$_MessageContent;
+
+ factory _MessageContent.fromJson(Map json) = _$_MessageContent.fromJson;
+
+ @override
+
+ /// Text repesentation of message.
+ @JsonKey(name: 'text')
+ String get text;
+ @override
+
+ /// Message type.
+ @JsonKey(name: 'type')
+ MediaType get type;
+ @override
+
+ /// Message subtype, if any.
+ @JsonKey(name: 'subtype')
+ MediaSubtype get subtype;
+ @override
+
+ /// Upload id, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'upload')
+ String get upload;
+ @override
+
+ /// Upload url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'mediaURL')
+ String get mediaUrl;
+ @override
+
+ /// Upload size, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'size')
+ int get size;
+ @override
+
+ /// Upload duration, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'duration')
+ int get duration;
+ @override
+
+ /// Upload stil processing, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'processing')
+ bool get processing;
+ @override
+
+ /// Upload preview height, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewHeight')
+ int get previewHeight;
+ @override
+
+ /// Upload width, in pixels, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewWidth')
+ int get previewWidth;
+ @override
+
+ /// Upload preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'previewURL')
+ String get previewUrl;
+ @override
+
+ /// Upload high resolution preview absolute url, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'preview2xURL')
+ String get preview2xUrl;
+ @override
+
+ /// Upload name, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'name')
+ String get name;
+ @override
+
+ /// Upload is animated image, if any. Depreacted: use Uploads instead.
+ @Deprecated('use uploads instead')
+ @JsonKey(name: 'animated')
+ bool get animated;
+ @override
+
+ /// Change title (for "change" mediatype).
+ @JsonKey(name: 'title')
+ String get title;
+ @override
+
+ /// Change old value (for "change" mediatype).
+ @JsonKey(name: 'old')
+ String get old;
+ @override
+
+ /// Change new value (for "change" mediatype).
+ @JsonKey(name: 'new')
+ String get newOne;
+ @override
+
+ /// Change actor contact id (for "change" mediatype).
+ @JsonKey(name: 'actor')
+ String get actor;
+ @override
+
+ /// Comment. For audimessage.
+ @JsonKey(name: 'comment')
+ String get comment;
+ @override
+
+ /// Given name (for "contact" mediatype).
+ @JsonKey(name: 'given_name')
+ String get givenName;
+ @override
+
+ /// Family name (for "contact" mediatype).
+ @JsonKey(name: 'family_name')
+ String get familyName;
+ @override
+
+ /// Patronymic name (for "contact" mediatype).
+ @JsonKey(name: 'patronymic')
+ String get patronymic;
+ @override
+
+ /// Contact phones list (for "contact" mediatype).
+ @JsonKey(name: 'phones')
+ List get phones;
+ @override
+
+ /// Emails list (for "contact" mediatype).
+ @JsonKey(name: 'emails')
+ List get emails;
+ @override
+
+ /// Stickerpack name (for "sticker" subtype).
+ @JsonKey(name: 'stickerpack')
+ String get stickerPack;
+ @override
+
+ /// Pdf version, if any.
+ @JsonKey(name: 'pdf_version')
+ PdfVersion get pdfVersion;
+ @override
+ _$MessageContentCopyWith<_MessageContent> get copyWith;
+}
diff --git a/lib/src/models/message_content/message_content.g.dart b/lib/src/models/message_content/message_content.g.dart
new file mode 100644
index 00000000..d36eb65b
--- /dev/null
+++ b/lib/src/models/message_content/message_content.g.dart
@@ -0,0 +1,115 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message_content.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_MessageContent _$_$_MessageContentFromJson(Map json) {
+ return _$_MessageContent(
+ text: json['text'] as String,
+ type: _$enumDecodeNullable(_$MediaTypeEnumMap, json['type']),
+ subtype: _$enumDecodeNullable(_$MediaSubtypeEnumMap, json['subtype']),
+ upload: json['upload'] as String,
+ mediaUrl: json['mediaURL'] as String,
+ size: json['size'] as int,
+ duration: json['duration'] as int,
+ processing: json['processing'] as bool,
+ previewHeight: json['previewHeight'] as int,
+ previewWidth: json['previewWidth'] as int,
+ previewUrl: json['previewURL'] as String,
+ preview2xUrl: json['preview2xURL'] as String,
+ name: json['name'] as String,
+ animated: json['animated'] as bool,
+ title: json['title'] as String,
+ old: json['old'] as String,
+ newOne: json['new'] as String,
+ actor: json['actor'] as String,
+ comment: json['comment'] as String,
+ givenName: json['given_name'] as String,
+ familyName: json['family_name'] as String,
+ patronymic: json['patronymic'] as String,
+ phones: (json['phones'] as List)?.map((e) => e as String)?.toList(),
+ emails: (json['emails'] as List)?.map((e) => e as String)?.toList(),
+ stickerPack: json['stickerpack'] as String,
+ pdfVersion: json['pdf_version'] == null ? null : PdfVersion.fromJson(json['pdf_version'] as Map),
+ );
+}
+
+Map _$_$_MessageContentToJson(_$_MessageContent instance) => {
+ 'text': instance.text,
+ 'type': _$MediaTypeEnumMap[instance.type],
+ 'subtype': _$MediaSubtypeEnumMap[instance.subtype],
+ 'upload': instance.upload,
+ 'mediaURL': instance.mediaUrl,
+ 'size': instance.size,
+ 'duration': instance.duration,
+ 'processing': instance.processing,
+ 'previewHeight': instance.previewHeight,
+ 'previewWidth': instance.previewWidth,
+ 'previewURL': instance.previewUrl,
+ 'preview2xURL': instance.preview2xUrl,
+ 'name': instance.name,
+ 'animated': instance.animated,
+ 'title': instance.title,
+ 'old': instance.old,
+ 'new': instance.newOne,
+ 'actor': instance.actor,
+ 'comment': instance.comment,
+ 'given_name': instance.givenName,
+ 'family_name': instance.familyName,
+ 'patronymic': instance.patronymic,
+ 'phones': instance.phones,
+ 'emails': instance.emails,
+ 'stickerpack': instance.stickerPack,
+ 'pdf_version': instance.pdfVersion?.toJson(),
+ };
+
+T _$enumDecode(
+ Map enumValues,
+ dynamic source, {
+ T unknownValue,
+}) {
+ if (source == null) {
+ throw ArgumentError('A value must be provided. Supported values: '
+ '${enumValues.values.join(', ')}');
+ }
+
+ final value = enumValues.entries.singleWhere((e) => e.value == source, orElse: () => null)?.key;
+
+ if (value == null && unknownValue == null) {
+ throw ArgumentError('`$source` is not one of the supported values: '
+ '${enumValues.values.join(', ')}');
+ }
+ return value ?? unknownValue;
+}
+
+T _$enumDecodeNullable(
+ Map enumValues,
+ dynamic source, {
+ T unknownValue,
+}) {
+ if (source == null) {
+ return null;
+ }
+ return _$enumDecode(enumValues, source, unknownValue: unknownValue);
+}
+
+const _$MediaTypeEnumMap = {
+ MediaType.plain: 'plain',
+ MediaType.change: 'change',
+ MediaType.deleted: 'deleted',
+ MediaType.file: 'file',
+ MediaType.image: 'image',
+ MediaType.video: 'video',
+ MediaType.audiomsg: 'audiomsg',
+ MediaType.contact: 'contact',
+ MediaType.pdf: 'pdf',
+};
+
+const _$MediaSubtypeEnumMap = {
+ MediaSubtype.sticker: 'sticker',
+ MediaSubtype.newtask: 'newtask',
+ MediaSubtype.none: 'none',
+};
diff --git a/lib/src/models/message_link/message_link.dart b/lib/src/models/message_link/message_link.dart
new file mode 100644
index 00000000..eed1c580
--- /dev/null
+++ b/lib/src/models/message_link/message_link.dart
@@ -0,0 +1,34 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'message_link.freezed.dart';
+part 'message_link.g.dart';
+
+/// Checked message links. In short: "Click here: {link.Pattern}" => "Click here: {link.Text}"
+@freezed
+abstract class MessageLink with _$MessageLink {
+ const factory MessageLink({
+ /// Text fragment that should be replaced by link.
+ @JsonKey(name: 'pattern') @required String pattern,
+
+ /// Internal (tadateam://) or external link.
+ @JsonKey(name: 'url') @required String url,
+
+ /// Text replacement.
+ @JsonKey(name: 'text') @required String text,
+
+ /// Optional preview info, for websites.
+ @JsonKey(name: 'preview') MessageLinkPreview preview,
+
+ /// Optional upload info.
+ @JsonKey(name: 'uploads') List uploads,
+
+ /// Website previews disabled.
+ @JsonKey(name: 'nopreview') bool noPreview,
+
+ /// Optional youtube movie id.
+ @JsonKey(name: 'youtube_id') String youtubeId,
+ }) = _MessageLink;
+
+ factory MessageLink.fromJson(Map json) => _$MessageLinkFromJson(json);
+}
diff --git a/lib/src/models/message_link/message_link.freezed.dart b/lib/src/models/message_link/message_link.freezed.dart
new file mode 100644
index 00000000..93255870
--- /dev/null
+++ b/lib/src/models/message_link/message_link.freezed.dart
@@ -0,0 +1,329 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message_link.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+MessageLink _$MessageLinkFromJson(Map json) {
+ return _MessageLink.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageLinkTearOff {
+ const _$MessageLinkTearOff();
+
+// ignore: unused_element
+ _MessageLink call(
+ {@required @JsonKey(name: 'pattern') String pattern,
+ @required @JsonKey(name: 'url') String url,
+ @required @JsonKey(name: 'text') String text,
+ @JsonKey(name: 'preview') MessageLinkPreview preview,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'nopreview') bool noPreview,
+ @JsonKey(name: 'youtube_id') String youtubeId}) {
+ return _MessageLink(
+ pattern: pattern,
+ url: url,
+ text: text,
+ preview: preview,
+ uploads: uploads,
+ noPreview: noPreview,
+ youtubeId: youtubeId,
+ );
+ }
+
+// ignore: unused_element
+ MessageLink fromJson(Map json) {
+ return MessageLink.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $MessageLink = _$MessageLinkTearOff();
+
+/// @nodoc
+mixin _$MessageLink {
+ /// Text fragment that should be replaced by link.
+ @JsonKey(name: 'pattern')
+ String get pattern;
+
+ /// Internal (tadateam://) or external link.
+ @JsonKey(name: 'url')
+ String get url;
+
+ /// Text replacement.
+ @JsonKey(name: 'text')
+ String get text;
+
+ /// Optional preview info, for websites.
+ @JsonKey(name: 'preview')
+ MessageLinkPreview get preview;
+
+ /// Optional upload info.
+ @JsonKey(name: 'uploads')
+ List get uploads;
+
+ /// Website previews disabled.
+ @JsonKey(name: 'nopreview')
+ bool get noPreview;
+
+ /// Optional youtube movie id.
+ @JsonKey(name: 'youtube_id')
+ String get youtubeId;
+
+ Map toJson();
+ $MessageLinkCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageLinkCopyWith<$Res> {
+ factory $MessageLinkCopyWith(MessageLink value, $Res Function(MessageLink) then) = _$MessageLinkCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'pattern') String pattern,
+ @JsonKey(name: 'url') String url,
+ @JsonKey(name: 'text') String text,
+ @JsonKey(name: 'preview') MessageLinkPreview preview,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'nopreview') bool noPreview,
+ @JsonKey(name: 'youtube_id') String youtubeId});
+
+ $MessageLinkPreviewCopyWith<$Res> get preview;
+}
+
+/// @nodoc
+class _$MessageLinkCopyWithImpl<$Res> implements $MessageLinkCopyWith<$Res> {
+ _$MessageLinkCopyWithImpl(this._value, this._then);
+
+ final MessageLink _value;
+ // ignore: unused_field
+ final $Res Function(MessageLink) _then;
+
+ @override
+ $Res call({
+ Object pattern = freezed,
+ Object url = freezed,
+ Object text = freezed,
+ Object preview = freezed,
+ Object uploads = freezed,
+ Object noPreview = freezed,
+ Object youtubeId = freezed,
+ }) {
+ return _then(_value.copyWith(
+ pattern: pattern == freezed ? _value.pattern : pattern as String,
+ url: url == freezed ? _value.url : url as String,
+ text: text == freezed ? _value.text : text as String,
+ preview: preview == freezed ? _value.preview : preview as MessageLinkPreview,
+ uploads: uploads == freezed ? _value.uploads : uploads as List,
+ noPreview: noPreview == freezed ? _value.noPreview : noPreview as bool,
+ youtubeId: youtubeId == freezed ? _value.youtubeId : youtubeId as String,
+ ));
+ }
+
+ @override
+ $MessageLinkPreviewCopyWith<$Res> get preview {
+ if (_value.preview == null) {
+ return null;
+ }
+ return $MessageLinkPreviewCopyWith<$Res>(_value.preview, (value) {
+ return _then(_value.copyWith(preview: value));
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$MessageLinkCopyWith<$Res> implements $MessageLinkCopyWith<$Res> {
+ factory _$MessageLinkCopyWith(_MessageLink value, $Res Function(_MessageLink) then) =
+ __$MessageLinkCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'pattern') String pattern,
+ @JsonKey(name: 'url') String url,
+ @JsonKey(name: 'text') String text,
+ @JsonKey(name: 'preview') MessageLinkPreview preview,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'nopreview') bool noPreview,
+ @JsonKey(name: 'youtube_id') String youtubeId});
+
+ @override
+ $MessageLinkPreviewCopyWith<$Res> get preview;
+}
+
+/// @nodoc
+class __$MessageLinkCopyWithImpl<$Res> extends _$MessageLinkCopyWithImpl<$Res> implements _$MessageLinkCopyWith<$Res> {
+ __$MessageLinkCopyWithImpl(_MessageLink _value, $Res Function(_MessageLink) _then)
+ : super(_value, (v) => _then(v as _MessageLink));
+
+ @override
+ _MessageLink get _value => super._value as _MessageLink;
+
+ @override
+ $Res call({
+ Object pattern = freezed,
+ Object url = freezed,
+ Object text = freezed,
+ Object preview = freezed,
+ Object uploads = freezed,
+ Object noPreview = freezed,
+ Object youtubeId = freezed,
+ }) {
+ return _then(_MessageLink(
+ pattern: pattern == freezed ? _value.pattern : pattern as String,
+ url: url == freezed ? _value.url : url as String,
+ text: text == freezed ? _value.text : text as String,
+ preview: preview == freezed ? _value.preview : preview as MessageLinkPreview,
+ uploads: uploads == freezed ? _value.uploads : uploads as List,
+ noPreview: noPreview == freezed ? _value.noPreview : noPreview as bool,
+ youtubeId: youtubeId == freezed ? _value.youtubeId : youtubeId as String,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_MessageLink implements _MessageLink {
+ const _$_MessageLink(
+ {@required @JsonKey(name: 'pattern') this.pattern,
+ @required @JsonKey(name: 'url') this.url,
+ @required @JsonKey(name: 'text') this.text,
+ @JsonKey(name: 'preview') this.preview,
+ @JsonKey(name: 'uploads') this.uploads,
+ @JsonKey(name: 'nopreview') this.noPreview,
+ @JsonKey(name: 'youtube_id') this.youtubeId})
+ : assert(pattern != null),
+ assert(url != null),
+ assert(text != null);
+
+ factory _$_MessageLink.fromJson(Map json) => _$_$_MessageLinkFromJson(json);
+
+ @override
+
+ /// Text fragment that should be replaced by link.
+ @JsonKey(name: 'pattern')
+ final String pattern;
+ @override
+
+ /// Internal (tadateam://) or external link.
+ @JsonKey(name: 'url')
+ final String url;
+ @override
+
+ /// Text replacement.
+ @JsonKey(name: 'text')
+ final String text;
+ @override
+
+ /// Optional preview info, for websites.
+ @JsonKey(name: 'preview')
+ final MessageLinkPreview preview;
+ @override
+
+ /// Optional upload info.
+ @JsonKey(name: 'uploads')
+ final List uploads;
+ @override
+
+ /// Website previews disabled.
+ @JsonKey(name: 'nopreview')
+ final bool noPreview;
+ @override
+
+ /// Optional youtube movie id.
+ @JsonKey(name: 'youtube_id')
+ final String youtubeId;
+
+ @override
+ String toString() {
+ return 'MessageLink(pattern: $pattern, url: $url, text: $text, preview: $preview, uploads: $uploads, noPreview: $noPreview, youtubeId: $youtubeId)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _MessageLink &&
+ (identical(other.pattern, pattern) || const DeepCollectionEquality().equals(other.pattern, pattern)) &&
+ (identical(other.url, url) || const DeepCollectionEquality().equals(other.url, url)) &&
+ (identical(other.text, text) || const DeepCollectionEquality().equals(other.text, text)) &&
+ (identical(other.preview, preview) || const DeepCollectionEquality().equals(other.preview, preview)) &&
+ (identical(other.uploads, uploads) || const DeepCollectionEquality().equals(other.uploads, uploads)) &&
+ (identical(other.noPreview, noPreview) ||
+ const DeepCollectionEquality().equals(other.noPreview, noPreview)) &&
+ (identical(other.youtubeId, youtubeId) ||
+ const DeepCollectionEquality().equals(other.youtubeId, youtubeId)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(pattern) ^
+ const DeepCollectionEquality().hash(url) ^
+ const DeepCollectionEquality().hash(text) ^
+ const DeepCollectionEquality().hash(preview) ^
+ const DeepCollectionEquality().hash(uploads) ^
+ const DeepCollectionEquality().hash(noPreview) ^
+ const DeepCollectionEquality().hash(youtubeId);
+
+ @override
+ _$MessageLinkCopyWith<_MessageLink> get copyWith => __$MessageLinkCopyWithImpl<_MessageLink>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageLinkToJson(this);
+ }
+}
+
+abstract class _MessageLink implements MessageLink {
+ const factory _MessageLink(
+ {@required @JsonKey(name: 'pattern') String pattern,
+ @required @JsonKey(name: 'url') String url,
+ @required @JsonKey(name: 'text') String text,
+ @JsonKey(name: 'preview') MessageLinkPreview preview,
+ @JsonKey(name: 'uploads') List uploads,
+ @JsonKey(name: 'nopreview') bool noPreview,
+ @JsonKey(name: 'youtube_id') String youtubeId}) = _$_MessageLink;
+
+ factory _MessageLink.fromJson(Map json) = _$_MessageLink.fromJson;
+
+ @override
+
+ /// Text fragment that should be replaced by link.
+ @JsonKey(name: 'pattern')
+ String get pattern;
+ @override
+
+ /// Internal (tadateam://) or external link.
+ @JsonKey(name: 'url')
+ String get url;
+ @override
+
+ /// Text replacement.
+ @JsonKey(name: 'text')
+ String get text;
+ @override
+
+ /// Optional preview info, for websites.
+ @JsonKey(name: 'preview')
+ MessageLinkPreview get preview;
+ @override
+
+ /// Optional upload info.
+ @JsonKey(name: 'uploads')
+ List get uploads;
+ @override
+
+ /// Website previews disabled.
+ @JsonKey(name: 'nopreview')
+ bool get noPreview;
+ @override
+
+ /// Optional youtube movie id.
+ @JsonKey(name: 'youtube_id')
+ String get youtubeId;
+ @override
+ _$MessageLinkCopyWith<_MessageLink> get copyWith;
+}
diff --git a/lib/src/models/message_link/message_link.g.dart b/lib/src/models/message_link/message_link.g.dart
new file mode 100644
index 00000000..472c35f1
--- /dev/null
+++ b/lib/src/models/message_link/message_link.g.dart
@@ -0,0 +1,30 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message_link.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_MessageLink _$_$_MessageLinkFromJson(Map json) {
+ return _$_MessageLink(
+ pattern: json['pattern'] as String,
+ url: json['url'] as String,
+ text: json['text'] as String,
+ preview: json['preview'] == null ? null : MessageLinkPreview.fromJson(json['preview'] as Map),
+ uploads:
+ (json['uploads'] as List)?.map((e) => e == null ? null : Upload.fromJson(e as Map))?.toList(),
+ noPreview: json['nopreview'] as bool,
+ youtubeId: json['youtube_id'] as String,
+ );
+}
+
+Map _$_$_MessageLinkToJson(_$_MessageLink instance) => {
+ 'pattern': instance.pattern,
+ 'url': instance.url,
+ 'text': instance.text,
+ 'preview': instance.preview?.toJson(),
+ 'uploads': instance.uploads?.map((e) => e?.toJson())?.toList(),
+ 'nopreview': instance.noPreview,
+ 'youtube_id': instance.youtubeId,
+ };
diff --git a/lib/src/models/message_link_preview/message_link_preview.dart b/lib/src/models/message_link_preview/message_link_preview.dart
new file mode 100644
index 00000000..469b5ec2
--- /dev/null
+++ b/lib/src/models/message_link_preview/message_link_preview.dart
@@ -0,0 +1,18 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'message_link_preview.freezed.dart';
+part 'message_link_preview.g.dart';
+
+/// Website title and description
+@freezed
+abstract class MessageLinkPreview with _$MessageLinkPreview {
+ const factory MessageLinkPreview({
+ /// Website title or og:title content.
+ @JsonKey(name: 'title') @required String title,
+
+ /// Website description.
+ @JsonKey(name: 'description') String description,
+ }) = _MessageLinkPreview;
+
+ factory MessageLinkPreview.fromJson(Map json) => _$MessageLinkPreviewFromJson(json);
+}
diff --git a/lib/src/models/message_link_preview/message_link_preview.freezed.dart b/lib/src/models/message_link_preview/message_link_preview.freezed.dart
new file mode 100644
index 00000000..97b8c134
--- /dev/null
+++ b/lib/src/models/message_link_preview/message_link_preview.freezed.dart
@@ -0,0 +1,178 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message_link_preview.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+MessageLinkPreview _$MessageLinkPreviewFromJson(Map json) {
+ return _MessageLinkPreview.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageLinkPreviewTearOff {
+ const _$MessageLinkPreviewTearOff();
+
+// ignore: unused_element
+ _MessageLinkPreview call(
+ {@required @JsonKey(name: 'title') String title, @JsonKey(name: 'description') String description}) {
+ return _MessageLinkPreview(
+ title: title,
+ description: description,
+ );
+ }
+
+// ignore: unused_element
+ MessageLinkPreview fromJson(Map json) {
+ return MessageLinkPreview.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $MessageLinkPreview = _$MessageLinkPreviewTearOff();
+
+/// @nodoc
+mixin _$MessageLinkPreview {
+ /// Website title or og:title content.
+ @JsonKey(name: 'title')
+ String get title;
+
+ /// Website description.
+ @JsonKey(name: 'description')
+ String get description;
+
+ Map toJson();
+ $MessageLinkPreviewCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageLinkPreviewCopyWith<$Res> {
+ factory $MessageLinkPreviewCopyWith(MessageLinkPreview value, $Res Function(MessageLinkPreview) then) =
+ _$MessageLinkPreviewCopyWithImpl<$Res>;
+ $Res call({@JsonKey(name: 'title') String title, @JsonKey(name: 'description') String description});
+}
+
+/// @nodoc
+class _$MessageLinkPreviewCopyWithImpl<$Res> implements $MessageLinkPreviewCopyWith<$Res> {
+ _$MessageLinkPreviewCopyWithImpl(this._value, this._then);
+
+ final MessageLinkPreview _value;
+ // ignore: unused_field
+ final $Res Function(MessageLinkPreview) _then;
+
+ @override
+ $Res call({
+ Object title = freezed,
+ Object description = freezed,
+ }) {
+ return _then(_value.copyWith(
+ title: title == freezed ? _value.title : title as String,
+ description: description == freezed ? _value.description : description as String,
+ ));
+ }
+}
+
+/// @nodoc
+abstract class _$MessageLinkPreviewCopyWith<$Res> implements $MessageLinkPreviewCopyWith<$Res> {
+ factory _$MessageLinkPreviewCopyWith(_MessageLinkPreview value, $Res Function(_MessageLinkPreview) then) =
+ __$MessageLinkPreviewCopyWithImpl<$Res>;
+ @override
+ $Res call({@JsonKey(name: 'title') String title, @JsonKey(name: 'description') String description});
+}
+
+/// @nodoc
+class __$MessageLinkPreviewCopyWithImpl<$Res> extends _$MessageLinkPreviewCopyWithImpl<$Res>
+ implements _$MessageLinkPreviewCopyWith<$Res> {
+ __$MessageLinkPreviewCopyWithImpl(_MessageLinkPreview _value, $Res Function(_MessageLinkPreview) _then)
+ : super(_value, (v) => _then(v as _MessageLinkPreview));
+
+ @override
+ _MessageLinkPreview get _value => super._value as _MessageLinkPreview;
+
+ @override
+ $Res call({
+ Object title = freezed,
+ Object description = freezed,
+ }) {
+ return _then(_MessageLinkPreview(
+ title: title == freezed ? _value.title : title as String,
+ description: description == freezed ? _value.description : description as String,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_MessageLinkPreview implements _MessageLinkPreview {
+ const _$_MessageLinkPreview(
+ {@required @JsonKey(name: 'title') this.title, @JsonKey(name: 'description') this.description})
+ : assert(title != null);
+
+ factory _$_MessageLinkPreview.fromJson(Map json) => _$_$_MessageLinkPreviewFromJson(json);
+
+ @override
+
+ /// Website title or og:title content.
+ @JsonKey(name: 'title')
+ final String title;
+ @override
+
+ /// Website description.
+ @JsonKey(name: 'description')
+ final String description;
+
+ @override
+ String toString() {
+ return 'MessageLinkPreview(title: $title, description: $description)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _MessageLinkPreview &&
+ (identical(other.title, title) || const DeepCollectionEquality().equals(other.title, title)) &&
+ (identical(other.description, description) ||
+ const DeepCollectionEquality().equals(other.description, description)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(title) ^
+ const DeepCollectionEquality().hash(description);
+
+ @override
+ _$MessageLinkPreviewCopyWith<_MessageLinkPreview> get copyWith =>
+ __$MessageLinkPreviewCopyWithImpl<_MessageLinkPreview>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageLinkPreviewToJson(this);
+ }
+}
+
+abstract class _MessageLinkPreview implements MessageLinkPreview {
+ const factory _MessageLinkPreview(
+ {@required @JsonKey(name: 'title') String title,
+ @JsonKey(name: 'description') String description}) = _$_MessageLinkPreview;
+
+ factory _MessageLinkPreview.fromJson(Map json) = _$_MessageLinkPreview.fromJson;
+
+ @override
+
+ /// Website title or og:title content.
+ @JsonKey(name: 'title')
+ String get title;
+ @override
+
+ /// Website description.
+ @JsonKey(name: 'description')
+ String get description;
+ @override
+ _$MessageLinkPreviewCopyWith<_MessageLinkPreview> get copyWith;
+}
diff --git a/lib/src/models/message_link_preview/message_link_preview.g.dart b/lib/src/models/message_link_preview/message_link_preview.g.dart
new file mode 100644
index 00000000..b01cdd7e
--- /dev/null
+++ b/lib/src/models/message_link_preview/message_link_preview.g.dart
@@ -0,0 +1,19 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message_link_preview.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_MessageLinkPreview _$_$_MessageLinkPreviewFromJson(Map json) {
+ return _$_MessageLinkPreview(
+ title: json['title'] as String,
+ description: json['description'] as String,
+ );
+}
+
+Map _$_$_MessageLinkPreviewToJson(_$_MessageLinkPreview instance) => {
+ 'title': instance.title,
+ 'description': instance.description,
+ };
diff --git a/lib/src/models/message_reaction/message_reaction.dart b/lib/src/models/message_reaction/message_reaction.dart
new file mode 100644
index 00000000..a58c5f7d
--- /dev/null
+++ b/lib/src/models/message_reaction/message_reaction.dart
@@ -0,0 +1,22 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'message_reaction.freezed.dart';
+part 'message_reaction.g.dart';
+
+/// Message emoji reaction
+@freezed
+abstract class MessageReaction with _$MessageReaction {
+ const factory MessageReaction({
+ /// Emoji.
+ @JsonKey(name: 'name') @required String name,
+
+ /// Number of reactions.
+ @JsonKey(name: 'counter') @required int counter,
+
+ /// Details.
+ @JsonKey(name: 'details') @required List details,
+ }) = _MessageReaction;
+
+ factory MessageReaction.fromJson(Map json) => _$MessageReactionFromJson(json);
+}
diff --git a/lib/src/models/message_reaction/message_reaction.freezed.dart b/lib/src/models/message_reaction/message_reaction.freezed.dart
new file mode 100644
index 00000000..339bd153
--- /dev/null
+++ b/lib/src/models/message_reaction/message_reaction.freezed.dart
@@ -0,0 +1,211 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message_reaction.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+MessageReaction _$MessageReactionFromJson(Map json) {
+ return _MessageReaction.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageReactionTearOff {
+ const _$MessageReactionTearOff();
+
+// ignore: unused_element
+ _MessageReaction call(
+ {@required @JsonKey(name: 'name') String name,
+ @required @JsonKey(name: 'counter') int counter,
+ @required @JsonKey(name: 'details') List details}) {
+ return _MessageReaction(
+ name: name,
+ counter: counter,
+ details: details,
+ );
+ }
+
+// ignore: unused_element
+ MessageReaction fromJson(Map json) {
+ return MessageReaction.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $MessageReaction = _$MessageReactionTearOff();
+
+/// @nodoc
+mixin _$MessageReaction {
+ /// Emoji.
+ @JsonKey(name: 'name')
+ String get name;
+
+ /// Number of reactions.
+ @JsonKey(name: 'counter')
+ int get counter;
+
+ /// Details.
+ @JsonKey(name: 'details')
+ List get details;
+
+ Map toJson();
+ $MessageReactionCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageReactionCopyWith<$Res> {
+ factory $MessageReactionCopyWith(MessageReaction value, $Res Function(MessageReaction) then) =
+ _$MessageReactionCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'name') String name,
+ @JsonKey(name: 'counter') int counter,
+ @JsonKey(name: 'details') List details});
+}
+
+/// @nodoc
+class _$MessageReactionCopyWithImpl<$Res> implements $MessageReactionCopyWith<$Res> {
+ _$MessageReactionCopyWithImpl(this._value, this._then);
+
+ final MessageReaction _value;
+ // ignore: unused_field
+ final $Res Function(MessageReaction) _then;
+
+ @override
+ $Res call({
+ Object name = freezed,
+ Object counter = freezed,
+ Object details = freezed,
+ }) {
+ return _then(_value.copyWith(
+ name: name == freezed ? _value.name : name as String,
+ counter: counter == freezed ? _value.counter : counter as int,
+ details: details == freezed ? _value.details : details as List,
+ ));
+ }
+}
+
+/// @nodoc
+abstract class _$MessageReactionCopyWith<$Res> implements $MessageReactionCopyWith<$Res> {
+ factory _$MessageReactionCopyWith(_MessageReaction value, $Res Function(_MessageReaction) then) =
+ __$MessageReactionCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'name') String name,
+ @JsonKey(name: 'counter') int counter,
+ @JsonKey(name: 'details') List details});
+}
+
+/// @nodoc
+class __$MessageReactionCopyWithImpl<$Res> extends _$MessageReactionCopyWithImpl<$Res>
+ implements _$MessageReactionCopyWith<$Res> {
+ __$MessageReactionCopyWithImpl(_MessageReaction _value, $Res Function(_MessageReaction) _then)
+ : super(_value, (v) => _then(v as _MessageReaction));
+
+ @override
+ _MessageReaction get _value => super._value as _MessageReaction;
+
+ @override
+ $Res call({
+ Object name = freezed,
+ Object counter = freezed,
+ Object details = freezed,
+ }) {
+ return _then(_MessageReaction(
+ name: name == freezed ? _value.name : name as String,
+ counter: counter == freezed ? _value.counter : counter as int,
+ details: details == freezed ? _value.details : details as List,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_MessageReaction implements _MessageReaction {
+ const _$_MessageReaction(
+ {@required @JsonKey(name: 'name') this.name,
+ @required @JsonKey(name: 'counter') this.counter,
+ @required @JsonKey(name: 'details') this.details})
+ : assert(name != null),
+ assert(counter != null),
+ assert(details != null);
+
+ factory _$_MessageReaction.fromJson(Map json) => _$_$_MessageReactionFromJson(json);
+
+ @override
+
+ /// Emoji.
+ @JsonKey(name: 'name')
+ final String name;
+ @override
+
+ /// Number of reactions.
+ @JsonKey(name: 'counter')
+ final int counter;
+ @override
+
+ /// Details.
+ @JsonKey(name: 'details')
+ final List details;
+
+ @override
+ String toString() {
+ return 'MessageReaction(name: $name, counter: $counter, details: $details)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _MessageReaction &&
+ (identical(other.name, name) || const DeepCollectionEquality().equals(other.name, name)) &&
+ (identical(other.counter, counter) || const DeepCollectionEquality().equals(other.counter, counter)) &&
+ (identical(other.details, details) || const DeepCollectionEquality().equals(other.details, details)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(name) ^
+ const DeepCollectionEquality().hash(counter) ^
+ const DeepCollectionEquality().hash(details);
+
+ @override
+ _$MessageReactionCopyWith<_MessageReaction> get copyWith =>
+ __$MessageReactionCopyWithImpl<_MessageReaction>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageReactionToJson(this);
+ }
+}
+
+abstract class _MessageReaction implements MessageReaction {
+ const factory _MessageReaction(
+ {@required @JsonKey(name: 'name') String name,
+ @required @JsonKey(name: 'counter') int counter,
+ @required @JsonKey(name: 'details') List details}) = _$_MessageReaction;
+
+ factory _MessageReaction.fromJson(Map json) = _$_MessageReaction.fromJson;
+
+ @override
+
+ /// Emoji.
+ @JsonKey(name: 'name')
+ String get name;
+ @override
+
+ /// Number of reactions.
+ @JsonKey(name: 'counter')
+ int get counter;
+ @override
+
+ /// Details.
+ @JsonKey(name: 'details')
+ List get details;
+ @override
+ _$MessageReactionCopyWith<_MessageReaction> get copyWith;
+}
diff --git a/lib/src/models/message_reaction/message_reaction.g.dart b/lib/src/models/message_reaction/message_reaction.g.dart
new file mode 100644
index 00000000..7997f168
--- /dev/null
+++ b/lib/src/models/message_reaction/message_reaction.g.dart
@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message_reaction.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_MessageReaction _$_$_MessageReactionFromJson(Map json) {
+ return _$_MessageReaction(
+ name: json['name'] as String,
+ counter: json['counter'] as int,
+ details: (json['details'] as List)
+ ?.map((e) => e == null ? null : MessageReactionDetail.fromJson(e as Map))
+ ?.toList(),
+ );
+}
+
+Map _$_$_MessageReactionToJson(_$_MessageReaction instance) => {
+ 'name': instance.name,
+ 'counter': instance.counter,
+ 'details': instance.details?.map((e) => e?.toJson())?.toList(),
+ };
diff --git a/lib/src/models/message_reaction_detail/message_reaction_detail.dart b/lib/src/models/message_reaction_detail/message_reaction_detail.dart
new file mode 100644
index 00000000..0969a40a
--- /dev/null
+++ b/lib/src/models/message_reaction_detail/message_reaction_detail.dart
@@ -0,0 +1,22 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'message_reaction_detail.freezed.dart';
+part 'message_reaction_detail.g.dart';
+
+/// Message reaction detail
+@freezed
+abstract class MessageReactionDetail with _$MessageReactionDetail {
+ const factory MessageReactionDetail({
+ /// When reaction added, iso datetime.
+ @JsonKey(name: 'created') @DateTimeConverter() @required DateTime created,
+
+ /// Reaction author.
+ @JsonKey(name: 'sender') @required String sender,
+
+ /// Reaction emoji.
+ @JsonKey(name: 'name') @required String name,
+ }) = _MessageReactionDetail;
+
+ factory MessageReactionDetail.fromJson(Map json) => _$MessageReactionDetailFromJson(json);
+}
diff --git a/lib/src/models/message_reaction_detail/message_reaction_detail.freezed.dart b/lib/src/models/message_reaction_detail/message_reaction_detail.freezed.dart
new file mode 100644
index 00000000..7f91e1a3
--- /dev/null
+++ b/lib/src/models/message_reaction_detail/message_reaction_detail.freezed.dart
@@ -0,0 +1,214 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies
+
+part of 'message_reaction_detail.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+MessageReactionDetail _$MessageReactionDetailFromJson(Map json) {
+ return _MessageReactionDetail.fromJson(json);
+}
+
+/// @nodoc
+class _$MessageReactionDetailTearOff {
+ const _$MessageReactionDetailTearOff();
+
+// ignore: unused_element
+ _MessageReactionDetail call(
+ {@required @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @required @JsonKey(name: 'sender') String sender,
+ @required @JsonKey(name: 'name') String name}) {
+ return _MessageReactionDetail(
+ created: created,
+ sender: sender,
+ name: name,
+ );
+ }
+
+// ignore: unused_element
+ MessageReactionDetail fromJson(Map json) {
+ return MessageReactionDetail.fromJson(json);
+ }
+}
+
+/// @nodoc
+// ignore: unused_element
+const $MessageReactionDetail = _$MessageReactionDetailTearOff();
+
+/// @nodoc
+mixin _$MessageReactionDetail {
+ /// When reaction added, iso datetime.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ DateTime get created;
+
+ /// Reaction author.
+ @JsonKey(name: 'sender')
+ String get sender;
+
+ /// Reaction emoji.
+ @JsonKey(name: 'name')
+ String get name;
+
+ Map toJson();
+ $MessageReactionDetailCopyWith get copyWith;
+}
+
+/// @nodoc
+abstract class $MessageReactionDetailCopyWith<$Res> {
+ factory $MessageReactionDetailCopyWith(MessageReactionDetail value, $Res Function(MessageReactionDetail) then) =
+ _$MessageReactionDetailCopyWithImpl<$Res>;
+ $Res call(
+ {@JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'sender') String sender,
+ @JsonKey(name: 'name') String name});
+}
+
+/// @nodoc
+class _$MessageReactionDetailCopyWithImpl<$Res> implements $MessageReactionDetailCopyWith<$Res> {
+ _$MessageReactionDetailCopyWithImpl(this._value, this._then);
+
+ final MessageReactionDetail _value;
+ // ignore: unused_field
+ final $Res Function(MessageReactionDetail) _then;
+
+ @override
+ $Res call({
+ Object created = freezed,
+ Object sender = freezed,
+ Object name = freezed,
+ }) {
+ return _then(_value.copyWith(
+ created: created == freezed ? _value.created : created as DateTime,
+ sender: sender == freezed ? _value.sender : sender as String,
+ name: name == freezed ? _value.name : name as String,
+ ));
+ }
+}
+
+/// @nodoc
+abstract class _$MessageReactionDetailCopyWith<$Res> implements $MessageReactionDetailCopyWith<$Res> {
+ factory _$MessageReactionDetailCopyWith(_MessageReactionDetail value, $Res Function(_MessageReactionDetail) then) =
+ __$MessageReactionDetailCopyWithImpl<$Res>;
+ @override
+ $Res call(
+ {@JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @JsonKey(name: 'sender') String sender,
+ @JsonKey(name: 'name') String name});
+}
+
+/// @nodoc
+class __$MessageReactionDetailCopyWithImpl<$Res> extends _$MessageReactionDetailCopyWithImpl<$Res>
+ implements _$MessageReactionDetailCopyWith<$Res> {
+ __$MessageReactionDetailCopyWithImpl(_MessageReactionDetail _value, $Res Function(_MessageReactionDetail) _then)
+ : super(_value, (v) => _then(v as _MessageReactionDetail));
+
+ @override
+ _MessageReactionDetail get _value => super._value as _MessageReactionDetail;
+
+ @override
+ $Res call({
+ Object created = freezed,
+ Object sender = freezed,
+ Object name = freezed,
+ }) {
+ return _then(_MessageReactionDetail(
+ created: created == freezed ? _value.created : created as DateTime,
+ sender: sender == freezed ? _value.sender : sender as String,
+ name: name == freezed ? _value.name : name as String,
+ ));
+ }
+}
+
+@JsonSerializable()
+
+/// @nodoc
+class _$_MessageReactionDetail implements _MessageReactionDetail {
+ const _$_MessageReactionDetail(
+ {@required @JsonKey(name: 'created') @DateTimeConverter() this.created,
+ @required @JsonKey(name: 'sender') this.sender,
+ @required @JsonKey(name: 'name') this.name})
+ : assert(created != null),
+ assert(sender != null),
+ assert(name != null);
+
+ factory _$_MessageReactionDetail.fromJson(Map json) => _$_$_MessageReactionDetailFromJson(json);
+
+ @override
+
+ /// When reaction added, iso datetime.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ final DateTime created;
+ @override
+
+ /// Reaction author.
+ @JsonKey(name: 'sender')
+ final String sender;
+ @override
+
+ /// Reaction emoji.
+ @JsonKey(name: 'name')
+ final String name;
+
+ @override
+ String toString() {
+ return 'MessageReactionDetail(created: $created, sender: $sender, name: $name)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other is _MessageReactionDetail &&
+ (identical(other.created, created) || const DeepCollectionEquality().equals(other.created, created)) &&
+ (identical(other.sender, sender) || const DeepCollectionEquality().equals(other.sender, sender)) &&
+ (identical(other.name, name) || const DeepCollectionEquality().equals(other.name, name)));
+ }
+
+ @override
+ int get hashCode =>
+ runtimeType.hashCode ^
+ const DeepCollectionEquality().hash(created) ^
+ const DeepCollectionEquality().hash(sender) ^
+ const DeepCollectionEquality().hash(name);
+
+ @override
+ _$MessageReactionDetailCopyWith<_MessageReactionDetail> get copyWith =>
+ __$MessageReactionDetailCopyWithImpl<_MessageReactionDetail>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$_$_MessageReactionDetailToJson(this);
+ }
+}
+
+abstract class _MessageReactionDetail implements MessageReactionDetail {
+ const factory _MessageReactionDetail(
+ {@required @JsonKey(name: 'created') @DateTimeConverter() DateTime created,
+ @required @JsonKey(name: 'sender') String sender,
+ @required @JsonKey(name: 'name') String name}) = _$_MessageReactionDetail;
+
+ factory _MessageReactionDetail.fromJson(Map json) = _$_MessageReactionDetail.fromJson;
+
+ @override
+
+ /// When reaction added, iso datetime.
+ @JsonKey(name: 'created')
+ @DateTimeConverter()
+ DateTime get created;
+ @override
+
+ /// Reaction author.
+ @JsonKey(name: 'sender')
+ String get sender;
+ @override
+
+ /// Reaction emoji.
+ @JsonKey(name: 'name')
+ String get name;
+ @override
+ _$MessageReactionDetailCopyWith<_MessageReactionDetail> get copyWith;
+}
diff --git a/lib/src/models/message_reaction_detail/message_reaction_detail.g.dart b/lib/src/models/message_reaction_detail/message_reaction_detail.g.dart
new file mode 100644
index 00000000..91e5063d
--- /dev/null
+++ b/lib/src/models/message_reaction_detail/message_reaction_detail.g.dart
@@ -0,0 +1,21 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'message_reaction_detail.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$_MessageReactionDetail _$_$_MessageReactionDetailFromJson(Map json) {
+ return _$_MessageReactionDetail(
+ created: const DateTimeConverter().fromJson(json['created'] as String),
+ sender: json['sender'] as String,
+ name: json['name'] as String,
+ );
+}
+
+Map _$_$_MessageReactionDetailToJson(_$_MessageReactionDetail instance) => {
+ 'created': const DateTimeConverter().toJson(instance.created),
+ 'sender': instance.sender,
+ 'name': instance.name,
+ };
diff --git a/lib/src/pdf_version/pdf_version.dart b/lib/src/models/pdf_version/pdf_version.dart
similarity index 91%
rename from lib/src/pdf_version/pdf_version.dart
rename to lib/src/models/pdf_version/pdf_version.dart
index d2bfcc92..213f37b8 100644
--- a/lib/src/pdf_version/pdf_version.dart
+++ b/lib/src/models/pdf_version/pdf_version.dart
@@ -1,5 +1,4 @@
import 'package:freezed_annotation/freezed_annotation.dart';
-import 'package:tdproto_dart/tdproto_dart.dart';
part 'pdf_version.freezed.dart';
part 'pdf_version.g.dart';
diff --git a/lib/src/pdf_version/pdf_version.freezed.dart b/lib/src/models/pdf_version/pdf_version.freezed.dart
similarity index 100%
rename from lib/src/pdf_version/pdf_version.freezed.dart
rename to lib/src/models/pdf_version/pdf_version.freezed.dart
diff --git a/lib/src/pdf_version/pdf_version.g.dart b/lib/src/models/pdf_version/pdf_version.g.dart
similarity index 100%
rename from lib/src/pdf_version/pdf_version.g.dart
rename to lib/src/models/pdf_version/pdf_version.g.dart
diff --git a/lib/src/models/response/response.dart b/lib/src/models/response/response.dart
new file mode 100644
index 00000000..d3449bc4
--- /dev/null
+++ b/lib/src/models/response/response.dart
@@ -0,0 +1,52 @@
+import 'package:meta/meta.dart';
+import 'package:json_annotation/json_annotation.dart';
+import 'package:tdproto_dart/tdproto_dart.dart';
+
+part 'response.g.dart';
+
+/// Response. Handwritten implementation.
+/// This model is implemented through JsonSerializable as freezed doesn't support serialization of generics.
+@JsonSerializable()
+class Response implements IResponse {
+ /// Debug time.
+ @override
+ @JsonKey(name: '_time')
+ final String time;
+
+ /// Whether http status code is 200 or not.
+ @override
+ @JsonKey(name: 'ok')
+ final bool ok;
+
+ /// Requested data.
+ @override
+ @JsonKey(name: 'result')
+ final T result;
+
+ /// Error code.
+ @override
+ @JsonKey(name: 'error')
+ final String error;
+
+ /// Details about the error.
+ @override
+ @JsonKey(name: 'details')
+ final Map details;
+
+ const Response({
+ @required this.time,
+ @required this.ok,
+ @required this.result,
+ this.error,
+ this.details,
+ });
+
+ factory Response.fromJson(
+ Map json,
+ T Function(Object json) fromJsonT,
+ ) {
+ return _$ResponseFromJson(json, fromJsonT);
+ }
+
+ Map toJson(Object Function(T value) toJsonT) => _$ResponseToJson(this, toJsonT);
+}
diff --git a/lib/src/models/response/response.g.dart b/lib/src/models/response/response.g.dart
new file mode 100644
index 00000000..fbdfc65f
--- /dev/null
+++ b/lib/src/models/response/response.g.dart
@@ -0,0 +1,32 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'response.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Response _$ResponseFromJson(
+ Map