part of 'generated.dart';

class CreateTeamHubVariablesBuilder {
  String teamId;
  String hubName;
  String address;
  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;  CreateTeamHubVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  CreateTeamHubVariablesBuilder state(String? t) {
   _state.value = t;
   return this;
  }
  CreateTeamHubVariablesBuilder zipCode(String? t) {
   _zipCode.value = t;
   return this;
  }
  CreateTeamHubVariablesBuilder managerName(String? t) {
   _managerName.value = t;
   return this;
  }
  CreateTeamHubVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  CreateTeamHubVariablesBuilder departments(AnyValue? t) {
   _departments.value = t;
   return this;
  }

  CreateTeamHubVariablesBuilder(this._dataConnect, {required  this.teamId,required  this.hubName,required  this.address,});
  Deserializer<CreateTeamHubData> dataDeserializer = (dynamic json)  => CreateTeamHubData.fromJson(jsonDecode(json));
  Serializer<CreateTeamHubVariables> varsSerializer = (CreateTeamHubVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateTeamHubData, CreateTeamHubVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateTeamHubData, CreateTeamHubVariables> ref() {
    CreateTeamHubVariables vars= CreateTeamHubVariables(teamId: teamId,hubName: hubName,address: address,city: _city,state: _state,zipCode: _zipCode,managerName: _managerName,isActive: _isActive,departments: _departments,);
    return _dataConnect.mutation("createTeamHub", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateTeamHubData otherTyped = other as CreateTeamHubData;
    return teamHub_insert == otherTyped.teamHub_insert;
    
  }
  @override
  int get hashCode => teamHub_insert.hashCode;
  

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

  CreateTeamHubData({
    required this.teamHub_insert,
  });
}

@immutable
class CreateTeamHubVariables {
  final String teamId;
  final String hubName;
  final 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.')
  CreateTeamHubVariables.fromJson(Map<String, dynamic> json):
  
  teamId = nativeFromJson<String>(json['teamId']),
  hubName = nativeFromJson<String>(json['hubName']),
  address = 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 CreateTeamHubVariables otherTyped = other as CreateTeamHubVariables;
    return teamId == otherTyped.teamId && 
    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([teamId.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['teamId'] = nativeToJson<String>(teamId);
    json['hubName'] = nativeToJson<String>(hubName);
    json['address'] = nativeToJson<String>(address);
    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;
  }

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

