part of 'generated.dart';

class GetAccountsByOwnerIdVariablesBuilder {
  String ownerId;

  final FirebaseDataConnect _dataConnect;
  GetAccountsByOwnerIdVariablesBuilder(this._dataConnect, {required  this.ownerId,});
  Deserializer<GetAccountsByOwnerIdData> dataDeserializer = (dynamic json)  => GetAccountsByOwnerIdData.fromJson(jsonDecode(json));
  Serializer<GetAccountsByOwnerIdVariables> varsSerializer = (GetAccountsByOwnerIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetAccountsByOwnerIdData, GetAccountsByOwnerIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetAccountsByOwnerIdData, GetAccountsByOwnerIdVariables> ref() {
    GetAccountsByOwnerIdVariables vars= GetAccountsByOwnerIdVariables(ownerId: ownerId,);
    return _dataConnect.query("getAccountsByOwnerId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetAccountsByOwnerIdAccounts {
  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;
  GetAccountsByOwnerIdAccounts.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 GetAccountsByOwnerIdAccounts otherTyped = other as GetAccountsByOwnerIdAccounts;
    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;
  }

  GetAccountsByOwnerIdAccounts({
    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 GetAccountsByOwnerIdData {
  final List<GetAccountsByOwnerIdAccounts> accounts;
  GetAccountsByOwnerIdData.fromJson(dynamic json):
  
  accounts = (json['accounts'] as List<dynamic>)
        .map((e) => GetAccountsByOwnerIdAccounts.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetAccountsByOwnerIdData otherTyped = other as GetAccountsByOwnerIdData;
    return accounts == otherTyped.accounts;
    
  }
  @override
  int get hashCode => accounts.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['accounts'] = accounts.map((e) => e.toJson()).toList();
    return json;
  }

  GetAccountsByOwnerIdData({
    required this.accounts,
  });
}

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

    final GetAccountsByOwnerIdVariables otherTyped = other as GetAccountsByOwnerIdVariables;
    return ownerId == otherTyped.ownerId;
    
  }
  @override
  int get hashCode => ownerId.hashCode;
  

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

  GetAccountsByOwnerIdVariables({
    required this.ownerId,
  });
}

