// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.18 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class EventAgendaDTO { /// Returns a new [EventAgendaDTO] instance. EventAgendaDTO({ this.id, this.label = const [], this.description = const [], this.type, this.dateAdded, this.dateFrom, this.dateTo, this.website, this.resourceId, this.resource, this.address, this.phone, this.email, this.sectionAgendaId, this.sectionEventId, }); /// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// int? id; List? label; List? description; String? type; DateTime? dateAdded; DateTime? dateFrom; DateTime? dateTo; String? website; String? resourceId; EventAgendaDTOResource? resource; EventAgendaDTOAddress? address; String? phone; String? email; String? sectionAgendaId; String? sectionEventId; @override bool operator ==(Object other) => identical(this, other) || other is EventAgendaDTO && other.id == id && _deepEquality.equals(other.label, label) && _deepEquality.equals(other.description, description) && other.type == type && other.dateAdded == dateAdded && other.dateFrom == dateFrom && other.dateTo == dateTo && other.website == website && other.resourceId == resourceId && other.resource == resource && other.address == address && other.phone == phone && other.email == email && other.sectionAgendaId == sectionAgendaId && other.sectionEventId == sectionEventId; @override int get hashCode => // ignore: unnecessary_parenthesis (id == null ? 0 : id!.hashCode) + (label == null ? 0 : label!.hashCode) + (description == null ? 0 : description!.hashCode) + (type == null ? 0 : type!.hashCode) + (dateAdded == null ? 0 : dateAdded!.hashCode) + (dateFrom == null ? 0 : dateFrom!.hashCode) + (dateTo == null ? 0 : dateTo!.hashCode) + (website == null ? 0 : website!.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + (resource == null ? 0 : resource!.hashCode) + (address == null ? 0 : address!.hashCode) + (phone == null ? 0 : phone!.hashCode) + (email == null ? 0 : email!.hashCode) + (sectionAgendaId == null ? 0 : sectionAgendaId!.hashCode) + (sectionEventId == null ? 0 : sectionEventId!.hashCode); @override String toString() => 'EventAgendaDTO[id=$id, label=$label, description=$description, type=$type, dateAdded=$dateAdded, dateFrom=$dateFrom, dateTo=$dateTo, website=$website, resourceId=$resourceId, resource=$resource, address=$address, phone=$phone, email=$email, sectionAgendaId=$sectionAgendaId, sectionEventId=$sectionEventId]'; Map toJson() { final json = {}; if (this.id != null) { json[r'id'] = this.id; } else { json[r'id'] = null; } if (this.label != null) { json[r'label'] = this.label; } else { json[r'label'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { json[r'description'] = null; } if (this.type != null) { json[r'type'] = this.type; } else { json[r'type'] = null; } if (this.dateAdded != null) { json[r'dateAdded'] = this.dateAdded!.toUtc().toIso8601String(); } else { json[r'dateAdded'] = null; } if (this.dateFrom != null) { json[r'dateFrom'] = this.dateFrom!.toUtc().toIso8601String(); } else { json[r'dateFrom'] = null; } if (this.dateTo != null) { json[r'dateTo'] = this.dateTo!.toUtc().toIso8601String(); } else { json[r'dateTo'] = null; } if (this.website != null) { json[r'website'] = this.website; } else { json[r'website'] = null; } if (this.resourceId != null) { json[r'resourceId'] = this.resourceId; } else { json[r'resourceId'] = null; } if (this.resource != null) { json[r'resource'] = this.resource; } else { json[r'resource'] = null; } if (this.address != null) { json[r'address'] = this.address; } else { json[r'address'] = null; } if (this.phone != null) { json[r'phone'] = this.phone; } else { json[r'phone'] = null; } if (this.email != null) { json[r'email'] = this.email; } else { json[r'email'] = null; } if (this.sectionAgendaId != null) { json[r'sectionAgendaId'] = this.sectionAgendaId; } else { json[r'sectionAgendaId'] = null; } if (this.sectionEventId != null) { json[r'sectionEventId'] = this.sectionEventId; } else { json[r'sectionEventId'] = null; } return json; } /// Returns a new [EventAgendaDTO] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static EventAgendaDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); // Ensure that the map contains the required keys. // Note 1: the values aren't checked for validity beyond being non-null. // Note 2: this code is stripped in release mode! assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), 'Required key "EventAgendaDTO[$key]" is missing from JSON.'); assert(json[key] != null, 'Required key "EventAgendaDTO[$key]" has a null value in JSON.'); }); return true; }()); return EventAgendaDTO( id: mapValueOfType(json, r'id'), label: TranslationDTO.listFromJson(json[r'label']), description: TranslationDTO.listFromJson(json[r'description']), type: mapValueOfType(json, r'type'), dateAdded: mapDateTime(json, r'dateAdded', r''), dateFrom: mapDateTime(json, r'dateFrom', r''), dateTo: mapDateTime(json, r'dateTo', r''), website: mapValueOfType(json, r'website'), resourceId: mapValueOfType(json, r'resourceId'), resource: EventAgendaDTOResource.fromJson(json[r'resource']), address: EventAgendaDTOAddress.fromJson(json[r'address']), phone: mapValueOfType(json, r'phone'), email: mapValueOfType(json, r'email'), sectionAgendaId: mapValueOfType(json, r'sectionAgendaId'), sectionEventId: mapValueOfType(json, r'sectionEventId'), ); } return null; } static List listFromJson( dynamic json, { bool growable = false, }) { final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { final value = EventAgendaDTO.fromJson(row); if (value != null) { result.add(value); } } } return result.toList(growable: growable); } static Map mapFromJson(dynamic json) { final map = {}; if (json is Map && json.isNotEmpty) { json = json.cast(); // ignore: parameter_assignments for (final entry in json.entries) { final value = EventAgendaDTO.fromJson(entry.value); if (value != null) { map[entry.key] = value; } } } return map; } // maps a json object with a list of EventAgendaDTO-objects as value to a dart map static Map> mapListFromJson( dynamic json, { bool growable = false, }) { final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments json = json.cast(); for (final entry in json.entries) { map[entry.key] = EventAgendaDTO.listFromJson( entry.value, growable: growable, ); } } return map; } /// The list of required keys that must be present in a JSON. static const requiredKeys = {}; }