part of 'generated.dart';

class CreateStaffRoleVariablesBuilder {
  String staffId;
  String roleId;
  Optional<RoleType> _roleType = Optional.optional((data) => RoleType.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  CreateStaffRoleVariablesBuilder roleType(RoleType? t) {
   _roleType.value = t;
   return this;
  }

  CreateStaffRoleVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.roleId,});
  Deserializer<CreateStaffRoleData> dataDeserializer = (dynamic json)  => CreateStaffRoleData.fromJson(jsonDecode(json));
  Serializer<CreateStaffRoleVariables> varsSerializer = (CreateStaffRoleVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateStaffRoleData, CreateStaffRoleVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateStaffRoleData, CreateStaffRoleVariables> ref() {
    CreateStaffRoleVariables vars= CreateStaffRoleVariables(staffId: staffId,roleId: roleId,roleType: _roleType,);
    return _dataConnect.mutation("createStaffRole", dataDeserializer, varsSerializer, vars);
  }
}

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

    final CreateStaffRoleStaffRoleInsert otherTyped = other as CreateStaffRoleStaffRoleInsert;
    return staffId == otherTyped.staffId && 
    roleId == otherTyped.roleId;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode]);
  

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

  CreateStaffRoleStaffRoleInsert({
    required this.staffId,
    required this.roleId,
  });
}

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

    final CreateStaffRoleData otherTyped = other as CreateStaffRoleData;
    return staffRole_insert == otherTyped.staffRole_insert;
    
  }
  @override
  int get hashCode => staffRole_insert.hashCode;
  

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

  CreateStaffRoleData({
    required this.staffRole_insert,
  });
}

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

    final CreateStaffRoleVariables otherTyped = other as CreateStaffRoleVariables;
    return staffId == otherTyped.staffId && 
    roleId == otherTyped.roleId && 
    roleType == otherTyped.roleType;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode, roleType.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    json['roleId'] = nativeToJson<String>(roleId);
    if(roleType.state == OptionalState.set) {
      json['roleType'] = roleType.toJson();
    }
    return json;
  }

  CreateStaffRoleVariables({
    required this.staffId,
    required this.roleId,
    required this.roleType,
  });
}

