part of 'generated.dart';

class CreateRoleVariablesBuilder {
  String name;
  double costPerHour;
  String vendorId;
  String roleCategoryId;

  final FirebaseDataConnect _dataConnect;
  CreateRoleVariablesBuilder(this._dataConnect, {required  this.name,required  this.costPerHour,required  this.vendorId,required  this.roleCategoryId,});
  Deserializer<CreateRoleData> dataDeserializer = (dynamic json)  => CreateRoleData.fromJson(jsonDecode(json));
  Serializer<CreateRoleVariables> varsSerializer = (CreateRoleVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateRoleData, CreateRoleVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateRoleData, CreateRoleVariables> ref() {
    CreateRoleVariables vars= CreateRoleVariables(name: name,costPerHour: costPerHour,vendorId: vendorId,roleCategoryId: roleCategoryId,);
    return _dataConnect.mutation("createRole", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateRoleData otherTyped = other as CreateRoleData;
    return role_insert == otherTyped.role_insert;
    
  }
  @override
  int get hashCode => role_insert.hashCode;
  

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

  CreateRoleData({
    required this.role_insert,
  });
}

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

    final CreateRoleVariables otherTyped = other as CreateRoleVariables;
    return name == otherTyped.name && 
    costPerHour == otherTyped.costPerHour && 
    vendorId == otherTyped.vendorId && 
    roleCategoryId == otherTyped.roleCategoryId;
    
  }
  @override
  int get hashCode => Object.hashAll([name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['name'] = nativeToJson<String>(name);
    json['costPerHour'] = nativeToJson<double>(costPerHour);
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['roleCategoryId'] = nativeToJson<String>(roleCategoryId);
    return json;
  }

  CreateRoleVariables({
    required this.name,
    required this.costPerHour,
    required this.vendorId,
    required this.roleCategoryId,
  });
}

