/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * REST API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.1.0
 * Contact: contact@tribufu.com
 *
 * 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 { SearchType } from './SearchType';
import {
    SearchTypeFromJSON,
    SearchTypeFromJSONTyped,
    SearchTypeToJSON,
    SearchTypeToJSONTyped,
} from './SearchType';

/**
 * 
 * @export
 * @interface SearchRequest
 */
export interface SearchRequest {
    /**
     * 
     * @type {SearchType}
     * @memberof SearchRequest
     */
    type?: SearchType;
    /**
     * 
     * @type {string}
     * @memberof SearchRequest
     */
    query?: string | null;
    /**
     * 
     * @type {number}
     * @memberof SearchRequest
     */
    page?: number | null;
    /**
     * 
     * @type {string}
     * @memberof SearchRequest
     */
    gameId?: string | null;
}



/**
 * 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;
    }
    return {
        
        'type': json['type'] == null ? undefined : SearchTypeFromJSON(json['type']),
        'query': json['query'] == null ? undefined : json['query'],
        'page': json['page'] == null ? undefined : json['page'],
        'gameId': json['game_id'] == null ? undefined : json['game_id'],
    };
}

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 {
        
        'type': SearchTypeToJSON(value['type']),
        'query': value['query'],
        'page': value['page'],
        'game_id': value['gameId'],
    };
}

