part of 'generated.dart';

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

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

  ListTeamHudDepartmentsByTeamHubIdVariablesBuilder(this._dataConnect, {required  this.teamHubId,});
  Deserializer<ListTeamHudDepartmentsByTeamHubIdData> dataDeserializer = (dynamic json)  => ListTeamHudDepartmentsByTeamHubIdData.fromJson(jsonDecode(json));
  Serializer<ListTeamHudDepartmentsByTeamHubIdVariables> varsSerializer = (ListTeamHudDepartmentsByTeamHubIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListTeamHudDepartmentsByTeamHubIdData, ListTeamHudDepartmentsByTeamHubIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListTeamHudDepartmentsByTeamHubIdData, ListTeamHudDepartmentsByTeamHubIdVariables> ref() {
    ListTeamHudDepartmentsByTeamHubIdVariables vars= ListTeamHudDepartmentsByTeamHubIdVariables(teamHubId: teamHubId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listTeamHudDepartmentsByTeamHubId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments {
  final String id;
  final String name;
  final String? costCenter;
  final String teamHubId;
  final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub teamHub;
  final Timestamp? createdAt;
  ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  costCenter = json['costCenter'] == null ? null : nativeFromJson<String>(json['costCenter']),
  teamHubId = nativeFromJson<String>(json['teamHubId']),
  teamHub = ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub.fromJson(json['teamHub']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments otherTyped = other as ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    costCenter == otherTyped.costCenter && 
    teamHubId == otherTyped.teamHubId && 
    teamHub == otherTyped.teamHub && 
    createdAt == otherTyped.createdAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costCenter.hashCode, teamHubId.hashCode, teamHub.hashCode, createdAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    if (costCenter != null) {
      json['costCenter'] = nativeToJson<String?>(costCenter);
    }
    json['teamHubId'] = nativeToJson<String>(teamHubId);
    json['teamHub'] = teamHub.toJson();
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    return json;
  }

  ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments({
    required this.id,
    required this.name,
    this.costCenter,
    required this.teamHubId,
    required this.teamHub,
    this.createdAt,
  });
}

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

    final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub otherTyped = other as ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub;
    return id == otherTyped.id && 
    hubName == otherTyped.hubName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode]);
  

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

  ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub({
    required this.id,
    required this.hubName,
  });
}

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

    final ListTeamHudDepartmentsByTeamHubIdData otherTyped = other as ListTeamHudDepartmentsByTeamHubIdData;
    return teamHudDepartments == otherTyped.teamHudDepartments;
    
  }
  @override
  int get hashCode => teamHudDepartments.hashCode;
  

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

  ListTeamHudDepartmentsByTeamHubIdData({
    required this.teamHudDepartments,
  });
}

@immutable
class ListTeamHudDepartmentsByTeamHubIdVariables {
  final String teamHubId;
  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.')
  ListTeamHudDepartmentsByTeamHubIdVariables.fromJson(Map<String, dynamic> json):
  
  teamHubId = nativeFromJson<String>(json['teamHubId']) {
  
  
  
    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 ListTeamHudDepartmentsByTeamHubIdVariables otherTyped = other as ListTeamHudDepartmentsByTeamHubIdVariables;
    return teamHubId == otherTyped.teamHubId && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([teamHubId.hashCode, offset.hashCode, limit.hashCode]);
  

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

  ListTeamHudDepartmentsByTeamHubIdVariables({
    required this.teamHubId,
    required this.offset,
    required this.limit,
  });
}

