<?php

/**
 * Swagger Petstore
 * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
 *
 * OpenAPI spec version: 1.0.0
 * Contact: apiteam@swagger.io
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


namespace App\Http\Controllers;

use Illuminate\Support\Facades\Request;

class FakeApi extends Controller
{
    /**
     * Constructor
     */
    public function __construct()
    {
    }

    /**
     * Operation testEndpointParameters
     *
     * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
     *
     *
     * @return Http response
     */
    public function testEndpointParameters()
    {
        $input = Request::all();

        //path params validation


        //not path params validation
        if (!isset($input['number'])) {
            throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters');
        }
        if ($input['number'] > 543.2) {
            throw new \InvalidArgumentException('invalid value for $number when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.');
        }
        if ($input['number'] < 32.1) {
            throw new \InvalidArgumentException('invalid value for $number when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.');
        }
        $number = $input['number'];

        if (!isset($input['double'])) {
            throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters');
        }
        if ($input['double'] > 123.4) {
            throw new \InvalidArgumentException('invalid value for $double when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.');
        }
        if ($input['double'] < 67.8) {
            throw new \InvalidArgumentException('invalid value for $double when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.');
        }
        $double = $input['double'];

        if (!isset($input['string'])) {
            throw new \InvalidArgumentException('Missing the required parameter $string when calling testEndpointParameters');
        }
        if (!preg_match("/[a-z]/i", $input['string'])) {
            throw new \InvalidArgumentException('invalid value for $string when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i.');
        }
        $string = $input['string'];

        if (!isset($input['byte'])) {
            throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters');
        }
        $byte = $input['byte'];

        if ($input['integer'] > 100.0) {
            throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.0.');
        }
        if ($input['integer'] < 10.0) {
            throw new \InvalidArgumentException('invalid value for $integer when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.0.');
        }
        $integer = $input['integer'];

        if ($input['int32'] > 200.0) {
            throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.0.');
        }
        if ($input['int32'] < 20.0) {
            throw new \InvalidArgumentException('invalid value for $int32 when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.0.');
        }
        $int32 = $input['int32'];

        $int64 = $input['int64'];

        if ($input['float'] > 987.6) {
            throw new \InvalidArgumentException('invalid value for $float when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.');
        }
        $float = $input['float'];

        $binary = $input['binary'];

        $date = $input['date'];

        $dateTime = $input['dateTime'];

        if (strlen($input['password']) > 64) {
            throw new \InvalidArgumentException('invalid length for $password when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.');
        }
        if (strlen($input['password']) < 10) {
            throw new \InvalidArgumentException('invalid length for $password when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.');
        }
        $password = $input['password'];


        return response('How about implementing testEndpointParameters as a POST method ?');
    }
    /**
     * Operation testEnumQueryParameters
     *
     * To test enum query parameters.
     *
     *
     * @return Http response
     */
    public function testEnumQueryParameters()
    {
        $input = Request::all();

        //path params validation


        //not path params validation
        $enumQueryString = $input['enumQueryString'];

        $enumQueryInteger = $input['enumQueryInteger'];

        $enumQueryDouble = $input['enumQueryDouble'];


        return response('How about implementing testEnumQueryParameters as a GET method ?');
    }
}
