part of 'generated.dart';

class GetAccountByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetAccountByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetAccountByIdData> dataDeserializer = (dynamic json)  => GetAccountByIdData.fromJson(jsonDecode(json));
  Serializer<GetAccountByIdVariables> varsSerializer = (GetAccountByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetAccountByIdData, GetAccountByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetAccountByIdData, GetAccountByIdVariables> ref() {
    GetAccountByIdVariables vars= GetAccountByIdVariables(id: id,);
    return _dataConnect.query("getAccountById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetAccountByIdAccount {
  final String id;
  final String bank;
  final EnumValue<AccountType> type;
  final String last4;
  final bool? isPrimary;
  final String ownerId;
  final String? accountNumber;
  final String? routeNumber;
  final Timestamp? expiryTime;
  final Timestamp? createdAt;
  GetAccountByIdAccount.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  bank = nativeFromJson<String>(json['bank']),
  type = accountTypeDeserializer(json['type']),
  last4 = nativeFromJson<String>(json['last4']),
  isPrimary = json['isPrimary'] == null ? null : nativeFromJson<bool>(json['isPrimary']),
  ownerId = nativeFromJson<String>(json['ownerId']),
  accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']),
  routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']),
  expiryTime = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetAccountByIdAccount otherTyped = other as GetAccountByIdAccount;
    return id == otherTyped.id && 
    bank == otherTyped.bank && 
    type == otherTyped.type && 
    last4 == otherTyped.last4 && 
    isPrimary == otherTyped.isPrimary && 
    ownerId == otherTyped.ownerId && 
    accountNumber == otherTyped.accountNumber && 
    routeNumber == otherTyped.routeNumber && 
    expiryTime == otherTyped.expiryTime && 
    createdAt == otherTyped.createdAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode, createdAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['bank'] = nativeToJson<String>(bank);
    json['type'] = 
    accountTypeSerializer(type)
    ;
    json['last4'] = nativeToJson<String>(last4);
    if (isPrimary != null) {
      json['isPrimary'] = nativeToJson<bool?>(isPrimary);
    }
    json['ownerId'] = nativeToJson<String>(ownerId);
    if (accountNumber != null) {
      json['accountNumber'] = nativeToJson<String?>(accountNumber);
    }
    if (routeNumber != null) {
      json['routeNumber'] = nativeToJson<String?>(routeNumber);
    }
    if (expiryTime != null) {
      json['expiryTime'] = expiryTime!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    return json;
  }

  GetAccountByIdAccount({
    required this.id,
    required this.bank,
    required this.type,
    required this.last4,
    this.isPrimary,
    required this.ownerId,
    this.accountNumber,
    this.routeNumber,
    this.expiryTime,
    this.createdAt,
  });
}

@immutable
class GetAccountByIdData {
  final GetAccountByIdAccount? account;
  GetAccountByIdData.fromJson(dynamic json):
  
  account = json['account'] == null ? null : GetAccountByIdAccount.fromJson(json['account']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetAccountByIdData otherTyped = other as GetAccountByIdData;
    return account == otherTyped.account;
    
  }
  @override
  int get hashCode => account.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (account != null) {
      json['account'] = account!.toJson();
    }
    return json;
  }

  GetAccountByIdData({
    this.account,
  });
}

@immutable
class GetAccountByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetAccountByIdVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetAccountByIdVariables otherTyped = other as GetAccountByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    return json;
  }

  GetAccountByIdVariables({
    required this.id,
  });
}

