manager-app/manager_api_new/lib/model/geometry_precision_model.dart
2025-07-28 16:44:12 +02:00

203 lines
7.0 KiB
Dart

//
// 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 GeometryPrecisionModel {
/// Returns a new [GeometryPrecisionModel] instance.
GeometryPrecisionModel({
this.isFloating,
this.maximumSignificantDigits,
this.scale,
this.gridSize,
this.precisionModelType,
});
///
/// 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? isFloating;
///
/// 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? maximumSignificantDigits;
///
/// 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? scale;
///
/// 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? gridSize;
///
/// 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.
///
PrecisionModels? precisionModelType;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GeometryPrecisionModel &&
other.isFloating == isFloating &&
other.maximumSignificantDigits == maximumSignificantDigits &&
other.scale == scale &&
other.gridSize == gridSize &&
other.precisionModelType == precisionModelType;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(isFloating == null ? 0 : isFloating!.hashCode) +
(maximumSignificantDigits == null
? 0
: maximumSignificantDigits!.hashCode) +
(scale == null ? 0 : scale!.hashCode) +
(gridSize == null ? 0 : gridSize!.hashCode) +
(precisionModelType == null ? 0 : precisionModelType!.hashCode);
@override
String toString() =>
'GeometryPrecisionModel[isFloating=$isFloating, maximumSignificantDigits=$maximumSignificantDigits, scale=$scale, gridSize=$gridSize, precisionModelType=$precisionModelType]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.isFloating != null) {
json[r'isFloating'] = this.isFloating;
} else {
json[r'isFloating'] = null;
}
if (this.maximumSignificantDigits != null) {
json[r'maximumSignificantDigits'] = this.maximumSignificantDigits;
} else {
json[r'maximumSignificantDigits'] = null;
}
if (this.scale != null) {
json[r'scale'] = this.scale;
} else {
json[r'scale'] = null;
}
if (this.gridSize != null) {
json[r'gridSize'] = this.gridSize;
} else {
json[r'gridSize'] = null;
}
if (this.precisionModelType != null) {
json[r'precisionModelType'] = this.precisionModelType;
} else {
json[r'precisionModelType'] = null;
}
return json;
}
/// Returns a new [GeometryPrecisionModel] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static GeometryPrecisionModel? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// 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 "GeometryPrecisionModel[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "GeometryPrecisionModel[$key]" has a null value in JSON.');
});
return true;
}());
return GeometryPrecisionModel(
isFloating: mapValueOfType<bool>(json, r'isFloating'),
maximumSignificantDigits:
mapValueOfType<int>(json, r'maximumSignificantDigits'),
scale: mapValueOfType<double>(json, r'scale'),
gridSize: mapValueOfType<double>(json, r'gridSize'),
precisionModelType:
PrecisionModels.fromJson(json[r'precisionModelType']),
);
}
return null;
}
static List<GeometryPrecisionModel> listFromJson(
dynamic json, {
bool growable = false,
}) {
final result = <GeometryPrecisionModel>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = GeometryPrecisionModel.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, GeometryPrecisionModel> mapFromJson(dynamic json) {
final map = <String, GeometryPrecisionModel>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GeometryPrecisionModel.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of GeometryPrecisionModel-objects as value to a dart map
static Map<String, List<GeometryPrecisionModel>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
final map = <String, List<GeometryPrecisionModel>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = GeometryPrecisionModel.listFromJson(
entry.value,
growable: growable,
);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{};
}