part of 'generated.dart';

class GetCustomRateCardByIdVariablesBuilder {
  String id;

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

  QueryRef<GetCustomRateCardByIdData, GetCustomRateCardByIdVariables> ref() {
    GetCustomRateCardByIdVariables vars= GetCustomRateCardByIdVariables(id: id,);
    return _dataConnect.query("getCustomRateCardById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetCustomRateCardByIdCustomRateCard {
  final String id;
  final String name;
  final String? baseBook;
  final double? discount;
  final bool? isDefault;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  GetCustomRateCardByIdCustomRateCard.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  baseBook = json['baseBook'] == null ? null : nativeFromJson<String>(json['baseBook']),
  discount = json['discount'] == null ? null : nativeFromJson<double>(json['discount']),
  isDefault = json['isDefault'] == null ? null : nativeFromJson<bool>(json['isDefault']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCustomRateCardByIdCustomRateCard otherTyped = other as GetCustomRateCardByIdCustomRateCard;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    baseBook == otherTyped.baseBook && 
    discount == otherTyped.discount && 
    isDefault == otherTyped.isDefault && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode, createdAt.hashCode, updatedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    if (baseBook != null) {
      json['baseBook'] = nativeToJson<String?>(baseBook);
    }
    if (discount != null) {
      json['discount'] = nativeToJson<double?>(discount);
    }
    if (isDefault != null) {
      json['isDefault'] = nativeToJson<bool?>(isDefault);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  GetCustomRateCardByIdCustomRateCard({
    required this.id,
    required this.name,
    this.baseBook,
    this.discount,
    this.isDefault,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final GetCustomRateCardByIdData otherTyped = other as GetCustomRateCardByIdData;
    return customRateCard == otherTyped.customRateCard;
    
  }
  @override
  int get hashCode => customRateCard.hashCode;
  

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

  GetCustomRateCardByIdData({
    this.customRateCard,
  });
}

@immutable
class GetCustomRateCardByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetCustomRateCardByIdVariables.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 GetCustomRateCardByIdVariables otherTyped = other as GetCustomRateCardByIdVariables;
    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;
  }

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

