part of 'generated.dart';

class UpdateHubVariablesBuilder {
  String id;
  Optional<String> _name = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _locationName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _address = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _nfcTagId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _ownerId = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateHubVariablesBuilder name(String? t) {
   _name.value = t;
   return this;
  }
  UpdateHubVariablesBuilder locationName(String? t) {
   _locationName.value = t;
   return this;
  }
  UpdateHubVariablesBuilder address(String? t) {
   _address.value = t;
   return this;
  }
  UpdateHubVariablesBuilder nfcTagId(String? t) {
   _nfcTagId.value = t;
   return this;
  }
  UpdateHubVariablesBuilder ownerId(String? t) {
   _ownerId.value = t;
   return this;
  }

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

  MutationRef<UpdateHubData, UpdateHubVariables> ref() {
    UpdateHubVariables vars= UpdateHubVariables(id: id,name: _name,locationName: _locationName,address: _address,nfcTagId: _nfcTagId,ownerId: _ownerId,);
    return _dataConnect.mutation("updateHub", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateHubData otherTyped = other as UpdateHubData;
    return hub_update == otherTyped.hub_update;
    
  }
  @override
  int get hashCode => hub_update.hashCode;
  

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

  UpdateHubData({
    this.hub_update,
  });
}

@immutable
class UpdateHubVariables {
  final String id;
  late final Optional<String>name;
  late final Optional<String>locationName;
  late final Optional<String>address;
  late final Optional<String>nfcTagId;
  late final Optional<String>ownerId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateHubVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    name = Optional.optional(nativeFromJson, nativeToJson);
    name.value = json['name'] == null ? null : nativeFromJson<String>(json['name']);
  
  
    locationName = Optional.optional(nativeFromJson, nativeToJson);
    locationName.value = json['locationName'] == null ? null : nativeFromJson<String>(json['locationName']);
  
  
    address = Optional.optional(nativeFromJson, nativeToJson);
    address.value = json['address'] == null ? null : nativeFromJson<String>(json['address']);
  
  
    nfcTagId = Optional.optional(nativeFromJson, nativeToJson);
    nfcTagId.value = json['nfcTagId'] == null ? null : nativeFromJson<String>(json['nfcTagId']);
  
  
    ownerId = Optional.optional(nativeFromJson, nativeToJson);
    ownerId.value = json['ownerId'] == null ? null : nativeFromJson<String>(json['ownerId']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateHubVariables otherTyped = other as UpdateHubVariables;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    locationName == otherTyped.locationName && 
    address == otherTyped.address && 
    nfcTagId == otherTyped.nfcTagId && 
    ownerId == otherTyped.ownerId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(name.state == OptionalState.set) {
      json['name'] = name.toJson();
    }
    if(locationName.state == OptionalState.set) {
      json['locationName'] = locationName.toJson();
    }
    if(address.state == OptionalState.set) {
      json['address'] = address.toJson();
    }
    if(nfcTagId.state == OptionalState.set) {
      json['nfcTagId'] = nfcTagId.toJson();
    }
    if(ownerId.state == OptionalState.set) {
      json['ownerId'] = ownerId.toJson();
    }
    return json;
  }

  UpdateHubVariables({
    required this.id,
    required this.name,
    required this.locationName,
    required this.address,
    required this.nfcTagId,
    required this.ownerId,
  });
}

