part of 'generated.dart';

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

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

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

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

@immutable
class ListTeamHubsTeamHubs {
  final String id;
  final String teamId;
  final String hubName;
  final String address;
  final String? placeId;
  final double? latitude;
  final double? longitude;
  final String? city;
  final String? state;
  final String? street;
  final String? country;
  final String? zipCode;
  final String? managerName;
  final bool isActive;
  final AnyValue? departments;
  ListTeamHubsTeamHubs.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  teamId = nativeFromJson<String>(json['teamId']),
  hubName = nativeFromJson<String>(json['hubName']),
  address = nativeFromJson<String>(json['address']),
  placeId = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']),
  latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
  longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
  city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
  state = json['state'] == null ? null : nativeFromJson<String>(json['state']),
  street = json['street'] == null ? null : nativeFromJson<String>(json['street']),
  country = json['country'] == null ? null : nativeFromJson<String>(json['country']),
  zipCode = json['zipCode'] == null ? null : nativeFromJson<String>(json['zipCode']),
  managerName = json['managerName'] == null ? null : nativeFromJson<String>(json['managerName']),
  isActive = nativeFromJson<bool>(json['isActive']),
  departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTeamHubsTeamHubs otherTyped = other as ListTeamHubsTeamHubs;
    return id == otherTyped.id && 
    teamId == otherTyped.teamId && 
    hubName == otherTyped.hubName && 
    address == otherTyped.address && 
    placeId == otherTyped.placeId && 
    latitude == otherTyped.latitude && 
    longitude == otherTyped.longitude && 
    city == otherTyped.city && 
    state == otherTyped.state && 
    street == otherTyped.street && 
    country == otherTyped.country && 
    zipCode == otherTyped.zipCode && 
    managerName == otherTyped.managerName && 
    isActive == otherTyped.isActive && 
    departments == otherTyped.departments;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, hubName.hashCode, address.hashCode, placeId.hashCode, latitude.hashCode, longitude.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['teamId'] = nativeToJson<String>(teamId);
    json['hubName'] = nativeToJson<String>(hubName);
    json['address'] = nativeToJson<String>(address);
    if (placeId != null) {
      json['placeId'] = nativeToJson<String?>(placeId);
    }
    if (latitude != null) {
      json['latitude'] = nativeToJson<double?>(latitude);
    }
    if (longitude != null) {
      json['longitude'] = nativeToJson<double?>(longitude);
    }
    if (city != null) {
      json['city'] = nativeToJson<String?>(city);
    }
    if (state != null) {
      json['state'] = nativeToJson<String?>(state);
    }
    if (street != null) {
      json['street'] = nativeToJson<String?>(street);
    }
    if (country != null) {
      json['country'] = nativeToJson<String?>(country);
    }
    if (zipCode != null) {
      json['zipCode'] = nativeToJson<String?>(zipCode);
    }
    if (managerName != null) {
      json['managerName'] = nativeToJson<String?>(managerName);
    }
    json['isActive'] = nativeToJson<bool>(isActive);
    if (departments != null) {
      json['departments'] = departments!.toJson();
    }
    return json;
  }

  ListTeamHubsTeamHubs({
    required this.id,
    required this.teamId,
    required this.hubName,
    required this.address,
    this.placeId,
    this.latitude,
    this.longitude,
    this.city,
    this.state,
    this.street,
    this.country,
    this.zipCode,
    this.managerName,
    required this.isActive,
    this.departments,
  });
}

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

    final ListTeamHubsData otherTyped = other as ListTeamHubsData;
    return teamHubs == otherTyped.teamHubs;
    
  }
  @override
  int get hashCode => teamHubs.hashCode;
  

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

  ListTeamHubsData({
    required this.teamHubs,
  });
}

@immutable
class ListTeamHubsVariables {
  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.')
  ListTeamHubsVariables.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 ListTeamHubsVariables otherTyped = other as ListTeamHubsVariables;
    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;
  }

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

