lib/API/MetricsApi.php
/**
     * Operation metricTimelineAsyncWithHttpInfo
     *
     * Get Events for a Specific Metric
     *
     * @param  string $metric_id (required)
     * @param  string $since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the &#x60;next&#x60; attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time. (optional)
     * @param  int $count Number of events to return in a batch. Max &#x3D; 100 (optional, default to 50)
     * @param  string $sort Sort order to apply to timeline, either descending or ascending. Valid values are &#x60;desc&#x60; or &#x60;asc&#x60;. Defaults to &#x60;desc&#x60;. Always descending when &#x60;since&#x60; is not sent, as &#x60;since&#x60; defaults to current time. (optional, default to 'desc')
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
Operation metricTimelineAsyncWithHttpInfo
Get Events for a Specific Metric

@param  string $metric_id (required)
@param  string $since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the `next` attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time. (optional)
@param  int $count Number of events to return in a batch. Max = 100 (optional, default to 50)
@param  string $sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time. (optional, default to 'desc')


Operation metricTimelineAsyncWithHttpInfo Get Events for a Specific Metric @param string $metric_id ( required ) @param string $since Either a 10 - digit Unix timestamp ( UTC ) to use as starting datetime OR a pagination token obtained from the ` next ` attribute of a prior API call . For backwards compatibility UUIDs will continue to be supported for a limited time . Defaults to current time . ( optional ) @param int $count Number of events to return in a batch . Max = 100 ( optional default to 50 ) @param string $sort Sort order to apply to timeline either descending or ascending . Valid values are ` desc ` or ` asc ` . Defaults to ` desc ` . Always descending when ` since ` is not sent as ` since ` defaults to current time . ( optional default to ' desc ' )
public function metricTimelineAsyncWithHttpInfo($metric_id, $since = null, $count = 50, $sort = 'desc')
    {
        $returnType = 'array<string,object>';
        $request = $this->metricTimelineRequest($metric_id, $since, $count, $sort);
        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); 
                    } else {
                        $content = (string) $response->getBody();
                    }
                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }
public function metricTimelineAsyncWithHttpInfo ( $ metric_id , $ since = null , $ count = 50 , $ sort = 'desc' ) { $ returnType = 'array<string,object>' ; $ request = $ this -> metricTimelineRequest ( $ metric_id , $ since , $ count , $ sort ) ; return $ this -> client -> sendAsync ( $ request , $ this -> createHttpClientOption ( ) ) -> then ( function ( $ response ) use ( $ returnType ) { if ( $ returnType === '\SplFileObject' ) { $ content = $ response -> getBody ( ) ; } else { $ content = ( string ) $ response -> getBody ( ) ; } return [ ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } , function ( $ exception ) { $ response = $ exception -> getResponse ( ) ; $ statusCode = $ response -> getStatusCode ( ) ; throw new ApiException ( sprintf ( '[%d] Error connecting to the API (%s)' , $ statusCode , $ exception -> getRequest ( ) -> getUri ( ) ) , $ statusCode , $ response -> getHeaders ( ) , ( string ) $ response -> getBody ( ) ) ; } ) ; }
Operation metricTimelineAsyncWithHttpInfo
 Get Events for a Specific Metric
Operation metricTimelineAsyncWithHttpInfo Get Events for a Specific Metric
//stream goes to serializer