Class: Mindee::V2::Search::Models::ModelSearchParameters
- Inherits:
-
ClientOptions::BaseSearchParameters
- Object
- ClientOptions::BaseSearchParameters
- Mindee::V2::Search::Models::ModelSearchParameters
- Defined in:
- lib/mindee/v2/search/models/model_search_parameters.rb
Overview
Search for models within the organization linked to the API key. All search filters are optional. If no search filters are given, all models belonging to the organization are returned. Results are paginated.
Instance Attribute Summary collapse
-
#model_type ⇒ String?
readonly
Filter by an exact model type.
-
#name ⇒ String?
readonly
Filter models by partial name match, case-insensitive.
Attributes inherited from ClientOptions::BaseSearchParameters
Class Method Summary collapse
-
.response_class ⇒ Class<Mindee::V2::Search::Models::ModelSearchResponse>
Response class for the search.
-
.slug ⇒ String
Slug of searchable resources.
Instance Method Summary collapse
-
#initialize(name: nil, model_type: nil, page: nil, per_page: nil) ⇒ ModelSearchParameters
constructor
A new instance of ModelSearchParameters.
-
#request_parameters ⇒ Hash{String => String, Array<String>}
Gets the request parameters for the search request.
Methods inherited from ClientOptions::BaseSearchParameters
Constructor Details
#initialize(name: nil, model_type: nil, page: nil, per_page: nil) ⇒ ModelSearchParameters
Returns a new instance of ModelSearchParameters.
22 23 24 25 26 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 22 def initialize(name: nil, model_type: nil, page: nil, per_page: nil) super(page: page, per_page: per_page) @name = name @model_type = model_type end |
Instance Attribute Details
#model_type ⇒ String? (readonly)
Returns Filter by an exact model type.
16 17 18 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 16 def model_type @model_type end |
#name ⇒ String? (readonly)
Returns Filter models by partial name match, case-insensitive.
13 14 15 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 13 def name @name end |
Class Method Details
.response_class ⇒ Class<Mindee::V2::Search::Models::ModelSearchResponse>
Returns Response class for the search.
34 35 36 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 34 def self.response_class ModelSearchResponse end |
.slug ⇒ String
Returns Slug of searchable resources.
29 30 31 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 29 def self.slug 'models' end |
Instance Method Details
#request_parameters ⇒ Hash{String => String, Array<String>}
Gets the request parameters for the search request.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mindee/v2/search/models/model_search_parameters.rb', line 40 def request_parameters params = super name = @name model_type = @model_type params['name'] = name unless name.nil? params['model_type'] = model_type unless model_type.nil? params end |