// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // NOTE: This file is generated and may not follow lint rules defined in your app // 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 import 'package:amplify_core/amplify_core.dart'; import 'package:meta/meta.dart'; /// This is an auto generated class representing the Phone type in your schema. @immutable class Phone { final String? _country; final String? _number; String get country { try { return _country!; } catch (e) { throw AmplifyCodeGenModelException( AmplifyExceptionMessages .codeGenRequiredFieldForceCastExceptionMessage, recoverySuggestion: AmplifyExceptionMessages .codeGenRequiredFieldForceCastRecoverySuggestion, underlyingException: e.toString()); } } String get number { try { return _number!; } catch (e) { throw AmplifyCodeGenModelException( AmplifyExceptionMessages .codeGenRequiredFieldForceCastExceptionMessage, recoverySuggestion: AmplifyExceptionMessages .codeGenRequiredFieldForceCastRecoverySuggestion, underlyingException: e.toString()); } } const Phone._internal({required country, required number}) : _country = country, _number = number; factory Phone({required String country, required String number}) { return Phone._internal(country: country, number: number); } bool equals(Object other) { return this == other; } @override bool operator ==(Object other) { if (identical(other, this)) return true; return other is Phone && _country == other._country && _number == other._number; } @override int get hashCode => toString().hashCode; @override String toString() { var buffer = StringBuffer(); buffer.write("Phone {"); buffer.write("country=" + "$_country" + ", "); buffer.write("number=" + "$_number"); buffer.write("}"); return buffer.toString(); } Phone copyWith({String? country, String? number}) { return Phone._internal( country: country ?? this.country, number: number ?? this.number); } Phone.fromJson(Map json) : _country = json['country'], _number = json['number']; Map toJson() => {'country': _country, 'number': _number}; Map toMap() => {'country': _country, 'number': _number}; static var schema = Model.defineSchema(define: (ModelSchemaDefinition modelSchemaDefinition) { modelSchemaDefinition.name = "Phone"; modelSchemaDefinition.pluralName = "Phones"; modelSchemaDefinition.addField(ModelFieldDefinition.customTypeField( fieldName: 'country', isRequired: true, ofType: ModelFieldType(ModelFieldTypeEnum.string))); modelSchemaDefinition.addField(ModelFieldDefinition.customTypeField( fieldName: 'number', isRequired: true, ofType: ModelFieldType(ModelFieldTypeEnum.string))); }); }