// // 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 Geometry { /// Returns a new [Geometry] instance. Geometry({ this.factory_, this.userData, this.srid, this.precisionModel, this.numGeometries, this.isSimple, this.isValid, this.area, this.length, this.centroid, this.interiorPoint, this.pointOnSurface, this.envelope, this.envelopeInternal, this.isRectangle, }); GeometryFactory? factory_; Object? userData; /// /// 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? srid; GeometryPrecisionModel? precisionModel; /// /// 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? numGeometries; /// /// 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. /// bool? isSimple; /// /// 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. /// bool? isValid; /// /// 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. /// double? area; /// /// 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. /// double? length; GeometryCentroid? centroid; GeometryCentroid? interiorPoint; GeometryCentroid? pointOnSurface; MapAnnotationGeometry? envelope; GeometryEnvelopeInternal? envelopeInternal; /// /// 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. /// bool? isRectangle; @override bool operator ==(Object other) => identical(this, other) || other is Geometry && other.factory_ == factory_ && other.userData == userData && other.srid == srid && other.precisionModel == precisionModel && other.numGeometries == numGeometries && other.isSimple == isSimple && other.isValid == isValid && other.area == area && other.length == length && other.centroid == centroid && other.interiorPoint == interiorPoint && other.pointOnSurface == pointOnSurface && other.envelope == envelope && other.envelopeInternal == envelopeInternal && other.isRectangle == isRectangle; @override int get hashCode => // ignore: unnecessary_parenthesis (factory_ == null ? 0 : factory_!.hashCode) + (userData == null ? 0 : userData!.hashCode) + (srid == null ? 0 : srid!.hashCode) + (precisionModel == null ? 0 : precisionModel!.hashCode) + (numGeometries == null ? 0 : numGeometries!.hashCode) + (isSimple == null ? 0 : isSimple!.hashCode) + (isValid == null ? 0 : isValid!.hashCode) + (area == null ? 0 : area!.hashCode) + (length == null ? 0 : length!.hashCode) + (centroid == null ? 0 : centroid!.hashCode) + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + (envelope == null ? 0 : envelope!.hashCode) + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + (isRectangle == null ? 0 : isRectangle!.hashCode); @override String toString() => 'Geometry[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle]'; Map toJson() { final json = {}; if (this.factory_ != null) { json[r'factory'] = this.factory_; } else { json[r'factory'] = null; } if (this.userData != null) { json[r'userData'] = this.userData; } else { json[r'userData'] = null; } if (this.srid != null) { json[r'srid'] = this.srid; } else { json[r'srid'] = null; } if (this.precisionModel != null) { json[r'precisionModel'] = this.precisionModel; } else { json[r'precisionModel'] = null; } if (this.numGeometries != null) { json[r'numGeometries'] = this.numGeometries; } else { json[r'numGeometries'] = null; } if (this.isSimple != null) { json[r'isSimple'] = this.isSimple; } else { json[r'isSimple'] = null; } if (this.isValid != null) { json[r'isValid'] = this.isValid; } else { json[r'isValid'] = null; } if (this.area != null) { json[r'area'] = this.area; } else { json[r'area'] = null; } if (this.length != null) { json[r'length'] = this.length; } else { json[r'length'] = null; } if (this.centroid != null) { json[r'centroid'] = this.centroid; } else { json[r'centroid'] = null; } if (this.interiorPoint != null) { json[r'interiorPoint'] = this.interiorPoint; } else { json[r'interiorPoint'] = null; } if (this.pointOnSurface != null) { json[r'pointOnSurface'] = this.pointOnSurface; } else { json[r'pointOnSurface'] = null; } if (this.envelope != null) { json[r'envelope'] = this.envelope; } else { json[r'envelope'] = null; } if (this.envelopeInternal != null) { json[r'envelopeInternal'] = this.envelopeInternal; } else { json[r'envelopeInternal'] = null; } if (this.isRectangle != null) { json[r'isRectangle'] = this.isRectangle; } else { json[r'isRectangle'] = null; } return json; } /// Returns a new [Geometry] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static Geometry? 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 "Geometry[$key]" is missing from JSON.'); assert(json[key] != null, 'Required key "Geometry[$key]" has a null value in JSON.'); }); return true; }()); return Geometry( factory_: GeometryFactory.fromJson(json[r'factory']), userData: mapValueOfType(json, r'userData'), srid: mapValueOfType(json, r'srid'), precisionModel: GeometryPrecisionModel.fromJson(json[r'precisionModel']), numGeometries: mapValueOfType(json, r'numGeometries'), isSimple: mapValueOfType(json, r'isSimple'), isValid: mapValueOfType(json, r'isValid'), area: mapValueOfType(json, r'area'), length: mapValueOfType(json, r'length'), centroid: GeometryCentroid.fromJson(json[r'centroid']), interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), envelopeInternal: GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), isRectangle: mapValueOfType(json, r'isRectangle'), ); } 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 = Geometry.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 = Geometry.fromJson(entry.value); if (value != null) { map[entry.key] = value; } } } return map; } // maps a json object with a list of Geometry-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] = Geometry.listFromJson( entry.value, growable: growable, ); } } return map; } /// The list of required keys that must be present in a JSON. static const requiredKeys = {}; }