shared_link_edit_dto.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class SharedLinkEditDto {
  11. /// Returns a new [SharedLinkEditDto] instance.
  12. SharedLinkEditDto({
  13. this.description,
  14. this.expiresAt,
  15. this.allowUpload,
  16. this.allowDownload,
  17. this.showExif,
  18. });
  19. ///
  20. /// Please note: This property should have been non-nullable! Since the specification file
  21. /// does not include a default value (using the "default:" property), however, the generated
  22. /// source code must fall back to having a nullable type.
  23. /// Consider adding a "default:" property in the specification file to hide this note.
  24. ///
  25. String? description;
  26. DateTime? expiresAt;
  27. ///
  28. /// Please note: This property should have been non-nullable! Since the specification file
  29. /// does not include a default value (using the "default:" property), however, the generated
  30. /// source code must fall back to having a nullable type.
  31. /// Consider adding a "default:" property in the specification file to hide this note.
  32. ///
  33. bool? allowUpload;
  34. ///
  35. /// Please note: This property should have been non-nullable! Since the specification file
  36. /// does not include a default value (using the "default:" property), however, the generated
  37. /// source code must fall back to having a nullable type.
  38. /// Consider adding a "default:" property in the specification file to hide this note.
  39. ///
  40. bool? allowDownload;
  41. ///
  42. /// Please note: This property should have been non-nullable! Since the specification file
  43. /// does not include a default value (using the "default:" property), however, the generated
  44. /// source code must fall back to having a nullable type.
  45. /// Consider adding a "default:" property in the specification file to hide this note.
  46. ///
  47. bool? showExif;
  48. @override
  49. bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto &&
  50. other.description == description &&
  51. other.expiresAt == expiresAt &&
  52. other.allowUpload == allowUpload &&
  53. other.allowDownload == allowDownload &&
  54. other.showExif == showExif;
  55. @override
  56. int get hashCode =>
  57. // ignore: unnecessary_parenthesis
  58. (description == null ? 0 : description!.hashCode) +
  59. (expiresAt == null ? 0 : expiresAt!.hashCode) +
  60. (allowUpload == null ? 0 : allowUpload!.hashCode) +
  61. (allowDownload == null ? 0 : allowDownload!.hashCode) +
  62. (showExif == null ? 0 : showExif!.hashCode);
  63. @override
  64. String toString() => 'SharedLinkEditDto[description=$description, expiresAt=$expiresAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif]';
  65. Map<String, dynamic> toJson() {
  66. final json = <String, dynamic>{};
  67. if (this.description != null) {
  68. json[r'description'] = this.description;
  69. } else {
  70. // json[r'description'] = null;
  71. }
  72. if (this.expiresAt != null) {
  73. json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String();
  74. } else {
  75. // json[r'expiresAt'] = null;
  76. }
  77. if (this.allowUpload != null) {
  78. json[r'allowUpload'] = this.allowUpload;
  79. } else {
  80. // json[r'allowUpload'] = null;
  81. }
  82. if (this.allowDownload != null) {
  83. json[r'allowDownload'] = this.allowDownload;
  84. } else {
  85. // json[r'allowDownload'] = null;
  86. }
  87. if (this.showExif != null) {
  88. json[r'showExif'] = this.showExif;
  89. } else {
  90. // json[r'showExif'] = null;
  91. }
  92. return json;
  93. }
  94. /// Returns a new [SharedLinkEditDto] instance and imports its values from
  95. /// [value] if it's a [Map], null otherwise.
  96. // ignore: prefer_constructors_over_static_methods
  97. static SharedLinkEditDto? fromJson(dynamic value) {
  98. if (value is Map) {
  99. final json = value.cast<String, dynamic>();
  100. return SharedLinkEditDto(
  101. description: mapValueOfType<String>(json, r'description'),
  102. expiresAt: mapDateTime(json, r'expiresAt', r''),
  103. allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
  104. allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
  105. showExif: mapValueOfType<bool>(json, r'showExif'),
  106. );
  107. }
  108. return null;
  109. }
  110. static List<SharedLinkEditDto> listFromJson(dynamic json, {bool growable = false,}) {
  111. final result = <SharedLinkEditDto>[];
  112. if (json is List && json.isNotEmpty) {
  113. for (final row in json) {
  114. final value = SharedLinkEditDto.fromJson(row);
  115. if (value != null) {
  116. result.add(value);
  117. }
  118. }
  119. }
  120. return result.toList(growable: growable);
  121. }
  122. static Map<String, SharedLinkEditDto> mapFromJson(dynamic json) {
  123. final map = <String, SharedLinkEditDto>{};
  124. if (json is Map && json.isNotEmpty) {
  125. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  126. for (final entry in json.entries) {
  127. final value = SharedLinkEditDto.fromJson(entry.value);
  128. if (value != null) {
  129. map[entry.key] = value;
  130. }
  131. }
  132. }
  133. return map;
  134. }
  135. // maps a json object with a list of SharedLinkEditDto-objects as value to a dart map
  136. static Map<String, List<SharedLinkEditDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  137. final map = <String, List<SharedLinkEditDto>>{};
  138. if (json is Map && json.isNotEmpty) {
  139. // ignore: parameter_assignments
  140. json = json.cast<String, dynamic>();
  141. for (final entry in json.entries) {
  142. map[entry.key] = SharedLinkEditDto.listFromJson(entry.value, growable: growable,);
  143. }
  144. }
  145. return map;
  146. }
  147. /// The list of required keys that must be present in a JSON.
  148. static const requiredKeys = <String>{
  149. };
  150. }