part of 'generated.dart';

class CreateAttireOptionVariablesBuilder {
  String itemId;
  String label;
  Optional<String> _icon = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _imageUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isMandatory = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateAttireOptionVariablesBuilder icon(String? t) {
   _icon.value = t;
   return this;
  }
  CreateAttireOptionVariablesBuilder imageUrl(String? t) {
   _imageUrl.value = t;
   return this;
  }
  CreateAttireOptionVariablesBuilder isMandatory(bool? t) {
   _isMandatory.value = t;
   return this;
  }
  CreateAttireOptionVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }

  CreateAttireOptionVariablesBuilder(this._dataConnect, {required  this.itemId,required  this.label,});
  Deserializer<CreateAttireOptionData> dataDeserializer = (dynamic json)  => CreateAttireOptionData.fromJson(jsonDecode(json));
  Serializer<CreateAttireOptionVariables> varsSerializer = (CreateAttireOptionVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateAttireOptionData, CreateAttireOptionVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateAttireOptionData, CreateAttireOptionVariables> ref() {
    CreateAttireOptionVariables vars= CreateAttireOptionVariables(itemId: itemId,label: label,icon: _icon,imageUrl: _imageUrl,isMandatory: _isMandatory,vendorId: _vendorId,);
    return _dataConnect.mutation("createAttireOption", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateAttireOptionData otherTyped = other as CreateAttireOptionData;
    return attireOption_insert == otherTyped.attireOption_insert;
    
  }
  @override
  int get hashCode => attireOption_insert.hashCode;
  

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

  CreateAttireOptionData({
    required this.attireOption_insert,
  });
}

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

    final CreateAttireOptionVariables otherTyped = other as CreateAttireOptionVariables;
    return itemId == otherTyped.itemId && 
    label == otherTyped.label && 
    icon == otherTyped.icon && 
    imageUrl == otherTyped.imageUrl && 
    isMandatory == otherTyped.isMandatory && 
    vendorId == otherTyped.vendorId;
    
  }
  @override
  int get hashCode => Object.hashAll([itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['itemId'] = nativeToJson<String>(itemId);
    json['label'] = nativeToJson<String>(label);
    if(icon.state == OptionalState.set) {
      json['icon'] = icon.toJson();
    }
    if(imageUrl.state == OptionalState.set) {
      json['imageUrl'] = imageUrl.toJson();
    }
    if(isMandatory.state == OptionalState.set) {
      json['isMandatory'] = isMandatory.toJson();
    }
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    return json;
  }

  CreateAttireOptionVariables({
    required this.itemId,
    required this.label,
    required this.icon,
    required this.imageUrl,
    required this.isMandatory,
    required this.vendorId,
  });
}

