part of 'generated.dart';

class CreateVendorBenefitPlanVariablesBuilder {
  String vendorId;
  String title;
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _requestLabel = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _total = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isActive = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _createdBy = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateVendorBenefitPlanVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  CreateVendorBenefitPlanVariablesBuilder requestLabel(String? t) {
   _requestLabel.value = t;
   return this;
  }
  CreateVendorBenefitPlanVariablesBuilder total(int? t) {
   _total.value = t;
   return this;
  }
  CreateVendorBenefitPlanVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  CreateVendorBenefitPlanVariablesBuilder createdBy(String? t) {
   _createdBy.value = t;
   return this;
  }

  CreateVendorBenefitPlanVariablesBuilder(this._dataConnect, {required  this.vendorId,required  this.title,});
  Deserializer<CreateVendorBenefitPlanData> dataDeserializer = (dynamic json)  => CreateVendorBenefitPlanData.fromJson(jsonDecode(json));
  Serializer<CreateVendorBenefitPlanVariables> varsSerializer = (CreateVendorBenefitPlanVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateVendorBenefitPlanData, CreateVendorBenefitPlanVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateVendorBenefitPlanData, CreateVendorBenefitPlanVariables> ref() {
    CreateVendorBenefitPlanVariables vars= CreateVendorBenefitPlanVariables(vendorId: vendorId,title: title,description: _description,requestLabel: _requestLabel,total: _total,isActive: _isActive,createdBy: _createdBy,);
    return _dataConnect.mutation("createVendorBenefitPlan", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class CreateVendorBenefitPlanVendorBenefitPlanInsert {
  final String id;
  CreateVendorBenefitPlanVendorBenefitPlanInsert.fromJson(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 CreateVendorBenefitPlanVendorBenefitPlanInsert otherTyped = other as CreateVendorBenefitPlanVendorBenefitPlanInsert;
    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;
  }

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

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

    final CreateVendorBenefitPlanData otherTyped = other as CreateVendorBenefitPlanData;
    return vendorBenefitPlan_insert == otherTyped.vendorBenefitPlan_insert;
    
  }
  @override
  int get hashCode => vendorBenefitPlan_insert.hashCode;
  

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

  CreateVendorBenefitPlanData({
    required this.vendorBenefitPlan_insert,
  });
}

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['title'] = nativeToJson<String>(title);
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(requestLabel.state == OptionalState.set) {
      json['requestLabel'] = requestLabel.toJson();
    }
    if(total.state == OptionalState.set) {
      json['total'] = total.toJson();
    }
    if(isActive.state == OptionalState.set) {
      json['isActive'] = isActive.toJson();
    }
    if(createdBy.state == OptionalState.set) {
      json['createdBy'] = createdBy.toJson();
    }
    return json;
  }

  CreateVendorBenefitPlanVariables({
    required this.vendorId,
    required this.title,
    required this.description,
    required this.requestLabel,
    required this.total,
    required this.isActive,
    required this.createdBy,
  });
}

