/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.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 { CodeChallengeMethod } from './CodeChallengeMethod';
import {
    CodeChallengeMethodFromJSON,
    CodeChallengeMethodFromJSONTyped,
    CodeChallengeMethodToJSON,
    CodeChallengeMethodToJSONTyped,
} from './CodeChallengeMethod';
import type { ResponseType } from './ResponseType';
import {
    ResponseTypeFromJSON,
    ResponseTypeFromJSONTyped,
    ResponseTypeToJSON,
    ResponseTypeToJSONTyped,
} from './ResponseType';

/**
 * 
 * @export
 * @interface AuthorizeRequest
 */
export interface AuthorizeRequest {
    /**
     * 
     * @type {ResponseType}
     * @memberof AuthorizeRequest
     */
    responseType?: ResponseType;
    /**
     * 
     * @type {string}
     * @memberof AuthorizeRequest
     */
    clientId: string;
    /**
     * 
     * @type {string}
     * @memberof AuthorizeRequest
     */
    codeChallenge?: string | null;
    /**
     * 
     * @type {CodeChallengeMethod}
     * @memberof AuthorizeRequest
     */
    codeChallengeMethod?: CodeChallengeMethod;
    /**
     * 
     * @type {string}
     * @memberof AuthorizeRequest
     */
    redirectUri: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthorizeRequest
     */
    scope?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthorizeRequest
     */
    state?: string | null;
}



/**
 * Check if a given object implements the AuthorizeRequest interface.
 */
export function instanceOfAuthorizeRequest(value: object): value is AuthorizeRequest {
    if (!('clientId' in value) || value['clientId'] === undefined) return false;
    if (!('redirectUri' in value) || value['redirectUri'] === undefined) return false;
    return true;
}

export function AuthorizeRequestFromJSON(json: any): AuthorizeRequest {
    return AuthorizeRequestFromJSONTyped(json, false);
}

export function AuthorizeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthorizeRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'responseType': json['response_type'] == null ? undefined : ResponseTypeFromJSON(json['response_type']),
        'clientId': json['client_id'],
        'codeChallenge': json['code_challenge'] == null ? undefined : json['code_challenge'],
        'codeChallengeMethod': json['code_challenge_method'] == null ? undefined : CodeChallengeMethodFromJSON(json['code_challenge_method']),
        'redirectUri': json['redirect_uri'],
        'scope': json['scope'] == null ? undefined : json['scope'],
        'state': json['state'] == null ? undefined : json['state'],
    };
}

export function AuthorizeRequestToJSON(json: any): AuthorizeRequest {
    return AuthorizeRequestToJSONTyped(json, false);
}

export function AuthorizeRequestToJSONTyped(value?: AuthorizeRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'response_type': ResponseTypeToJSON(value['responseType']),
        'client_id': value['clientId'],
        'code_challenge': value['codeChallenge'],
        'code_challenge_method': CodeChallengeMethodToJSON(value['codeChallengeMethod']),
        'redirect_uri': value['redirectUri'],
        'scope': value['scope'],
        'state': value['state'],
    };
}

