Skip to content

Commit

Permalink
fix: regen models
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey committed Apr 29, 2024
1 parent 85970b6 commit 2c52186
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 46 deletions.
23 changes: 15 additions & 8 deletions packages/api/amplify_api/example/lib/models/Blog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down Expand Up @@ -132,13 +132,20 @@ class Blog extends amplify_core.Model {
Blog.fromJson(Map<String, dynamic> json)
: id = json['id'],
_name = json['name'],
_posts = json['posts'] is List
? (json['posts'] as List)
.where((e) => e?['serializedData'] != null)
.map((e) => Post.fromJson(
new Map<String, dynamic>.from(e['serializedData'])))
.toList()
: null,
_posts = json['posts'] is Map
? (json['posts']['items'] is List
? (json['posts']['items'] as List)
.where((e) => e != null)
.map((e) => Post.fromJson(new Map<String, dynamic>.from(e)))
.toList()
: null)
: (json['posts'] is List
? (json['posts'] as List)
.where((e) => e?['serializedData'] != null)
.map((e) => Post.fromJson(
new Map<String, dynamic>.from(e?['serializedData'])))
.toList()
: null),
_createdAt = json['createdAt'] != null
? amplify_core.TemporalDateTime.fromString(json['createdAt'])
: null,
Expand Down
10 changes: 6 additions & 4 deletions packages/api/amplify_api/example/lib/models/Comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down Expand Up @@ -131,9 +131,11 @@ class Comment extends amplify_core.Model {

Comment.fromJson(Map<String, dynamic> json)
: id = json['id'],
_post = json['post']?['serializedData'] != null
? Post.fromJson(
new Map<String, dynamic>.from(json['post']['serializedData']))
_post = json['post'] != null
? json['post']['serializedData'] != null
? Post.fromJson(new Map<String, dynamic>.from(
json['post']['serializedData']))
: Post.fromJson(new Map<String, dynamic>.from(json['post']))
: null,
_content = json['content'],
_createdAt = json['createdAt'] != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down Expand Up @@ -153,10 +153,13 @@ class CpkOneToOneBidirectionalChildExplicitCD extends amplify_core.Model {
CpkOneToOneBidirectionalChildExplicitCD.fromJson(Map<String, dynamic> json)
: id = json['id'],
_name = json['name'],
_belongsToParent = json['belongsToParent']?['serializedData'] != null
? CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(
json['belongsToParent']['serializedData']))
_belongsToParent = json['belongsToParent'] != null
? json['belongsToParent']['serializedData'] != null
? CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(
json['belongsToParent']['serializedData']))
: CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(json['belongsToParent']))
: null,
_createdAt = json['createdAt'] != null
? amplify_core.TemporalDateTime.fromString(json['createdAt'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down Expand Up @@ -153,10 +153,13 @@ class CpkOneToOneBidirectionalChildImplicitCD extends amplify_core.Model {
CpkOneToOneBidirectionalChildImplicitCD.fromJson(Map<String, dynamic> json)
: id = json['id'],
_name = json['name'],
_belongsToParent = json['belongsToParent']?['serializedData'] != null
? CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(
json['belongsToParent']['serializedData']))
_belongsToParent = json['belongsToParent'] != null
? json['belongsToParent']['serializedData'] != null
? CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(
json['belongsToParent']['serializedData']))
: CpkOneToOneBidirectionalParentCD.fromJson(
new Map<String, dynamic>.from(json['belongsToParent']))
: null,
_createdAt = json['createdAt'] != null
? amplify_core.TemporalDateTime.fromString(json['createdAt'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down Expand Up @@ -283,15 +283,21 @@ class CpkOneToOneBidirectionalParentCD extends amplify_core.Model {
CpkOneToOneBidirectionalParentCD.fromJson(Map<String, dynamic> json)
: _customId = json['customId'],
_name = json['name'],
_implicitChild = json['implicitChild']?['serializedData'] != null
? CpkOneToOneBidirectionalChildImplicitCD.fromJson(
new Map<String, dynamic>.from(
json['implicitChild']['serializedData']))
_implicitChild = json['implicitChild'] != null
? json['implicitChild']['serializedData'] != null
? CpkOneToOneBidirectionalChildImplicitCD.fromJson(
new Map<String, dynamic>.from(
json['implicitChild']['serializedData']))
: CpkOneToOneBidirectionalChildImplicitCD.fromJson(
new Map<String, dynamic>.from(json['implicitChild']))
: null,
_explicitChild = json['explicitChild']?['serializedData'] != null
? CpkOneToOneBidirectionalChildExplicitCD.fromJson(
new Map<String, dynamic>.from(
json['explicitChild']['serializedData']))
_explicitChild = json['explicitChild'] != null
? json['explicitChild']['serializedData'] != null
? CpkOneToOneBidirectionalChildExplicitCD.fromJson(
new Map<String, dynamic>.from(
json['explicitChild']['serializedData']))
: CpkOneToOneBidirectionalChildExplicitCD.fromJson(
new Map<String, dynamic>.from(json['explicitChild']))
: null,
_createdAt = json['createdAt'] != null
? amplify_core.TemporalDateTime.fromString(json['createdAt'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'package:amplify_core/amplify_core.dart' as amplify_core;
import 'Blog.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/amplify_api/example/lib/models/OwnerOnly.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Generated files can be excluded from analysis in analysis_options.yaml
// For more info, see: https://dart.dev/guides/language/analysis-options#excluding-code-from-analysis

// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously
// ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, override_on_non_overriding_member, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;
Expand Down
Loading

0 comments on commit 2c52186

Please sign in to comment.