part of 'generated.dart';

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

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

  ListTeamHudDepartmentsVariablesBuilder(this._dataConnect, );
  Deserializer<ListTeamHudDepartmentsData> dataDeserializer = (dynamic json)  => ListTeamHudDepartmentsData.fromJson(jsonDecode(json));
  Serializer<ListTeamHudDepartmentsVariables> varsSerializer = (ListTeamHudDepartmentsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListTeamHudDepartmentsData, ListTeamHudDepartmentsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListTeamHudDepartmentsData, ListTeamHudDepartmentsVariables> ref() {
    ListTeamHudDepartmentsVariables vars= ListTeamHudDepartmentsVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listTeamHudDepartments", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListTeamHudDepartmentsTeamHudDepartments {
  final String id;
  final String name;
  final String? costCenter;
  final String teamHubId;
  final ListTeamHudDepartmentsTeamHudDepartmentsTeamHub teamHub;
  final Timestamp? createdAt;
  ListTeamHudDepartmentsTeamHudDepartments.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 = ListTeamHudDepartmentsTeamHudDepartmentsTeamHub.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 ListTeamHudDepartmentsTeamHudDepartments otherTyped = other as ListTeamHudDepartmentsTeamHudDepartments;
    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;
  }

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

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

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

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

    final ListTeamHudDepartmentsData otherTyped = other as ListTeamHudDepartmentsData;
    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;
  }

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

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

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

  ListTeamHudDepartmentsVariables({
    required this.offset,
    required this.limit,
  });
}

