part of 'generated.dart';

class CreateTeamMemberVariablesBuilder {
  String teamId;
  TeamMemberRole role;
  Optional<String> _title = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _department = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _teamHubId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isActive = Optional.optional(nativeFromJson, nativeToJson);
  String userId;
  Optional<TeamMemberInviteStatus> _inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  CreateTeamMemberVariablesBuilder title(String? t) {
   _title.value = t;
   return this;
  }
  CreateTeamMemberVariablesBuilder department(String? t) {
   _department.value = t;
   return this;
  }
  CreateTeamMemberVariablesBuilder teamHubId(String? t) {
   _teamHubId.value = t;
   return this;
  }
  CreateTeamMemberVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  CreateTeamMemberVariablesBuilder inviteStatus(TeamMemberInviteStatus? t) {
   _inviteStatus.value = t;
   return this;
  }

  CreateTeamMemberVariablesBuilder(this._dataConnect, {required  this.teamId,required  this.role,required  this.userId,});
  Deserializer<CreateTeamMemberData> dataDeserializer = (dynamic json)  => CreateTeamMemberData.fromJson(jsonDecode(json));
  Serializer<CreateTeamMemberVariables> varsSerializer = (CreateTeamMemberVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateTeamMemberData, CreateTeamMemberVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateTeamMemberData, CreateTeamMemberVariables> ref() {
    CreateTeamMemberVariables vars= CreateTeamMemberVariables(teamId: teamId,role: role,title: _title,department: _department,teamHubId: _teamHubId,isActive: _isActive,userId: userId,inviteStatus: _inviteStatus,);
    return _dataConnect.mutation("createTeamMember", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateTeamMemberData otherTyped = other as CreateTeamMemberData;
    return teamMember_insert == otherTyped.teamMember_insert;
    
  }
  @override
  int get hashCode => teamMember_insert.hashCode;
  

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

  CreateTeamMemberData({
    required this.teamMember_insert,
  });
}

@immutable
class CreateTeamMemberVariables {
  final String teamId;
  final TeamMemberRole role;
  late final Optional<String>title;
  late final Optional<String>department;
  late final Optional<String>teamHubId;
  late final Optional<bool>isActive;
  final String userId;
  late final Optional<TeamMemberInviteStatus>inviteStatus;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateTeamMemberVariables.fromJson(Map<String, dynamic> json):
  
  teamId = nativeFromJson<String>(json['teamId']),
  role = TeamMemberRole.values.byName(json['role']),
  userId = nativeFromJson<String>(json['userId']) {
  
  
  
  
    title = Optional.optional(nativeFromJson, nativeToJson);
    title.value = json['title'] == null ? null : nativeFromJson<String>(json['title']);
  
  
    department = Optional.optional(nativeFromJson, nativeToJson);
    department.value = json['department'] == null ? null : nativeFromJson<String>(json['department']);
  
  
    teamHubId = Optional.optional(nativeFromJson, nativeToJson);
    teamHubId.value = json['teamHubId'] == null ? null : nativeFromJson<String>(json['teamHubId']);
  
  
    isActive = Optional.optional(nativeFromJson, nativeToJson);
    isActive.value = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']);
  
  
  
    inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer);
    inviteStatus.value = json['inviteStatus'] == null ? null : TeamMemberInviteStatus.values.byName(json['inviteStatus']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateTeamMemberVariables otherTyped = other as CreateTeamMemberVariables;
    return teamId == otherTyped.teamId && 
    role == otherTyped.role && 
    title == otherTyped.title && 
    department == otherTyped.department && 
    teamHubId == otherTyped.teamHubId && 
    isActive == otherTyped.isActive && 
    userId == otherTyped.userId && 
    inviteStatus == otherTyped.inviteStatus;
    
  }
  @override
  int get hashCode => Object.hashAll([teamId.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, userId.hashCode, inviteStatus.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['teamId'] = nativeToJson<String>(teamId);
    json['role'] = 
    role.name
    ;
    if(title.state == OptionalState.set) {
      json['title'] = title.toJson();
    }
    if(department.state == OptionalState.set) {
      json['department'] = department.toJson();
    }
    if(teamHubId.state == OptionalState.set) {
      json['teamHubId'] = teamHubId.toJson();
    }
    if(isActive.state == OptionalState.set) {
      json['isActive'] = isActive.toJson();
    }
    json['userId'] = nativeToJson<String>(userId);
    if(inviteStatus.state == OptionalState.set) {
      json['inviteStatus'] = inviteStatus.toJson();
    }
    return json;
  }

  CreateTeamMemberVariables({
    required this.teamId,
    required this.role,
    required this.title,
    required this.department,
    required this.teamHubId,
    required this.isActive,
    required this.userId,
    required this.inviteStatus,
  });
}

