part of 'generated.dart';

class CreateTaskCommentVariablesBuilder {
  String taskId;
  String teamMemberId;
  String comment;
  Optional<bool> _isSystem = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateTaskCommentVariablesBuilder isSystem(bool? t) {
   _isSystem.value = t;
   return this;
  }

  CreateTaskCommentVariablesBuilder(this._dataConnect, {required  this.taskId,required  this.teamMemberId,required  this.comment,});
  Deserializer<CreateTaskCommentData> dataDeserializer = (dynamic json)  => CreateTaskCommentData.fromJson(jsonDecode(json));
  Serializer<CreateTaskCommentVariables> varsSerializer = (CreateTaskCommentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateTaskCommentData, CreateTaskCommentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateTaskCommentData, CreateTaskCommentVariables> ref() {
    CreateTaskCommentVariables vars= CreateTaskCommentVariables(taskId: taskId,teamMemberId: teamMemberId,comment: comment,isSystem: _isSystem,);
    return _dataConnect.mutation("createTaskComment", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateTaskCommentData otherTyped = other as CreateTaskCommentData;
    return taskComment_insert == otherTyped.taskComment_insert;
    
  }
  @override
  int get hashCode => taskComment_insert.hashCode;
  

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

  CreateTaskCommentData({
    required this.taskComment_insert,
  });
}

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

    final CreateTaskCommentVariables otherTyped = other as CreateTaskCommentVariables;
    return taskId == otherTyped.taskId && 
    teamMemberId == otherTyped.teamMemberId && 
    comment == otherTyped.comment && 
    isSystem == otherTyped.isSystem;
    
  }
  @override
  int get hashCode => Object.hashAll([taskId.hashCode, teamMemberId.hashCode, comment.hashCode, isSystem.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['taskId'] = nativeToJson<String>(taskId);
    json['teamMemberId'] = nativeToJson<String>(teamMemberId);
    json['comment'] = nativeToJson<String>(comment);
    if(isSystem.state == OptionalState.set) {
      json['isSystem'] = isSystem.toJson();
    }
    return json;
  }

  CreateTaskCommentVariables({
    required this.taskId,
    required this.teamMemberId,
    required this.comment,
    required this.isSystem,
  });
}

