-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.freezed.dart
More file actions
1599 lines (1332 loc) · 72.5 KB
/
models.freezed.dart
File metadata and controls
1599 lines (1332 loc) · 72.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// 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 'models.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$Model {
/// [id] is the unique identifier of the model.
String get id;/// [name] is the name of the model.
String get name;/// [flespiId] is the ID of the device in the flespi platform.
/// Can be null if the model is not connected to a device or is a in-house protocol.
String? get flespiId;/// [protocol] is the protocol of the model.
InboundProtocol? get protocol;/// [protocolId] is the ID of the protocol
String? get protocolId;/// [isGeneric] is true if the model is generic.
bool? get isGeneric;/// [commandsStructure] is the structure of the commands for the protocol.
List<CommandDefinition> get commandsStructure;/// [configStructure] is the structure of the configuration for the protocol.
List<ConfigGrouping> get configStructure;/// [confiotCapable] is the boolean that indicates if the protocol is capable of using the Confiot platform.
bool get confiotCapable;/// [confiotLayout] defines what kind of layout should be displayed in ConfIoT.
@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout get confiotLayout;/// [confiotName] is the name of the model in the ConfIoT.
String? get confiotName;/// [peripheralIdentifier] is the identifier of the peripheral device.
String? get peripheralIdentifier;/// [peripheralParserSpec] is the parser specification for the peripheral device.
Map<String, dynamic>? get peripheralParserSpec;/// [firmwares] is the list of firmwares for the model.
List<FirmwareBuild> get firmwares;/// The icon of the model, if not exists, you must render the protocol icon
@IconOrNullConverter() LayrzIcon? get icon;/// Indicates the rendering widget, useful to render visually the kind of device
@JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget get widget;
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ModelCopyWith<Model> get copyWith => _$ModelCopyWithImpl<Model>(this as Model, _$identity);
/// Serializes this Model to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Model&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.flespiId, flespiId) || other.flespiId == flespiId)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.protocolId, protocolId) || other.protocolId == protocolId)&&(identical(other.isGeneric, isGeneric) || other.isGeneric == isGeneric)&&const DeepCollectionEquality().equals(other.commandsStructure, commandsStructure)&&const DeepCollectionEquality().equals(other.configStructure, configStructure)&&(identical(other.confiotCapable, confiotCapable) || other.confiotCapable == confiotCapable)&&(identical(other.confiotLayout, confiotLayout) || other.confiotLayout == confiotLayout)&&(identical(other.confiotName, confiotName) || other.confiotName == confiotName)&&(identical(other.peripheralIdentifier, peripheralIdentifier) || other.peripheralIdentifier == peripheralIdentifier)&&const DeepCollectionEquality().equals(other.peripheralParserSpec, peripheralParserSpec)&&const DeepCollectionEquality().equals(other.firmwares, firmwares)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.widget, widget) || other.widget == widget));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name,flespiId,protocol,protocolId,isGeneric,const DeepCollectionEquality().hash(commandsStructure),const DeepCollectionEquality().hash(configStructure),confiotCapable,confiotLayout,confiotName,peripheralIdentifier,const DeepCollectionEquality().hash(peripheralParserSpec),const DeepCollectionEquality().hash(firmwares),icon,widget);
@override
String toString() {
return 'Model(id: $id, name: $name, flespiId: $flespiId, protocol: $protocol, protocolId: $protocolId, isGeneric: $isGeneric, commandsStructure: $commandsStructure, configStructure: $configStructure, confiotCapable: $confiotCapable, confiotLayout: $confiotLayout, confiotName: $confiotName, peripheralIdentifier: $peripheralIdentifier, peripheralParserSpec: $peripheralParserSpec, firmwares: $firmwares, icon: $icon, widget: $widget)';
}
}
/// @nodoc
abstract mixin class $ModelCopyWith<$Res> {
factory $ModelCopyWith(Model value, $Res Function(Model) _then) = _$ModelCopyWithImpl;
@useResult
$Res call({
String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable,@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares,@IconOrNullConverter() LayrzIcon? icon,@JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget widget
});
$InboundProtocolCopyWith<$Res>? get protocol;
}
/// @nodoc
class _$ModelCopyWithImpl<$Res>
implements $ModelCopyWith<$Res> {
_$ModelCopyWithImpl(this._self, this._then);
final Model _self;
final $Res Function(Model) _then;
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? flespiId = freezed,Object? protocol = freezed,Object? protocolId = freezed,Object? isGeneric = freezed,Object? commandsStructure = null,Object? configStructure = null,Object? confiotCapable = null,Object? confiotLayout = null,Object? confiotName = freezed,Object? peripheralIdentifier = freezed,Object? peripheralParserSpec = freezed,Object? firmwares = null,Object? icon = freezed,Object? widget = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,flespiId: freezed == flespiId ? _self.flespiId : flespiId // ignore: cast_nullable_to_non_nullable
as String?,protocol: freezed == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
as InboundProtocol?,protocolId: freezed == protocolId ? _self.protocolId : protocolId // ignore: cast_nullable_to_non_nullable
as String?,isGeneric: freezed == isGeneric ? _self.isGeneric : isGeneric // ignore: cast_nullable_to_non_nullable
as bool?,commandsStructure: null == commandsStructure ? _self.commandsStructure : commandsStructure // ignore: cast_nullable_to_non_nullable
as List<CommandDefinition>,configStructure: null == configStructure ? _self.configStructure : configStructure // ignore: cast_nullable_to_non_nullable
as List<ConfigGrouping>,confiotCapable: null == confiotCapable ? _self.confiotCapable : confiotCapable // ignore: cast_nullable_to_non_nullable
as bool,confiotLayout: null == confiotLayout ? _self.confiotLayout : confiotLayout // ignore: cast_nullable_to_non_nullable
as ConfIoTLayout,confiotName: freezed == confiotName ? _self.confiotName : confiotName // ignore: cast_nullable_to_non_nullable
as String?,peripheralIdentifier: freezed == peripheralIdentifier ? _self.peripheralIdentifier : peripheralIdentifier // ignore: cast_nullable_to_non_nullable
as String?,peripheralParserSpec: freezed == peripheralParserSpec ? _self.peripheralParserSpec : peripheralParserSpec // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,firmwares: null == firmwares ? _self.firmwares : firmwares // ignore: cast_nullable_to_non_nullable
as List<FirmwareBuild>,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
as LayrzIcon?,widget: null == widget ? _self.widget : widget // ignore: cast_nullable_to_non_nullable
as RenderWidget,
));
}
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$InboundProtocolCopyWith<$Res>? get protocol {
if (_self.protocol == null) {
return null;
}
return $InboundProtocolCopyWith<$Res>(_self.protocol!, (value) {
return _then(_self.copyWith(protocol: value));
});
}
}
/// Adds pattern-matching-related methods to [Model].
extension ModelPatterns on Model {
/// 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 extends Object?>(TResult Function( _Model value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Model() 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 extends Object?>(TResult Function( _Model value) $default,){
final _that = this;
switch (_that) {
case _Model():
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 extends Object?>(TResult? Function( _Model value)? $default,){
final _that = this;
switch (_that) {
case _Model() 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 extends Object?>(TResult Function( String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares, @IconOrNullConverter() LayrzIcon? icon, @JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget widget)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Model() when $default != null:
return $default(_that.id,_that.name,_that.flespiId,_that.protocol,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec,_that.firmwares,_that.icon,_that.widget);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 extends Object?>(TResult Function( String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares, @IconOrNullConverter() LayrzIcon? icon, @JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget widget) $default,) {final _that = this;
switch (_that) {
case _Model():
return $default(_that.id,_that.name,_that.flespiId,_that.protocol,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec,_that.firmwares,_that.icon,_that.widget);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 extends Object?>(TResult? Function( String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares, @IconOrNullConverter() LayrzIcon? icon, @JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget widget)? $default,) {final _that = this;
switch (_that) {
case _Model() when $default != null:
return $default(_that.id,_that.name,_that.flespiId,_that.protocol,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec,_that.firmwares,_that.icon,_that.widget);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _Model implements Model {
const _Model({required this.id, required this.name, this.flespiId, this.protocol, this.protocolId, this.isGeneric, final List<CommandDefinition> commandsStructure = const [], final List<ConfigGrouping> configStructure = const [], this.confiotCapable = false, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) this.confiotLayout = ConfIoTLayout.standard, this.confiotName, this.peripheralIdentifier, final Map<String, dynamic>? peripheralParserSpec, final List<FirmwareBuild> firmwares = const [], @IconOrNullConverter() this.icon, @JsonKey(unknownEnumValue: RenderWidget.unknown) this.widget = RenderWidget.unknown}): _commandsStructure = commandsStructure,_configStructure = configStructure,_peripheralParserSpec = peripheralParserSpec,_firmwares = firmwares;
factory _Model.fromJson(Map<String, dynamic> json) => _$ModelFromJson(json);
/// [id] is the unique identifier of the model.
@override final String id;
/// [name] is the name of the model.
@override final String name;
/// [flespiId] is the ID of the device in the flespi platform.
/// Can be null if the model is not connected to a device or is a in-house protocol.
@override final String? flespiId;
/// [protocol] is the protocol of the model.
@override final InboundProtocol? protocol;
/// [protocolId] is the ID of the protocol
@override final String? protocolId;
/// [isGeneric] is true if the model is generic.
@override final bool? isGeneric;
/// [commandsStructure] is the structure of the commands for the protocol.
final List<CommandDefinition> _commandsStructure;
/// [commandsStructure] is the structure of the commands for the protocol.
@override@JsonKey() List<CommandDefinition> get commandsStructure {
if (_commandsStructure is EqualUnmodifiableListView) return _commandsStructure;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_commandsStructure);
}
/// [configStructure] is the structure of the configuration for the protocol.
final List<ConfigGrouping> _configStructure;
/// [configStructure] is the structure of the configuration for the protocol.
@override@JsonKey() List<ConfigGrouping> get configStructure {
if (_configStructure is EqualUnmodifiableListView) return _configStructure;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_configStructure);
}
/// [confiotCapable] is the boolean that indicates if the protocol is capable of using the Confiot platform.
@override@JsonKey() final bool confiotCapable;
/// [confiotLayout] defines what kind of layout should be displayed in ConfIoT.
@override@JsonKey(unknownEnumValue: ConfIoTLayout.standard) final ConfIoTLayout confiotLayout;
/// [confiotName] is the name of the model in the ConfIoT.
@override final String? confiotName;
/// [peripheralIdentifier] is the identifier of the peripheral device.
@override final String? peripheralIdentifier;
/// [peripheralParserSpec] is the parser specification for the peripheral device.
final Map<String, dynamic>? _peripheralParserSpec;
/// [peripheralParserSpec] is the parser specification for the peripheral device.
@override Map<String, dynamic>? get peripheralParserSpec {
final value = _peripheralParserSpec;
if (value == null) return null;
if (_peripheralParserSpec is EqualUnmodifiableMapView) return _peripheralParserSpec;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}
/// [firmwares] is the list of firmwares for the model.
final List<FirmwareBuild> _firmwares;
/// [firmwares] is the list of firmwares for the model.
@override@JsonKey() List<FirmwareBuild> get firmwares {
if (_firmwares is EqualUnmodifiableListView) return _firmwares;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_firmwares);
}
/// The icon of the model, if not exists, you must render the protocol icon
@override@IconOrNullConverter() final LayrzIcon? icon;
/// Indicates the rendering widget, useful to render visually the kind of device
@override@JsonKey(unknownEnumValue: RenderWidget.unknown) final RenderWidget widget;
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ModelCopyWith<_Model> get copyWith => __$ModelCopyWithImpl<_Model>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Model&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.flespiId, flespiId) || other.flespiId == flespiId)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.protocolId, protocolId) || other.protocolId == protocolId)&&(identical(other.isGeneric, isGeneric) || other.isGeneric == isGeneric)&&const DeepCollectionEquality().equals(other._commandsStructure, _commandsStructure)&&const DeepCollectionEquality().equals(other._configStructure, _configStructure)&&(identical(other.confiotCapable, confiotCapable) || other.confiotCapable == confiotCapable)&&(identical(other.confiotLayout, confiotLayout) || other.confiotLayout == confiotLayout)&&(identical(other.confiotName, confiotName) || other.confiotName == confiotName)&&(identical(other.peripheralIdentifier, peripheralIdentifier) || other.peripheralIdentifier == peripheralIdentifier)&&const DeepCollectionEquality().equals(other._peripheralParserSpec, _peripheralParserSpec)&&const DeepCollectionEquality().equals(other._firmwares, _firmwares)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.widget, widget) || other.widget == widget));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name,flespiId,protocol,protocolId,isGeneric,const DeepCollectionEquality().hash(_commandsStructure),const DeepCollectionEquality().hash(_configStructure),confiotCapable,confiotLayout,confiotName,peripheralIdentifier,const DeepCollectionEquality().hash(_peripheralParserSpec),const DeepCollectionEquality().hash(_firmwares),icon,widget);
@override
String toString() {
return 'Model(id: $id, name: $name, flespiId: $flespiId, protocol: $protocol, protocolId: $protocolId, isGeneric: $isGeneric, commandsStructure: $commandsStructure, configStructure: $configStructure, confiotCapable: $confiotCapable, confiotLayout: $confiotLayout, confiotName: $confiotName, peripheralIdentifier: $peripheralIdentifier, peripheralParserSpec: $peripheralParserSpec, firmwares: $firmwares, icon: $icon, widget: $widget)';
}
}
/// @nodoc
abstract mixin class _$ModelCopyWith<$Res> implements $ModelCopyWith<$Res> {
factory _$ModelCopyWith(_Model value, $Res Function(_Model) _then) = __$ModelCopyWithImpl;
@override @useResult
$Res call({
String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable,@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares,@IconOrNullConverter() LayrzIcon? icon,@JsonKey(unknownEnumValue: RenderWidget.unknown) RenderWidget widget
});
@override $InboundProtocolCopyWith<$Res>? get protocol;
}
/// @nodoc
class __$ModelCopyWithImpl<$Res>
implements _$ModelCopyWith<$Res> {
__$ModelCopyWithImpl(this._self, this._then);
final _Model _self;
final $Res Function(_Model) _then;
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? flespiId = freezed,Object? protocol = freezed,Object? protocolId = freezed,Object? isGeneric = freezed,Object? commandsStructure = null,Object? configStructure = null,Object? confiotCapable = null,Object? confiotLayout = null,Object? confiotName = freezed,Object? peripheralIdentifier = freezed,Object? peripheralParserSpec = freezed,Object? firmwares = null,Object? icon = freezed,Object? widget = null,}) {
return _then(_Model(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,flespiId: freezed == flespiId ? _self.flespiId : flespiId // ignore: cast_nullable_to_non_nullable
as String?,protocol: freezed == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
as InboundProtocol?,protocolId: freezed == protocolId ? _self.protocolId : protocolId // ignore: cast_nullable_to_non_nullable
as String?,isGeneric: freezed == isGeneric ? _self.isGeneric : isGeneric // ignore: cast_nullable_to_non_nullable
as bool?,commandsStructure: null == commandsStructure ? _self._commandsStructure : commandsStructure // ignore: cast_nullable_to_non_nullable
as List<CommandDefinition>,configStructure: null == configStructure ? _self._configStructure : configStructure // ignore: cast_nullable_to_non_nullable
as List<ConfigGrouping>,confiotCapable: null == confiotCapable ? _self.confiotCapable : confiotCapable // ignore: cast_nullable_to_non_nullable
as bool,confiotLayout: null == confiotLayout ? _self.confiotLayout : confiotLayout // ignore: cast_nullable_to_non_nullable
as ConfIoTLayout,confiotName: freezed == confiotName ? _self.confiotName : confiotName // ignore: cast_nullable_to_non_nullable
as String?,peripheralIdentifier: freezed == peripheralIdentifier ? _self.peripheralIdentifier : peripheralIdentifier // ignore: cast_nullable_to_non_nullable
as String?,peripheralParserSpec: freezed == peripheralParserSpec ? _self._peripheralParserSpec : peripheralParserSpec // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,firmwares: null == firmwares ? _self._firmwares : firmwares // ignore: cast_nullable_to_non_nullable
as List<FirmwareBuild>,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
as LayrzIcon?,widget: null == widget ? _self.widget : widget // ignore: cast_nullable_to_non_nullable
as RenderWidget,
));
}
/// Create a copy of Model
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$InboundProtocolCopyWith<$Res>? get protocol {
if (_self.protocol == null) {
return null;
}
return $InboundProtocolCopyWith<$Res>(_self.protocol!, (value) {
return _then(_self.copyWith(protocol: value));
});
}
}
/// @nodoc
mixin _$ModelInput {
/// [id] is the unique identifier of the model.
String? get id;/// [id] is the unique identifier of the model.
set id(String? value);/// [name] is the name of the model.
String get name;/// [name] is the name of the model.
set name(String value);/// [flespiId] is the ID of the device in the flespi platform.
/// Can be null if the model is not connected to a device or is a in-house protocol.
String? get flespiId;/// [flespiId] is the ID of the device in the flespi platform.
/// Can be null if the model is not connected to a device or is a in-house protocol.
set flespiId(String? value);/// [protocolId] is the ID of the protocol
String? get protocolId;/// [protocolId] is the ID of the protocol
set protocolId(String? value);/// [isGeneric] is true if the model is generic. Only can be 1 generic model per protocol.
bool get isGeneric;/// [isGeneric] is true if the model is generic. Only can be 1 generic model per protocol.
set isGeneric(bool value);/// [commandsStructure] is the structure of the commands for the protocol.
List<CommandDefinitionInput> get commandsStructure;/// [commandsStructure] is the structure of the commands for the protocol.
set commandsStructure(List<CommandDefinitionInput> value);/// [configStructure] is the structure of the configuration for the protocol.
List<ConfigGroupingInput> get configStructure;/// [configStructure] is the structure of the configuration for the protocol.
set configStructure(List<ConfigGroupingInput> value);/// [confiotCapable] is the boolean that indicates if the protocol is capable of using the Confiot platform.
bool get confiotCapable;/// [confiotCapable] is the boolean that indicates if the protocol is capable of using the Confiot platform.
set confiotCapable(bool value);/// [confiotLayout] defines what kind of layout should be displayed in ConfIoT.
@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout get confiotLayout;/// [confiotLayout] defines what kind of layout should be displayed in ConfIoT.
@JsonKey(unknownEnumValue: ConfIoTLayout.standard) set confiotLayout(ConfIoTLayout value);/// [confiotName] is the name of the model in the ConfIoT.
String? get confiotName;/// [confiotName] is the name of the model in the ConfIoT.
set confiotName(String? value);/// [peripheralIdentifier] is the identifier of the peripheral device.
String? get peripheralIdentifier;/// [peripheralIdentifier] is the identifier of the peripheral device.
set peripheralIdentifier(String? value);/// [peripheralParserSpec] is the parser specification for the peripheral device.
Map<String, dynamic>? get peripheralParserSpec;/// [peripheralParserSpec] is the parser specification for the peripheral device.
set peripheralParserSpec(Map<String, dynamic>? value);
/// Create a copy of ModelInput
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ModelInputCopyWith<ModelInput> get copyWith => _$ModelInputCopyWithImpl<ModelInput>(this as ModelInput, _$identity);
/// Serializes this ModelInput to a JSON map.
Map<String, dynamic> toJson();
@override
String toString() {
return 'ModelInput(id: $id, name: $name, flespiId: $flespiId, protocolId: $protocolId, isGeneric: $isGeneric, commandsStructure: $commandsStructure, configStructure: $configStructure, confiotCapable: $confiotCapable, confiotLayout: $confiotLayout, confiotName: $confiotName, peripheralIdentifier: $peripheralIdentifier, peripheralParserSpec: $peripheralParserSpec)';
}
}
/// @nodoc
abstract mixin class $ModelInputCopyWith<$Res> {
factory $ModelInputCopyWith(ModelInput value, $Res Function(ModelInput) _then) = _$ModelInputCopyWithImpl;
@useResult
$Res call({
String? id, String name, String? flespiId, String? protocolId, bool isGeneric, List<CommandDefinitionInput> commandsStructure, List<ConfigGroupingInput> configStructure, bool confiotCapable,@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec
});
}
/// @nodoc
class _$ModelInputCopyWithImpl<$Res>
implements $ModelInputCopyWith<$Res> {
_$ModelInputCopyWithImpl(this._self, this._then);
final ModelInput _self;
final $Res Function(ModelInput) _then;
/// Create a copy of ModelInput
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? name = null,Object? flespiId = freezed,Object? protocolId = freezed,Object? isGeneric = null,Object? commandsStructure = null,Object? configStructure = null,Object? confiotCapable = null,Object? confiotLayout = null,Object? confiotName = freezed,Object? peripheralIdentifier = freezed,Object? peripheralParserSpec = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,flespiId: freezed == flespiId ? _self.flespiId : flespiId // ignore: cast_nullable_to_non_nullable
as String?,protocolId: freezed == protocolId ? _self.protocolId : protocolId // ignore: cast_nullable_to_non_nullable
as String?,isGeneric: null == isGeneric ? _self.isGeneric : isGeneric // ignore: cast_nullable_to_non_nullable
as bool,commandsStructure: null == commandsStructure ? _self.commandsStructure : commandsStructure // ignore: cast_nullable_to_non_nullable
as List<CommandDefinitionInput>,configStructure: null == configStructure ? _self.configStructure : configStructure // ignore: cast_nullable_to_non_nullable
as List<ConfigGroupingInput>,confiotCapable: null == confiotCapable ? _self.confiotCapable : confiotCapable // ignore: cast_nullable_to_non_nullable
as bool,confiotLayout: null == confiotLayout ? _self.confiotLayout : confiotLayout // ignore: cast_nullable_to_non_nullable
as ConfIoTLayout,confiotName: freezed == confiotName ? _self.confiotName : confiotName // ignore: cast_nullable_to_non_nullable
as String?,peripheralIdentifier: freezed == peripheralIdentifier ? _self.peripheralIdentifier : peripheralIdentifier // ignore: cast_nullable_to_non_nullable
as String?,peripheralParserSpec: freezed == peripheralParserSpec ? _self.peripheralParserSpec : peripheralParserSpec // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
));
}
}
/// Adds pattern-matching-related methods to [ModelInput].
extension ModelInputPatterns on ModelInput {
/// 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 extends Object?>(TResult Function( _ModelInput value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ModelInput() 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 extends Object?>(TResult Function( _ModelInput value) $default,){
final _that = this;
switch (_that) {
case _ModelInput():
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 extends Object?>(TResult? Function( _ModelInput value)? $default,){
final _that = this;
switch (_that) {
case _ModelInput() 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 extends Object?>(TResult Function( String? id, String name, String? flespiId, String? protocolId, bool isGeneric, List<CommandDefinitionInput> commandsStructure, List<ConfigGroupingInput> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ModelInput() when $default != null:
return $default(_that.id,_that.name,_that.flespiId,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec);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 extends Object?>(TResult Function( String? id, String name, String? flespiId, String? protocolId, bool isGeneric, List<CommandDefinitionInput> commandsStructure, List<ConfigGroupingInput> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec) $default,) {final _that = this;
switch (_that) {
case _ModelInput():
return $default(_that.id,_that.name,_that.flespiId,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec);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 extends Object?>(TResult? Function( String? id, String name, String? flespiId, String? protocolId, bool isGeneric, List<CommandDefinitionInput> commandsStructure, List<ConfigGroupingInput> configStructure, bool confiotCapable, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec)? $default,) {final _that = this;
switch (_that) {
case _ModelInput() when $default != null:
return $default(_that.id,_that.name,_that.flespiId,_that.protocolId,_that.isGeneric,_that.commandsStructure,_that.configStructure,_that.confiotCapable,_that.confiotLayout,_that.confiotName,_that.peripheralIdentifier,_that.peripheralParserSpec);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ModelInput implements ModelInput {
_ModelInput({this.id, this.name = '', this.flespiId, this.protocolId, this.isGeneric = false, this.commandsStructure = const [], this.configStructure = const [], this.confiotCapable = false, @JsonKey(unknownEnumValue: ConfIoTLayout.standard) this.confiotLayout = ConfIoTLayout.standard, this.confiotName, this.peripheralIdentifier, this.peripheralParserSpec});
factory _ModelInput.fromJson(Map<String, dynamic> json) => _$ModelInputFromJson(json);
/// [id] is the unique identifier of the model.
@override String? id;
/// [name] is the name of the model.
@override@JsonKey() String name;
/// [flespiId] is the ID of the device in the flespi platform.
/// Can be null if the model is not connected to a device or is a in-house protocol.
@override String? flespiId;
/// [protocolId] is the ID of the protocol
@override String? protocolId;
/// [isGeneric] is true if the model is generic. Only can be 1 generic model per protocol.
@override@JsonKey() bool isGeneric;
/// [commandsStructure] is the structure of the commands for the protocol.
@override@JsonKey() List<CommandDefinitionInput> commandsStructure;
/// [configStructure] is the structure of the configuration for the protocol.
@override@JsonKey() List<ConfigGroupingInput> configStructure;
/// [confiotCapable] is the boolean that indicates if the protocol is capable of using the Confiot platform.
@override@JsonKey() bool confiotCapable;
/// [confiotLayout] defines what kind of layout should be displayed in ConfIoT.
@override@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout;
/// [confiotName] is the name of the model in the ConfIoT.
@override String? confiotName;
/// [peripheralIdentifier] is the identifier of the peripheral device.
@override String? peripheralIdentifier;
/// [peripheralParserSpec] is the parser specification for the peripheral device.
@override Map<String, dynamic>? peripheralParserSpec;
/// Create a copy of ModelInput
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ModelInputCopyWith<_ModelInput> get copyWith => __$ModelInputCopyWithImpl<_ModelInput>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ModelInputToJson(this, );
}
@override
String toString() {
return 'ModelInput(id: $id, name: $name, flespiId: $flespiId, protocolId: $protocolId, isGeneric: $isGeneric, commandsStructure: $commandsStructure, configStructure: $configStructure, confiotCapable: $confiotCapable, confiotLayout: $confiotLayout, confiotName: $confiotName, peripheralIdentifier: $peripheralIdentifier, peripheralParserSpec: $peripheralParserSpec)';
}
}
/// @nodoc
abstract mixin class _$ModelInputCopyWith<$Res> implements $ModelInputCopyWith<$Res> {
factory _$ModelInputCopyWith(_ModelInput value, $Res Function(_ModelInput) _then) = __$ModelInputCopyWithImpl;
@override @useResult
$Res call({
String? id, String name, String? flespiId, String? protocolId, bool isGeneric, List<CommandDefinitionInput> commandsStructure, List<ConfigGroupingInput> configStructure, bool confiotCapable,@JsonKey(unknownEnumValue: ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec
});
}
/// @nodoc
class __$ModelInputCopyWithImpl<$Res>
implements _$ModelInputCopyWith<$Res> {
__$ModelInputCopyWithImpl(this._self, this._then);
final _ModelInput _self;
final $Res Function(_ModelInput) _then;
/// Create a copy of ModelInput
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? name = null,Object? flespiId = freezed,Object? protocolId = freezed,Object? isGeneric = null,Object? commandsStructure = null,Object? configStructure = null,Object? confiotCapable = null,Object? confiotLayout = null,Object? confiotName = freezed,Object? peripheralIdentifier = freezed,Object? peripheralParserSpec = freezed,}) {
return _then(_ModelInput(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,flespiId: freezed == flespiId ? _self.flespiId : flespiId // ignore: cast_nullable_to_non_nullable
as String?,protocolId: freezed == protocolId ? _self.protocolId : protocolId // ignore: cast_nullable_to_non_nullable
as String?,isGeneric: null == isGeneric ? _self.isGeneric : isGeneric // ignore: cast_nullable_to_non_nullable
as bool,commandsStructure: null == commandsStructure ? _self.commandsStructure : commandsStructure // ignore: cast_nullable_to_non_nullable
as List<CommandDefinitionInput>,configStructure: null == configStructure ? _self.configStructure : configStructure // ignore: cast_nullable_to_non_nullable
as List<ConfigGroupingInput>,confiotCapable: null == confiotCapable ? _self.confiotCapable : confiotCapable // ignore: cast_nullable_to_non_nullable
as bool,confiotLayout: null == confiotLayout ? _self.confiotLayout : confiotLayout // ignore: cast_nullable_to_non_nullable
as ConfIoTLayout,confiotName: freezed == confiotName ? _self.confiotName : confiotName // ignore: cast_nullable_to_non_nullable
as String?,peripheralIdentifier: freezed == peripheralIdentifier ? _self.peripheralIdentifier : peripheralIdentifier // ignore: cast_nullable_to_non_nullable
as String?,peripheralParserSpec: freezed == peripheralParserSpec ? _self.peripheralParserSpec : peripheralParserSpec // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
));
}
}
/// @nodoc
mixin _$HwModel {
/// [id] is the unique identifier of the model.
String get id;/// [name] is the name of the model.
String get name;/// [modelsIds] is the list of the models IDs that are part of this model.
List<String> get modelsIds;/// [models] is the list of the models that are part of this model.
List<Model> get models;
/// Create a copy of HwModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$HwModelCopyWith<HwModel> get copyWith => _$HwModelCopyWithImpl<HwModel>(this as HwModel, _$identity);
/// Serializes this HwModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is HwModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&const DeepCollectionEquality().equals(other.modelsIds, modelsIds)&&const DeepCollectionEquality().equals(other.models, models));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name,const DeepCollectionEquality().hash(modelsIds),const DeepCollectionEquality().hash(models));
@override
String toString() {
return 'HwModel(id: $id, name: $name, modelsIds: $modelsIds, models: $models)';
}
}
/// @nodoc
abstract mixin class $HwModelCopyWith<$Res> {
factory $HwModelCopyWith(HwModel value, $Res Function(HwModel) _then) = _$HwModelCopyWithImpl;
@useResult
$Res call({
String id, String name, List<String> modelsIds, List<Model> models
});
}
/// @nodoc
class _$HwModelCopyWithImpl<$Res>
implements $HwModelCopyWith<$Res> {
_$HwModelCopyWithImpl(this._self, this._then);
final HwModel _self;
final $Res Function(HwModel) _then;
/// Create a copy of HwModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? modelsIds = null,Object? models = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,modelsIds: null == modelsIds ? _self.modelsIds : modelsIds // ignore: cast_nullable_to_non_nullable
as List<String>,models: null == models ? _self.models : models // ignore: cast_nullable_to_non_nullable
as List<Model>,
));
}
}
/// Adds pattern-matching-related methods to [HwModel].
extension HwModelPatterns on HwModel {
/// 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 extends Object?>(TResult Function( _HwModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _HwModel() 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 extends Object?>(TResult Function( _HwModel value) $default,){
final _that = this;
switch (_that) {
case _HwModel():
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 extends Object?>(TResult? Function( _HwModel value)? $default,){
final _that = this;
switch (_that) {
case _HwModel() 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 extends Object?>(TResult Function( String id, String name, List<String> modelsIds, List<Model> models)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _HwModel() when $default != null:
return $default(_that.id,_that.name,_that.modelsIds,_that.models);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 extends Object?>(TResult Function( String id, String name, List<String> modelsIds, List<Model> models) $default,) {final _that = this;
switch (_that) {
case _HwModel():
return $default(_that.id,_that.name,_that.modelsIds,_that.models);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 extends Object?>(TResult? Function( String id, String name, List<String> modelsIds, List<Model> models)? $default,) {final _that = this;
switch (_that) {
case _HwModel() when $default != null:
return $default(_that.id,_that.name,_that.modelsIds,_that.models);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _HwModel implements HwModel {
const _HwModel({required this.id, required this.name, final List<String> modelsIds = const [], final List<Model> models = const []}): _modelsIds = modelsIds,_models = models;
factory _HwModel.fromJson(Map<String, dynamic> json) => _$HwModelFromJson(json);
/// [id] is the unique identifier of the model.
@override final String id;
/// [name] is the name of the model.
@override final String name;
/// [modelsIds] is the list of the models IDs that are part of this model.
final List<String> _modelsIds;
/// [modelsIds] is the list of the models IDs that are part of this model.
@override@JsonKey() List<String> get modelsIds {
if (_modelsIds is EqualUnmodifiableListView) return _modelsIds;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_modelsIds);
}
/// [models] is the list of the models that are part of this model.
final List<Model> _models;
/// [models] is the list of the models that are part of this model.
@override@JsonKey() List<Model> get models {
if (_models is EqualUnmodifiableListView) return _models;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_models);
}
/// Create a copy of HwModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$HwModelCopyWith<_HwModel> get copyWith => __$HwModelCopyWithImpl<_HwModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$HwModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HwModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&const DeepCollectionEquality().equals(other._modelsIds, _modelsIds)&&const DeepCollectionEquality().equals(other._models, _models));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name,const DeepCollectionEquality().hash(_modelsIds),const DeepCollectionEquality().hash(_models));
@override
String toString() {
return 'HwModel(id: $id, name: $name, modelsIds: $modelsIds, models: $models)';
}
}
/// @nodoc
abstract mixin class _$HwModelCopyWith<$Res> implements $HwModelCopyWith<$Res> {
factory _$HwModelCopyWith(_HwModel value, $Res Function(_HwModel) _then) = __$HwModelCopyWithImpl;
@override @useResult
$Res call({
String id, String name, List<String> modelsIds, List<Model> models
});