part of 'generated.dart';

class CreateTeamVariablesBuilder {
  String teamName;
  String ownerId;
  String ownerName;
  String ownerRole;
  Optional<String> _email = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _companyLogo = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _totalMembers = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _activeMembers = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _totalHubs = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _departments = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<int> _favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<AnyValue> _blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);

  final FirebaseDataConnect _dataConnect;  CreateTeamVariablesBuilder email(String? t) {
   _email.value = t;
   return this;
  }
  CreateTeamVariablesBuilder companyLogo(String? t) {
   _companyLogo.value = t;
   return this;
  }
  CreateTeamVariablesBuilder totalMembers(int? t) {
   _totalMembers.value = t;
   return this;
  }
  CreateTeamVariablesBuilder activeMembers(int? t) {
   _activeMembers.value = t;
   return this;
  }
  CreateTeamVariablesBuilder totalHubs(int? t) {
   _totalHubs.value = t;
   return this;
  }
  CreateTeamVariablesBuilder departments(AnyValue? t) {
   _departments.value = t;
   return this;
  }
  CreateTeamVariablesBuilder favoriteStaffCount(int? t) {
   _favoriteStaffCount.value = t;
   return this;
  }
  CreateTeamVariablesBuilder blockedStaffCount(int? t) {
   _blockedStaffCount.value = t;
   return this;
  }
  CreateTeamVariablesBuilder favoriteStaff(AnyValue? t) {
   _favoriteStaff.value = t;
   return this;
  }
  CreateTeamVariablesBuilder blockedStaff(AnyValue? t) {
   _blockedStaff.value = t;
   return this;
  }

  CreateTeamVariablesBuilder(this._dataConnect, {required  this.teamName,required  this.ownerId,required  this.ownerName,required  this.ownerRole,});
  Deserializer<CreateTeamData> dataDeserializer = (dynamic json)  => CreateTeamData.fromJson(jsonDecode(json));
  Serializer<CreateTeamVariables> varsSerializer = (CreateTeamVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateTeamData, CreateTeamVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateTeamData, CreateTeamVariables> ref() {
    CreateTeamVariables vars= CreateTeamVariables(teamName: teamName,ownerId: ownerId,ownerName: ownerName,ownerRole: ownerRole,email: _email,companyLogo: _companyLogo,totalMembers: _totalMembers,activeMembers: _activeMembers,totalHubs: _totalHubs,departments: _departments,favoriteStaffCount: _favoriteStaffCount,blockedStaffCount: _blockedStaffCount,favoriteStaff: _favoriteStaff,blockedStaff: _blockedStaff,);
    return _dataConnect.mutation("createTeam", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateTeamData otherTyped = other as CreateTeamData;
    return team_insert == otherTyped.team_insert;
    
  }
  @override
  int get hashCode => team_insert.hashCode;
  

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

  CreateTeamData({
    required this.team_insert,
  });
}

@immutable
class CreateTeamVariables {
  final String teamName;
  final String ownerId;
  final String ownerName;
  final String ownerRole;
  late final Optional<String>email;
  late final Optional<String>companyLogo;
  late final Optional<int>totalMembers;
  late final Optional<int>activeMembers;
  late final Optional<int>totalHubs;
  late final Optional<AnyValue>departments;
  late final Optional<int>favoriteStaffCount;
  late final Optional<int>blockedStaffCount;
  late final Optional<AnyValue>favoriteStaff;
  late final Optional<AnyValue>blockedStaff;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateTeamVariables.fromJson(Map<String, dynamic> json):
  
  teamName = nativeFromJson<String>(json['teamName']),
  ownerId = nativeFromJson<String>(json['ownerId']),
  ownerName = nativeFromJson<String>(json['ownerName']),
  ownerRole = nativeFromJson<String>(json['ownerRole']) {
  
  
  
  
  
  
    email = Optional.optional(nativeFromJson, nativeToJson);
    email.value = json['email'] == null ? null : nativeFromJson<String>(json['email']);
  
  
    companyLogo = Optional.optional(nativeFromJson, nativeToJson);
    companyLogo.value = json['companyLogo'] == null ? null : nativeFromJson<String>(json['companyLogo']);
  
  
    totalMembers = Optional.optional(nativeFromJson, nativeToJson);
    totalMembers.value = json['totalMembers'] == null ? null : nativeFromJson<int>(json['totalMembers']);
  
  
    activeMembers = Optional.optional(nativeFromJson, nativeToJson);
    activeMembers.value = json['activeMembers'] == null ? null : nativeFromJson<int>(json['activeMembers']);
  
  
    totalHubs = Optional.optional(nativeFromJson, nativeToJson);
    totalHubs.value = json['totalHubs'] == null ? null : nativeFromJson<int>(json['totalHubs']);
  
  
    departments = Optional.optional(AnyValue.fromJson, defaultSerializer);
    departments.value = json['departments'] == null ? null : AnyValue.fromJson(json['departments']);
  
  
    favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson);
    favoriteStaffCount.value = json['favoriteStaffCount'] == null ? null : nativeFromJson<int>(json['favoriteStaffCount']);
  
  
    blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson);
    blockedStaffCount.value = json['blockedStaffCount'] == null ? null : nativeFromJson<int>(json['blockedStaffCount']);
  
  
    favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);
    favoriteStaff.value = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']);
  
  
    blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);
    blockedStaff.value = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateTeamVariables otherTyped = other as CreateTeamVariables;
    return teamName == otherTyped.teamName && 
    ownerId == otherTyped.ownerId && 
    ownerName == otherTyped.ownerName && 
    ownerRole == otherTyped.ownerRole && 
    email == otherTyped.email && 
    companyLogo == otherTyped.companyLogo && 
    totalMembers == otherTyped.totalMembers && 
    activeMembers == otherTyped.activeMembers && 
    totalHubs == otherTyped.totalHubs && 
    departments == otherTyped.departments && 
    favoriteStaffCount == otherTyped.favoriteStaffCount && 
    blockedStaffCount == otherTyped.blockedStaffCount && 
    favoriteStaff == otherTyped.favoriteStaff && 
    blockedStaff == otherTyped.blockedStaff;
    
  }
  @override
  int get hashCode => Object.hashAll([teamName.hashCode, ownerId.hashCode, ownerName.hashCode, ownerRole.hashCode, email.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['teamName'] = nativeToJson<String>(teamName);
    json['ownerId'] = nativeToJson<String>(ownerId);
    json['ownerName'] = nativeToJson<String>(ownerName);
    json['ownerRole'] = nativeToJson<String>(ownerRole);
    if(email.state == OptionalState.set) {
      json['email'] = email.toJson();
    }
    if(companyLogo.state == OptionalState.set) {
      json['companyLogo'] = companyLogo.toJson();
    }
    if(totalMembers.state == OptionalState.set) {
      json['totalMembers'] = totalMembers.toJson();
    }
    if(activeMembers.state == OptionalState.set) {
      json['activeMembers'] = activeMembers.toJson();
    }
    if(totalHubs.state == OptionalState.set) {
      json['totalHubs'] = totalHubs.toJson();
    }
    if(departments.state == OptionalState.set) {
      json['departments'] = departments.toJson();
    }
    if(favoriteStaffCount.state == OptionalState.set) {
      json['favoriteStaffCount'] = favoriteStaffCount.toJson();
    }
    if(blockedStaffCount.state == OptionalState.set) {
      json['blockedStaffCount'] = blockedStaffCount.toJson();
    }
    if(favoriteStaff.state == OptionalState.set) {
      json['favoriteStaff'] = favoriteStaff.toJson();
    }
    if(blockedStaff.state == OptionalState.set) {
      json['blockedStaff'] = blockedStaff.toJson();
    }
    return json;
  }

  CreateTeamVariables({
    required this.teamName,
    required this.ownerId,
    required this.ownerName,
    required this.ownerRole,
    required this.email,
    required this.companyLogo,
    required this.totalMembers,
    required this.activeMembers,
    required this.totalHubs,
    required this.departments,
    required this.favoriteStaffCount,
    required this.blockedStaffCount,
    required this.favoriteStaff,
    required this.blockedStaff,
  });
}

