part of 'generated.dart';

class UpdateTeamHubVariablesBuilder {
  String id;
  Optional<String> _hubName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _address = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _state = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _zipCode = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _managerName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isActive = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _departments = Optional.optional(AnyValue.fromJson, defaultSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateTeamHubVariablesBuilder hubName(String? t) {
   _hubName.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder address(String? t) {
   _address.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder state(String? t) {
   _state.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder zipCode(String? t) {
   _zipCode.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder managerName(String? t) {
   _managerName.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  UpdateTeamHubVariablesBuilder departments(AnyValue? t) {
   _departments.value = t;
   return this;
  }

  UpdateTeamHubVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateTeamHubData> dataDeserializer = (dynamic json)  => UpdateTeamHubData.fromJson(jsonDecode(json));
  Serializer<UpdateTeamHubVariables> varsSerializer = (UpdateTeamHubVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateTeamHubData, UpdateTeamHubVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateTeamHubData, UpdateTeamHubVariables> ref() {
    UpdateTeamHubVariables vars= UpdateTeamHubVariables(id: id,hubName: _hubName,address: _address,city: _city,state: _state,zipCode: _zipCode,managerName: _managerName,isActive: _isActive,departments: _departments,);
    return _dataConnect.mutation("updateTeamHub", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateTeamHubData otherTyped = other as UpdateTeamHubData;
    return teamHub_update == otherTyped.teamHub_update;
    
  }
  @override
  int get hashCode => teamHub_update.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (teamHub_update != null) {
      json['teamHub_update'] = teamHub_update!.toJson();
    }
    return json;
  }

  UpdateTeamHubData({
    this.teamHub_update,
  });
}

@immutable
class UpdateTeamHubVariables {
  final String id;
  late final Optional<String>hubName;
  late final Optional<String>address;
  late final Optional<String>city;
  late final Optional<String>state;
  late final Optional<String>zipCode;
  late final Optional<String>managerName;
  late final Optional<bool>isActive;
  late final Optional<AnyValue>departments;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateTeamHubVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    hubName = Optional.optional(nativeFromJson, nativeToJson);
    hubName.value = json['hubName'] == null ? null : nativeFromJson<String>(json['hubName']);
  
  
    address = Optional.optional(nativeFromJson, nativeToJson);
    address.value = json['address'] == null ? null : nativeFromJson<String>(json['address']);
  
  
    city = Optional.optional(nativeFromJson, nativeToJson);
    city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
  
  
    state = Optional.optional(nativeFromJson, nativeToJson);
    state.value = json['state'] == null ? null : nativeFromJson<String>(json['state']);
  
  
    zipCode = Optional.optional(nativeFromJson, nativeToJson);
    zipCode.value = json['zipCode'] == null ? null : nativeFromJson<String>(json['zipCode']);
  
  
    managerName = Optional.optional(nativeFromJson, nativeToJson);
    managerName.value = json['managerName'] == null ? null : nativeFromJson<String>(json['managerName']);
  
  
    isActive = Optional.optional(nativeFromJson, nativeToJson);
    isActive.value = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']);
  
  
    departments = Optional.optional(AnyValue.fromJson, defaultSerializer);
    departments.value = 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 UpdateTeamHubVariables otherTyped = other as UpdateTeamHubVariables;
    return id == otherTyped.id && 
    hubName == otherTyped.hubName && 
    address == otherTyped.address && 
    city == otherTyped.city && 
    state == otherTyped.state && 
    zipCode == otherTyped.zipCode && 
    managerName == otherTyped.managerName && 
    isActive == otherTyped.isActive && 
    departments == otherTyped.departments;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(hubName.state == OptionalState.set) {
      json['hubName'] = hubName.toJson();
    }
    if(address.state == OptionalState.set) {
      json['address'] = address.toJson();
    }
    if(city.state == OptionalState.set) {
      json['city'] = city.toJson();
    }
    if(state.state == OptionalState.set) {
      json['state'] = state.toJson();
    }
    if(zipCode.state == OptionalState.set) {
      json['zipCode'] = zipCode.toJson();
    }
    if(managerName.state == OptionalState.set) {
      json['managerName'] = managerName.toJson();
    }
    if(isActive.state == OptionalState.set) {
      json['isActive'] = isActive.toJson();
    }
    if(departments.state == OptionalState.set) {
      json['departments'] = departments.toJson();
    }
    return json;
  }

  UpdateTeamHubVariables({
    required this.id,
    required this.hubName,
    required this.address,
    required this.city,
    required this.state,
    required this.zipCode,
    required this.managerName,
    required this.isActive,
    required this.departments,
  });
}

