class Vellum::SearchRequestOptionsRequest
def self.from_json(json_object:)
-
(SearchRequestOptionsRequest)-
Parameters:
-
json_object(JSON) --
def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) limit = struct.limit if parsed_json["weights"].nil? weights = nil else weights = parsed_json["weights"].to_json weights = SearchWeightsRequest.from_json(json_object: weights) end if parsed_json["result_merging"].nil? result_merging = nil else result_merging = parsed_json["result_merging"].to_json result_merging = SearchResultMergingRequest.from_json(json_object: result_merging) end if parsed_json["filters"].nil? filters = nil else filters = parsed_json["filters"].to_json filters = SearchFiltersRequest.from_json(json_object: filters) end new(limit: limit, weights: weights, result_merging: result_merging, filters: filters, additional_properties: struct) end
def self.validate_raw(obj:)
-
(Void)-
Parameters:
-
obj(Object) --
def self.validate_raw(obj:) obj.limit&.is_a?(Integer) != false || raise("Passed value for field obj.limit is not the expected type, validation failed.") obj.weights.nil? || SearchWeightsRequest.validate_raw(obj: obj.weights) obj.result_merging.nil? || SearchResultMergingRequest.validate_raw(obj: obj.result_merging) obj.filters.nil? || SearchFiltersRequest.validate_raw(obj: obj.filters) end
def initialize(limit: nil, weights: nil, result_merging: nil, filters: nil, additional_properties: nil)
-
(SearchRequestOptionsRequest)-
Parameters:
-
additional_properties(OpenStruct) -- Additional properties unmapped to the current class definition -
filters(SearchFiltersRequest) -- The filters to apply to the search. -
result_merging(SearchResultMergingRequest) -- The configuration for merging results. -
weights(SearchWeightsRequest) -- The weights to use for the search. Must add up to 1.0. -
limit(Integer) -- The maximum number of results to return.
def initialize(limit: nil, weights: nil, result_merging: nil, filters: nil, additional_properties: nil) # @type [Integer] The maximum number of results to return. @limit = limit # @type [SearchWeightsRequest] The weights to use for the search. Must add up to 1.0. @weights = weights # @type [SearchResultMergingRequest] The configuration for merging results. @result_merging = result_merging # @type [SearchFiltersRequest] The filters to apply to the search. @filters = filters # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end
def to_json(*_args)
-
(JSON)-
def to_json(*_args) { "limit": @limit, "weights": @weights, "result_merging": @result_merging, "filters": @filters }.to_json end