/* tslint:disable */ /* eslint-disable */ /** * Fabric API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { SearchRequestAllOfPagination } from './SearchRequestAllOfPagination'; import { SearchRequestAllOfPaginationFromJSON, SearchRequestAllOfPaginationFromJSONTyped, SearchRequestAllOfPaginationToJSON, SearchRequestAllOfPaginationToJSONTyped, } from './SearchRequestAllOfPagination'; import type { SearchRequestAllOfQueriesInner } from './SearchRequestAllOfQueriesInner'; import { SearchRequestAllOfQueriesInnerFromJSON, SearchRequestAllOfQueriesInnerFromJSONTyped, SearchRequestAllOfQueriesInnerToJSON, SearchRequestAllOfQueriesInnerToJSONTyped, } from './SearchRequestAllOfQueriesInner'; import type { SearchRequestAllOfSort } from './SearchRequestAllOfSort'; import { SearchRequestAllOfSortFromJSON, SearchRequestAllOfSortFromJSONTyped, SearchRequestAllOfSortToJSON, SearchRequestAllOfSortToJSONTyped, } from './SearchRequestAllOfSort'; import type { SearchRequestAllOfAllOfFilters } from './SearchRequestAllOfAllOfFilters'; import { SearchRequestAllOfAllOfFiltersFromJSON, SearchRequestAllOfAllOfFiltersFromJSONTyped, SearchRequestAllOfAllOfFiltersToJSON, SearchRequestAllOfAllOfFiltersToJSONTyped, } from './SearchRequestAllOfAllOfFilters'; /** * * @export * @interface SearchRequest */ export interface SearchRequest { /** * Find other resources similar to this resource. * @type {string} * @memberof SearchRequest */ 'resourceId'?: string; /** * Find image resources similar to this image. The image should be provided as a base64-encoded string with a data URL prefix (e.g., "data:image/png;base64,..."). * @type {string} * @memberof SearchRequest */ 'image'?: string; /** * Find resources matching this text. Uses hybrid semantic and keyword search, so you can either provide keywords or a natural language query. * @type {string} * @memberof SearchRequest */ 'text'?: string; /** * * @type {SearchRequestAllOfAllOfFilters} * @memberof SearchRequest */ 'filters'?: SearchRequestAllOfAllOfFilters; /** * A value between 0 and 1 that controls the precision of the search results. Higher values will return fewer results that are more relevant, while lower values will return more results that may be less relevant. Default is 0.3. * @type {number} * @memberof SearchRequest */ 'precision'?: number; /** * * @type {Array} * @memberof SearchRequest */ 'queries'?: Array; /** * Does not store search query in search history, if set to true. * @type {boolean} * @memberof SearchRequest */ 'incognito'?: boolean | null; /** * * @type {SearchRequestAllOfPagination} * @memberof SearchRequest */ 'pagination'?: SearchRequestAllOfPagination; /** * * @type {SearchRequestAllOfSort} * @memberof SearchRequest */ 'sort'?: SearchRequestAllOfSort; } /** * Check if a given object implements the SearchRequest interface. */ export function instanceOfSearchRequest(value: object): value is SearchRequest { return true; } export function SearchRequestFromJSON(json: any): SearchRequest { return SearchRequestFromJSONTyped(json, false); } export function SearchRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchRequest { if (json == null) { return json; } const result = { } as SearchRequest; if (json['resourceId'] !== undefined) { result['resourceId'] = json['resourceId']; } if (json['image'] !== undefined) { result['image'] = json['image']; } if (json['text'] !== undefined) { result['text'] = json['text']; } if (json['filters'] !== undefined) { result['filters'] = SearchRequestAllOfAllOfFiltersFromJSON(json['filters']); } if (json['precision'] !== undefined) { result['precision'] = json['precision']; } if (json['queries'] !== undefined) { result['queries'] = (json['queries'] as Array).map(SearchRequestAllOfQueriesInnerFromJSON); } if (json['incognito'] !== undefined) { if (json['incognito'] === null) { result['incognito'] = null; } else { result['incognito'] = json['incognito']; } } if (json['pagination'] !== undefined) { result['pagination'] = SearchRequestAllOfPaginationFromJSON(json['pagination']); } if (json['sort'] !== undefined) { result['sort'] = SearchRequestAllOfSortFromJSON(json['sort']); } return result; } export function SearchRequestToJSON(json: any): SearchRequest { return SearchRequestToJSONTyped(json, false); } export function SearchRequestToJSONTyped(value?: SearchRequest | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'resourceId': value['resourceId'], 'image': value['image'], 'text': value['text'], 'filters': SearchRequestAllOfAllOfFiltersToJSON(value['filters']), 'precision': value['precision'], 'queries': value['queries'] == null ? undefined : ((value['queries'] as Array).map(SearchRequestAllOfQueriesInnerToJSON)), 'incognito': value['incognito'], 'pagination': SearchRequestAllOfPaginationToJSON(value['pagination']), 'sort': SearchRequestAllOfSortToJSON(value['sort']), }; }