part of 'generated.dart';

class ListVendorBenefitPlansVariablesBuilder {
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  ListVendorBenefitPlansVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListVendorBenefitPlansVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListVendorBenefitPlansVariablesBuilder(this._dataConnect, );
  Deserializer<ListVendorBenefitPlansData> dataDeserializer = (dynamic json)  => ListVendorBenefitPlansData.fromJson(jsonDecode(json));
  Serializer<ListVendorBenefitPlansVariables> varsSerializer = (ListVendorBenefitPlansVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListVendorBenefitPlansData, ListVendorBenefitPlansVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListVendorBenefitPlansData, ListVendorBenefitPlansVariables> ref() {
    ListVendorBenefitPlansVariables vars= ListVendorBenefitPlansVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listVendorBenefitPlans", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListVendorBenefitPlansVendorBenefitPlans {
  final String id;
  final String vendorId;
  final String title;
  final String? description;
  final String? requestLabel;
  final int? total;
  final bool? isActive;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final ListVendorBenefitPlansVendorBenefitPlansVendor vendor;
  ListVendorBenefitPlansVendorBenefitPlans.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  title = nativeFromJson<String>(json['title']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  requestLabel = json['requestLabel'] == null ? null : nativeFromJson<String>(json['requestLabel']),
  total = json['total'] == null ? null : nativeFromJson<int>(json['total']),
  isActive = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']),
  vendor = ListVendorBenefitPlansVendorBenefitPlansVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListVendorBenefitPlansVendorBenefitPlans otherTyped = other as ListVendorBenefitPlansVendorBenefitPlans;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    title == otherTyped.title && 
    description == otherTyped.description && 
    requestLabel == otherTyped.requestLabel && 
    total == otherTyped.total && 
    isActive == otherTyped.isActive && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['title'] = nativeToJson<String>(title);
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (requestLabel != null) {
      json['requestLabel'] = nativeToJson<String?>(requestLabel);
    }
    if (total != null) {
      json['total'] = nativeToJson<int?>(total);
    }
    if (isActive != null) {
      json['isActive'] = nativeToJson<bool?>(isActive);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['vendor'] = vendor.toJson();
    return json;
  }

  ListVendorBenefitPlansVendorBenefitPlans({
    required this.id,
    required this.vendorId,
    required this.title,
    this.description,
    this.requestLabel,
    this.total,
    this.isActive,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.vendor,
  });
}

@immutable
class ListVendorBenefitPlansVendorBenefitPlansVendor {
  final String companyName;
  ListVendorBenefitPlansVendorBenefitPlansVendor.fromJson(dynamic json):
  
  companyName = nativeFromJson<String>(json['companyName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListVendorBenefitPlansVendorBenefitPlansVendor otherTyped = other as ListVendorBenefitPlansVendorBenefitPlansVendor;
    return companyName == otherTyped.companyName;
    
  }
  @override
  int get hashCode => companyName.hashCode;
  

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

  ListVendorBenefitPlansVendorBenefitPlansVendor({
    required this.companyName,
  });
}

@immutable
class ListVendorBenefitPlansData {
  final List<ListVendorBenefitPlansVendorBenefitPlans> vendorBenefitPlans;
  ListVendorBenefitPlansData.fromJson(dynamic json):
  
  vendorBenefitPlans = (json['vendorBenefitPlans'] as List<dynamic>)
        .map((e) => ListVendorBenefitPlansVendorBenefitPlans.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListVendorBenefitPlansData otherTyped = other as ListVendorBenefitPlansData;
    return vendorBenefitPlans == otherTyped.vendorBenefitPlans;
    
  }
  @override
  int get hashCode => vendorBenefitPlans.hashCode;
  

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

  ListVendorBenefitPlansData({
    required this.vendorBenefitPlans,
  });
}

@immutable
class ListVendorBenefitPlansVariables {
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListVendorBenefitPlansVariables.fromJson(Map<String, dynamic> json) {
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListVendorBenefitPlansVariables otherTyped = other as ListVendorBenefitPlansVariables;
    return offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  ListVendorBenefitPlansVariables({
    required this.offset,
    required this.limit,
  });
}

