// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file // ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package // ignore_for_file: unused_element, 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, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'media_import.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // GENERATED CODE - DO NOT MODIFY BY HAND T _$identity(T value) => value; /// @nodoc mixin _$ExternalMediaFile { @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is ExternalMediaFile); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'ExternalMediaFile()'; } } /// @nodoc class $ExternalMediaFileCopyWith<$Res> { $ExternalMediaFileCopyWith( ExternalMediaFile _, $Res Function(ExternalMediaFile) __, ); } /// Adds pattern-matching-related methods to [ExternalMediaFile]. extension ExternalMediaFilePatterns on ExternalMediaFile { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap( TResult Function(LocalMediaFile value)? $default, { TResult Function(ContentMediaFile value)? content, required TResult orElse(), }) { final _that = this; switch (_that) { case LocalMediaFile() when $default != null: return $default(_that); case ContentMediaFile() when content != null: return content(_that); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// Callbacks receives the raw object, upcasted. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case final Subclass2 value: /// return ...; /// } /// ``` @optionalTypeArgs TResult map( TResult Function(LocalMediaFile value) $default, { required TResult Function(ContentMediaFile value) content, }) { final _that = this; switch (_that) { case LocalMediaFile(): return $default(_that); case ContentMediaFile(): return content(_that); } } /// A variant of `map` that fallback to returning `null`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? mapOrNull( TResult? Function(LocalMediaFile value)? $default, { TResult? Function(ContentMediaFile value)? content, }) { final _that = this; switch (_that) { case LocalMediaFile() when $default != null: return $default(_that); case ContentMediaFile() when content != null: return content(_that); case _: return null; } } /// A variant of `when` that fallback to an `orElse` callback. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeWhen( TResult Function(String path)? $default, { TResult Function(Uri uri, String name, int? byteLength)? content, required TResult orElse(), }) { final _that = this; switch (_that) { case LocalMediaFile() when $default != null: return $default(_that.path); case ContentMediaFile() when content != null: return content(_that.uri, _that.name, _that.byteLength); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// As opposed to `map`, this offers destructuring. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case Subclass2(:final field2): /// return ...; /// } /// ``` @optionalTypeArgs TResult when( TResult Function(String path) $default, { required TResult Function(Uri uri, String name, int? byteLength) content, }) { final _that = this; switch (_that) { case LocalMediaFile(): return $default(_that.path); case ContentMediaFile(): return content(_that.uri, _that.name, _that.byteLength); } } /// A variant of `when` that fallback to returning `null` /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? whenOrNull( TResult? Function(String path)? $default, { TResult? Function(Uri uri, String name, int? byteLength)? content, }) { final _that = this; switch (_that) { case LocalMediaFile() when $default != null: return $default(_that.path); case ContentMediaFile() when content != null: return content(_that.uri, _that.name, _that.byteLength); case _: return null; } } } /// @nodoc class LocalMediaFile extends ExternalMediaFile { const LocalMediaFile({required this.path}) : super._(); final String path; /// Create a copy of ExternalMediaFile /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $LocalMediaFileCopyWith get copyWith => _$LocalMediaFileCopyWithImpl(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is LocalMediaFile && (identical(other.path, path) || other.path == path)); } @override int get hashCode { return Object.hash(runtimeType, path); } @override String toString() { return 'ExternalMediaFile(path: $path)'; } } /// @nodoc abstract mixin class $LocalMediaFileCopyWith<$Res> implements $ExternalMediaFileCopyWith<$Res> { factory $LocalMediaFileCopyWith( LocalMediaFile value, $Res Function(LocalMediaFile) _then, ) = _$LocalMediaFileCopyWithImpl; @useResult $Res call({String path}); } /// @nodoc class _$LocalMediaFileCopyWithImpl<$Res> implements $LocalMediaFileCopyWith<$Res> { _$LocalMediaFileCopyWithImpl(this._self, this._then); final LocalMediaFile _self; final $Res Function(LocalMediaFile) _then; /// Create a copy of ExternalMediaFile /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? path = null}) { return _then( LocalMediaFile( path: null == path ? _self.path : path // ignore: cast_nullable_to_non_nullable as String, ), ); } } /// @nodoc class ContentMediaFile extends ExternalMediaFile { const ContentMediaFile({ required this.uri, required this.name, this.byteLength, }) : super._(); final Uri uri; final String name; final int? byteLength; /// Create a copy of ExternalMediaFile /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $ContentMediaFileCopyWith get copyWith => _$ContentMediaFileCopyWithImpl(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is ContentMediaFile && (identical(other.uri, uri) || other.uri == uri) && (identical(other.name, name) || other.name == name) && (identical(other.byteLength, byteLength) || other.byteLength == byteLength)); } @override int get hashCode { return Object.hash(runtimeType, uri, name, byteLength); } @override String toString() { return 'ExternalMediaFile.content(uri: $uri, name: $name, byteLength: $byteLength)'; } } /// @nodoc abstract mixin class $ContentMediaFileCopyWith<$Res> implements $ExternalMediaFileCopyWith<$Res> { factory $ContentMediaFileCopyWith( ContentMediaFile value, $Res Function(ContentMediaFile) _then, ) = _$ContentMediaFileCopyWithImpl; @useResult $Res call({Uri uri, String name, int? byteLength}); } /// @nodoc class _$ContentMediaFileCopyWithImpl<$Res> implements $ContentMediaFileCopyWith<$Res> { _$ContentMediaFileCopyWithImpl(this._self, this._then); final ContentMediaFile _self; final $Res Function(ContentMediaFile) _then; /// Create a copy of ExternalMediaFile /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({ Object? uri = null, Object? name = null, Object? byteLength = freezed, }) { return _then( ContentMediaFile( uri: null == uri ? _self.uri : uri // ignore: cast_nullable_to_non_nullable as Uri, name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String, byteLength: freezed == byteLength ? _self.byteLength : byteLength // ignore: cast_nullable_to_non_nullable as int?, ), ); } } /// @nodoc mixin _$MediaImportFailure { String get name; AppFailure get failure; /// Create a copy of MediaImportFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $MediaImportFailureCopyWith get copyWith => _$MediaImportFailureCopyWithImpl( this as MediaImportFailure, _$identity, ); @override bool operator ==(Object other) { final _this = this as MediaImportFailure; return identical(this, other) || (other.runtimeType == runtimeType && other is MediaImportFailure && (identical(other.name, _this.name) || other.name == _this.name) && (identical(other.failure, _this.failure) || other.failure == _this.failure)); } @override int get hashCode { final _this = this as MediaImportFailure; return Object.hash(runtimeType, _this.name, _this.failure); } @override String toString() { final _this = this as MediaImportFailure; return 'MediaImportFailure(name: ${_this.name}, failure: ${_this.failure})'; } } /// @nodoc abstract mixin class $MediaImportFailureCopyWith<$Res> { factory $MediaImportFailureCopyWith( MediaImportFailure value, $Res Function(MediaImportFailure) _then, ) = _$MediaImportFailureCopyWithImpl; @useResult $Res call({String name, AppFailure failure}); } /// @nodoc class _$MediaImportFailureCopyWithImpl<$Res> implements $MediaImportFailureCopyWith<$Res> { _$MediaImportFailureCopyWithImpl(this._self, this._then); final MediaImportFailure _self; final $Res Function(MediaImportFailure) _then; /// Create a copy of MediaImportFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({Object? name = null, Object? failure = null}) { return _then( MediaImportFailure( name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String, failure: null == failure ? _self.failure : failure // ignore: cast_nullable_to_non_nullable as AppFailure, ), ); } } /// Adds pattern-matching-related methods to [MediaImportFailure]. extension MediaImportFailurePatterns on MediaImportFailure { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap( TResult Function(_MediaImportFailure value)? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _MediaImportFailure() when $default != null: return $default(_that); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// Callbacks receives the raw object, upcasted. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case final Subclass2 value: /// return ...; /// } /// ``` @optionalTypeArgs TResult map( TResult Function(_MediaImportFailure value) $default, ) { final _that = this; switch (_that) { case _MediaImportFailure(): return $default(_that); case _: throw StateError('Unexpected subclass'); } } /// A variant of `map` that fallback to returning `null`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? mapOrNull( TResult? Function(_MediaImportFailure value)? $default, ) { final _that = this; switch (_that) { case _MediaImportFailure() when $default != null: return $default(_that); case _: return null; } } /// A variant of `when` that fallback to an `orElse` callback. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeWhen( TResult Function(String name, AppFailure failure)? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _MediaImportFailure() when $default != null: return $default(_that.name, _that.failure); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// As opposed to `map`, this offers destructuring. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case Subclass2(:final field2): /// return ...; /// } /// ``` @optionalTypeArgs TResult when( TResult Function(String name, AppFailure failure) $default, ) { final _that = this; switch (_that) { case _MediaImportFailure(): return $default(_that.name, _that.failure); case _: throw StateError('Unexpected subclass'); } } /// A variant of `when` that fallback to returning `null` /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? whenOrNull( TResult? Function(String name, AppFailure failure)? $default, ) { final _that = this; switch (_that) { case _MediaImportFailure() when $default != null: return $default(_that.name, _that.failure); case _: return null; } } } /// @nodoc class _MediaImportFailure implements MediaImportFailure { const _MediaImportFailure({required this.name, required this.failure}); @override final String name; @override final AppFailure failure; /// Create a copy of MediaImportFailure /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$MediaImportFailureCopyWith<_MediaImportFailure> get copyWith => __$MediaImportFailureCopyWithImpl<_MediaImportFailure>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _MediaImportFailure && (identical(other.name, name) || other.name == name) && (identical(other.failure, failure) || other.failure == failure)); } @override int get hashCode { return Object.hash(runtimeType, name, failure); } @override String toString() { return 'MediaImportFailure(name: $name, failure: $failure)'; } } /// @nodoc abstract mixin class _$MediaImportFailureCopyWith<$Res> implements $MediaImportFailureCopyWith<$Res> { factory _$MediaImportFailureCopyWith( _MediaImportFailure value, $Res Function(_MediaImportFailure) _then, ) = __$MediaImportFailureCopyWithImpl; @override @useResult $Res call({String name, AppFailure failure}); } /// @nodoc class __$MediaImportFailureCopyWithImpl<$Res> implements _$MediaImportFailureCopyWith<$Res> { __$MediaImportFailureCopyWithImpl(this._self, this._then); final _MediaImportFailure _self; final $Res Function(_MediaImportFailure) _then; /// Create a copy of MediaImportFailure /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({Object? name = null, Object? failure = null}) { return _then( _MediaImportFailure( name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String, failure: null == failure ? _self.failure : failure // ignore: cast_nullable_to_non_nullable as AppFailure, ), ); } } /// @nodoc mixin _$MediaImportResult { List get assets; int get added; int get duplicates; List get failures; /// Create a copy of MediaImportResult /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $MediaImportResultCopyWith get copyWith => _$MediaImportResultCopyWithImpl( this as MediaImportResult, _$identity, ); @override bool operator ==(Object other) { final _this = this as MediaImportResult; return identical(this, other) || (other.runtimeType == runtimeType && other is MediaImportResult && const DeepCollectionEquality().equals(other.assets, _this.assets) && (identical(other.added, _this.added) || other.added == _this.added) && (identical(other.duplicates, _this.duplicates) || other.duplicates == _this.duplicates) && const DeepCollectionEquality().equals( other.failures, _this.failures, )); } @override int get hashCode { final _this = this as MediaImportResult; return Object.hash( runtimeType, const DeepCollectionEquality().hash(_this.assets), _this.added, _this.duplicates, const DeepCollectionEquality().hash(_this.failures), ); } @override String toString() { final _this = this as MediaImportResult; return 'MediaImportResult(assets: ${_this.assets}, added: ${_this.added}, duplicates: ${_this.duplicates}, failures: ${_this.failures})'; } } /// @nodoc abstract mixin class $MediaImportResultCopyWith<$Res> { factory $MediaImportResultCopyWith( MediaImportResult value, $Res Function(MediaImportResult) _then, ) = _$MediaImportResultCopyWithImpl; @useResult $Res call({ List assets, int added, int duplicates, List failures, }); } /// @nodoc class _$MediaImportResultCopyWithImpl<$Res> implements $MediaImportResultCopyWith<$Res> { _$MediaImportResultCopyWithImpl(this._self, this._then); final MediaImportResult _self; final $Res Function(MediaImportResult) _then; /// Create a copy of MediaImportResult /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? assets = null, Object? added = null, Object? duplicates = null, Object? failures = null, }) { return _then( MediaImportResult( assets: null == assets ? _self.assets : assets // ignore: cast_nullable_to_non_nullable as List, added: null == added ? _self.added : added // ignore: cast_nullable_to_non_nullable as int, duplicates: null == duplicates ? _self.duplicates : duplicates // ignore: cast_nullable_to_non_nullable as int, failures: null == failures ? _self.failures : failures // ignore: cast_nullable_to_non_nullable as List, ), ); } } /// Adds pattern-matching-related methods to [MediaImportResult]. extension MediaImportResultPatterns on MediaImportResult { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap( TResult Function(_MediaImportResult value)? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _MediaImportResult() when $default != null: return $default(_that); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// Callbacks receives the raw object, upcasted. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case final Subclass2 value: /// return ...; /// } /// ``` @optionalTypeArgs TResult map( TResult Function(_MediaImportResult value) $default, ) { final _that = this; switch (_that) { case _MediaImportResult(): return $default(_that); case _: throw StateError('Unexpected subclass'); } } /// A variant of `map` that fallback to returning `null`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? mapOrNull( TResult? Function(_MediaImportResult value)? $default, ) { final _that = this; switch (_that) { case _MediaImportResult() when $default != null: return $default(_that); case _: return null; } } /// A variant of `when` that fallback to an `orElse` callback. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeWhen( TResult Function( List assets, int added, int duplicates, List failures, )? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _MediaImportResult() when $default != null: return $default( _that.assets, _that.added, _that.duplicates, _that.failures, ); case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// As opposed to `map`, this offers destructuring. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case Subclass2(:final field2): /// return ...; /// } /// ``` @optionalTypeArgs TResult when( TResult Function( List assets, int added, int duplicates, List failures, ) $default, ) { final _that = this; switch (_that) { case _MediaImportResult(): return $default( _that.assets, _that.added, _that.duplicates, _that.failures, ); case _: throw StateError('Unexpected subclass'); } } /// A variant of `when` that fallback to returning `null` /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? whenOrNull( TResult? Function( List assets, int added, int duplicates, List failures, )? $default, ) { final _that = this; switch (_that) { case _MediaImportResult() when $default != null: return $default( _that.assets, _that.added, _that.duplicates, _that.failures, ); case _: return null; } } } /// @nodoc class _MediaImportResult implements MediaImportResult { const _MediaImportResult({ required List assets, required this.added, required this.duplicates, required List failures, }) : _assets = assets, _failures = failures; final List _assets; @override List get assets { if (_assets is EqualUnmodifiableListView) return _assets; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_assets); } @override final int added; @override final int duplicates; final List _failures; @override List get failures { if (_failures is EqualUnmodifiableListView) return _failures; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_failures); } /// Create a copy of MediaImportResult /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$MediaImportResultCopyWith<_MediaImportResult> get copyWith => __$MediaImportResultCopyWithImpl<_MediaImportResult>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _MediaImportResult && const DeepCollectionEquality().equals(other.assets, _assets) && (identical(other.added, added) || other.added == added) && (identical(other.duplicates, duplicates) || other.duplicates == duplicates) && const DeepCollectionEquality().equals(other.failures, _failures)); } @override int get hashCode { return Object.hash( runtimeType, const DeepCollectionEquality().hash(_assets), added, duplicates, const DeepCollectionEquality().hash(_failures), ); } @override String toString() { return 'MediaImportResult(assets: $assets, added: $added, duplicates: $duplicates, failures: $failures)'; } } /// @nodoc abstract mixin class _$MediaImportResultCopyWith<$Res> implements $MediaImportResultCopyWith<$Res> { factory _$MediaImportResultCopyWith( _MediaImportResult value, $Res Function(_MediaImportResult) _then, ) = __$MediaImportResultCopyWithImpl; @override @useResult $Res call({ List assets, int added, int duplicates, List failures, }); } /// @nodoc class __$MediaImportResultCopyWithImpl<$Res> implements _$MediaImportResultCopyWith<$Res> { __$MediaImportResultCopyWithImpl(this._self, this._then); final _MediaImportResult _self; final $Res Function(_MediaImportResult) _then; /// Create a copy of MediaImportResult /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({ Object? assets = null, Object? added = null, Object? duplicates = null, Object? failures = null, }) { return _then( _MediaImportResult( assets: null == assets ? _self._assets : assets // ignore: cast_nullable_to_non_nullable as List, added: null == added ? _self.added : added // ignore: cast_nullable_to_non_nullable as int, duplicates: null == duplicates ? _self.duplicates : duplicates // ignore: cast_nullable_to_non_nullable as int, failures: null == failures ? _self._failures : failures // ignore: cast_nullable_to_non_nullable as List, ), ); } }