// 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 'agent_message_codec.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // GENERATED CODE - DO NOT MODIFY BY HAND T _$identity(T value) => value; /// @nodoc mixin _$AgentComposerMessage { String get text; List get attachments; List get segments; /// Create a copy of AgentComposerMessage /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $AgentComposerMessageCopyWith get copyWith => _$AgentComposerMessageCopyWithImpl( this as AgentComposerMessage, _$identity, ); /// Serializes this AgentComposerMessage to a JSON map. Map toJson(); @override bool operator ==(Object other) { final _this = this as AgentComposerMessage; return identical(this, other) || (other.runtimeType == runtimeType && other is AgentComposerMessage && (identical(other.text, _this.text) || other.text == _this.text) && const DeepCollectionEquality().equals( other.attachments, _this.attachments, ) && const DeepCollectionEquality().equals( other.segments, _this.segments, )); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode { final _this = this as AgentComposerMessage; return Object.hash( runtimeType, _this.text, const DeepCollectionEquality().hash(_this.attachments), const DeepCollectionEquality().hash(_this.segments), ); } @override String toString() { final _this = this as AgentComposerMessage; return 'AgentComposerMessage(text: ${_this.text}, attachments: ${_this.attachments}, segments: ${_this.segments})'; } } /// @nodoc abstract mixin class $AgentComposerMessageCopyWith<$Res> { factory $AgentComposerMessageCopyWith( AgentComposerMessage value, $Res Function(AgentComposerMessage) _then, ) = _$AgentComposerMessageCopyWithImpl; @useResult $Res call({ String text, List attachments, List segments, }); } /// @nodoc class _$AgentComposerMessageCopyWithImpl<$Res> implements $AgentComposerMessageCopyWith<$Res> { _$AgentComposerMessageCopyWithImpl(this._self, this._then); final AgentComposerMessage _self; final $Res Function(AgentComposerMessage) _then; /// Create a copy of AgentComposerMessage /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? text = null, Object? attachments = null, Object? segments = null, }) { return _then( AgentComposerMessage( text: null == text ? _self.text : text // ignore: cast_nullable_to_non_nullable as String, attachments: null == attachments ? _self.attachments : attachments // ignore: cast_nullable_to_non_nullable as List, segments: null == segments ? _self.segments : segments // ignore: cast_nullable_to_non_nullable as List, ), ); } } /// Adds pattern-matching-related methods to [AgentComposerMessage]. extension AgentComposerMessagePatterns on AgentComposerMessage { /// 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(_AgentComposerMessage value)? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _AgentComposerMessage() 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(_AgentComposerMessage value) $default, ) { final _that = this; switch (_that) { case _AgentComposerMessage(): 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(_AgentComposerMessage value)? $default, ) { final _that = this; switch (_that) { case _AgentComposerMessage() 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 text, List attachments, List segments, )? $default, { required TResult orElse(), }) { final _that = this; switch (_that) { case _AgentComposerMessage() when $default != null: return $default(_that.text, _that.attachments, _that.segments); 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 text, List attachments, List segments, ) $default, ) { final _that = this; switch (_that) { case _AgentComposerMessage(): return $default(_that.text, _that.attachments, _that.segments); 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 text, List attachments, List segments, )? $default, ) { final _that = this; switch (_that) { case _AgentComposerMessage() when $default != null: return $default(_that.text, _that.attachments, _that.segments); case _: return null; } } } /// @nodoc @JsonSerializable() class _AgentComposerMessage extends AgentComposerMessage { const _AgentComposerMessage({ required this.text, required List attachments, required List segments, }) : _attachments = attachments, _segments = segments, super._(); factory _AgentComposerMessage.fromJson(Map json) => _$AgentComposerMessageFromJson(json); @override final String text; final List _attachments; @override List get attachments { if (_attachments is EqualUnmodifiableListView) return _attachments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_attachments); } final List _segments; @override List get segments { if (_segments is EqualUnmodifiableListView) return _segments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_segments); } /// Create a copy of AgentComposerMessage /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$AgentComposerMessageCopyWith<_AgentComposerMessage> get copyWith => __$AgentComposerMessageCopyWithImpl<_AgentComposerMessage>( this, _$identity, ); @override Map toJson() { return _$AgentComposerMessageToJson(this); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _AgentComposerMessage && (identical(other.text, text) || other.text == text) && const DeepCollectionEquality().equals( other.attachments, _attachments, ) && const DeepCollectionEquality().equals(other.segments, _segments)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode { return Object.hash( runtimeType, text, const DeepCollectionEquality().hash(_attachments), const DeepCollectionEquality().hash(_segments), ); } @override String toString() { return 'AgentComposerMessage(text: $text, attachments: $attachments, segments: $segments)'; } } /// @nodoc abstract mixin class _$AgentComposerMessageCopyWith<$Res> implements $AgentComposerMessageCopyWith<$Res> { factory _$AgentComposerMessageCopyWith( _AgentComposerMessage value, $Res Function(_AgentComposerMessage) _then, ) = __$AgentComposerMessageCopyWithImpl; @override @useResult $Res call({ String text, List attachments, List segments, }); } /// @nodoc class __$AgentComposerMessageCopyWithImpl<$Res> implements _$AgentComposerMessageCopyWith<$Res> { __$AgentComposerMessageCopyWithImpl(this._self, this._then); final _AgentComposerMessage _self; final $Res Function(_AgentComposerMessage) _then; /// Create a copy of AgentComposerMessage /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({ Object? text = null, Object? attachments = null, Object? segments = null, }) { return _then( _AgentComposerMessage( text: null == text ? _self.text : text // ignore: cast_nullable_to_non_nullable as String, attachments: null == attachments ? _self._attachments : attachments // ignore: cast_nullable_to_non_nullable as List, segments: null == segments ? _self._segments : segments // ignore: cast_nullable_to_non_nullable as List, ), ); } }