def as_json(options = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
      serialize_unknown_attributes = if options.key?(:serialize_unknown_attributes)
                                       options[:serialize_unknown_attributes]
                                     else
                                       StoreModel.config.serialize_unknown_attributes
                                     end

      serialize_enums_using_as_json = if options.key?(:serialize_enums_using_as_json)
                                        options[:serialize_enums_using_as_json]
                                      else
                                        StoreModel.config.serialize_enums_using_as_json
                                      end

      result = @attributes.keys.each_with_object({}) do |key, values|
        attr = @attributes.fetch(key)
        assign_serialization_options(attr, serialize_unknown_attributes, serialize_enums_using_as_json)
        values[key] = serialized_attribute(attr)
      end.with_indifferent_access

      result.merge!(unknown_attributes) if serialize_unknown_attributes
      result.as_json(options).tap do |json|
        serialize_enums!(json) if serialize_enums_using_as_json
      end
    end
Returns a hash representing the model. Some configuration can be
passed through +options+.

@param options [Hash]

@return [Hash]