clients/oathkeeper/php/lib/Api/ApiApi.php
/**
     * Operation listRulesWithHttpInfo
     *
     * List all rules
     *
     * @param  int $limit The maximum amount of rules returned. (optional)
     * @param  int $offset The offset from where to start looking. (optional)
     *
     * @throws \Ory\Oathkeeper\Client\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \Ory\Oathkeeper\Client\Model\Rule[]|\Ory\Oathkeeper\Client\Model\InlineResponse500, HTTP status code, HTTP response headers (array of strings)
     */
Operation listRulesWithHttpInfo
List all rules

@param  int $limit The maximum amount of rules returned. (optional)
@param  int $offset The offset from where to start looking. (optional)


Operation listRulesWithHttpInfo List all rules @param int $limit The maximum amount of rules returned . ( optional ) @param int $offset The offset from where to start looking . ( optional )
public function listRulesWithHttpInfo($limit = null, $offset = null)
    {
        $request = $this->listRulesRequest($limit, $offset);
        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            }
            $statusCode = $response->getStatusCode();
            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    $response->getBody()
                );
            }
            $responseBody = $response->getBody();
            switch($statusCode) {
                case 200:
                    if ('\Ory\Oathkeeper\Client\Model\Rule[]' === '\SplFileObject') {
                        $content = $responseBody; 
                    } else {
                        $content = (string) $responseBody;
                    }
                    return [
                        ObjectSerializer::deserialize($content, '\Ory\Oathkeeper\Client\Model\Rule[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                case 500:
                    if ('\Ory\Oathkeeper\Client\Model\InlineResponse500' === '\SplFileObject') {
                        $content = $responseBody; 
                    } else {
                        $content = (string) $responseBody;
                    }
                    return [
                        ObjectSerializer::deserialize($content, '\Ory\Oathkeeper\Client\Model\InlineResponse500', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }
            $returnType = '\Ory\Oathkeeper\Client\Model\Rule[]';
            $responseBody = $response->getBody();
            if ($returnType === '\SplFileObject') {
                $content = $responseBody; 
            } else {
                $content = (string) $responseBody;
            }
            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\Ory\Oathkeeper\Client\Model\Rule[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
                case 500:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\Ory\Oathkeeper\Client\Model\InlineResponse500',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }
public function listRulesWithHttpInfo ( $ limit = null , $ offset = null ) { $ request = $ this -> listRulesRequest ( $ limit , $ offset ) ; try { $ options = $ this -> createHttpClientOption ( ) ; try { $ response = $ this -> client -> send ( $ request , $ options ) ; } catch ( RequestException $ e ) { throw new ApiException ( " [ { $ e -> getCode ( ) } ]  { $ e -> getMessage ( ) } " , $ e -> getCode ( ) , $ e -> getResponse ( ) ? $ e -> getResponse ( ) -> getHeaders ( ) : null , $ e -> getResponse ( ) ? ( string ) $ e -> getResponse ( ) -> getBody ( ) : null ) ; } $ statusCode = $ response -> getStatusCode ( ) ; if ( $ statusCode < 200 || $ statusCode > 299 ) { throw new ApiException ( sprintf ( '[%d] Error connecting to the API (%s)' , $ statusCode , $ request -> getUri ( ) ) , $ statusCode , $ response -> getHeaders ( ) , $ response -> getBody ( ) ) ; } $ responseBody = $ response -> getBody ( ) ; switch ( $ statusCode ) { case 200 : if ( '\Ory\Oathkeeper\Client\Model\Rule[]' === '\SplFileObject' ) { $ content = $ responseBody ; } else { $ content = ( string ) $ responseBody ; } return [ ObjectSerializer :: deserialize ( $ content , '\Ory\Oathkeeper\Client\Model\Rule[]' , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; case 500 : if ( '\Ory\Oathkeeper\Client\Model\InlineResponse500' === '\SplFileObject' ) { $ content = $ responseBody ; } else { $ content = ( string ) $ responseBody ; } return [ ObjectSerializer :: deserialize ( $ content , '\Ory\Oathkeeper\Client\Model\InlineResponse500' , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } $ returnType = '\Ory\Oathkeeper\Client\Model\Rule[]' ; $ responseBody = $ response -> getBody ( ) ; if ( $ returnType === '\SplFileObject' ) { $ content = $ responseBody ; } else { $ content = ( string ) $ responseBody ; } return [ ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } catch ( ApiException $ e ) { switch ( $ e -> getCode ( ) ) { case 200 : $ data = ObjectSerializer :: deserialize ( $ e -> getResponseBody ( ) , '\Ory\Oathkeeper\Client\Model\Rule[]' , $ e -> getResponseHeaders ( ) ) ; $ e -> setResponseObject ( $ data ) ; break ; case 500 : $ data = ObjectSerializer :: deserialize ( $ e -> getResponseBody ( ) , '\Ory\Oathkeeper\Client\Model\InlineResponse500' , $ e -> getResponseHeaders ( ) ) ; $ e -> setResponseObject ( $ data ) ; break ; } throw $ e ; } }
Operation listRulesWithHttpInfo
 List all rules
Operation listRulesWithHttpInfo List all rules
//stream goes to serializer //stream goes to serializer //stream goes to serializer