part of 'generated.dart';

class UpdateTeamMemberVariablesBuilder {
  String id;
  Optional<TeamMemberRole> _role = Optional.optional((data) => TeamMemberRole.values.byName(data), enumSerializer);
  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);
  Optional<TeamMemberInviteStatus> _inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer);

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

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

  MutationRef<UpdateTeamMemberData, UpdateTeamMemberVariables> ref() {
    UpdateTeamMemberVariables vars= UpdateTeamMemberVariables(id: id,role: _role,title: _title,department: _department,teamHubId: _teamHubId,isActive: _isActive,inviteStatus: _inviteStatus,);
    return _dataConnect.mutation("updateTeamMember", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateTeamMemberData otherTyped = other as UpdateTeamMemberData;
    return teamMember_update == otherTyped.teamMember_update;
    
  }
  @override
  int get hashCode => teamMember_update.hashCode;
  

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

  UpdateTeamMemberData({
    this.teamMember_update,
  });
}

@immutable
class UpdateTeamMemberVariables {
  final String id;
  late final Optional<TeamMemberRole>role;
  late final Optional<String>title;
  late final Optional<String>department;
  late final Optional<String>teamHubId;
  late final Optional<bool>isActive;
  late final Optional<TeamMemberInviteStatus>inviteStatus;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateTeamMemberVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    role = Optional.optional((data) => TeamMemberRole.values.byName(data), enumSerializer);
    role.value = json['role'] == null ? null : TeamMemberRole.values.byName(json['role']);
  
  
    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 UpdateTeamMemberVariables otherTyped = other as UpdateTeamMemberVariables;
    return id == otherTyped.id && 
    role == otherTyped.role && 
    title == otherTyped.title && 
    department == otherTyped.department && 
    teamHubId == otherTyped.teamHubId && 
    isActive == otherTyped.isActive && 
    inviteStatus == otherTyped.inviteStatus;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, inviteStatus.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(role.state == OptionalState.set) {
      json['role'] = role.toJson();
    }
    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();
    }
    if(inviteStatus.state == OptionalState.set) {
      json['inviteStatus'] = inviteStatus.toJson();
    }
    return json;
  }

  UpdateTeamMemberVariables({
    required this.id,
    required this.role,
    required this.title,
    required this.department,
    required this.teamHubId,
    required this.isActive,
    required this.inviteStatus,
  });
}

