$body RunReportRequest body. * @return array RunReportResponse. * @throws ApiError On failure. */ public function run_report( string $property_id, array $body ): array { $this->assert_property_id( $property_id ); $body['returnPropertyQuota'] = true; return $this->call( 'POST', self::BASE . '/' . $property_id . ':runReport', $body ); } /** * Runs several reports in one call. * * @param string $property_id A property resource name, e.g. 'properties/123'. * @param array $requests RunReportRequest bodies; returnPropertyQuota is added to each. * @return array ['reports' => RunReportResponse[]]. * @throws ApiError On failure. */ public function batch_run_reports( string $property_id, array $requests ): array { $this->assert_property_id( $property_id ); foreach ( $requests as $i => $request ) { $request = is_array( $request ) ? $request : array(); $request['returnPropertyQuota'] = true; $requests[ $i ] = $request; } return $this->call( 'POST', self::BASE . '/' . $property_id . ':batchRunReports', array( 'requests' => $requests ) ); } /** * Runs a realtime report. * * @param string $property_id A property resource name, e.g. 'properties/123'. * @param array $body RunRealtimeReportRequest body; returnPropertyQuota is added. * @return array RunRealtimeReportResponse. * @throws ApiError On failure. */ public function run_realtime_report( string $property_id, array $body ): array { $this->assert_property_id( $property_id ); $body['returnPropertyQuota'] = true; return $this->call( 'POST', self::BASE . '/' . $property_id . ':runRealtimeReport', $body ); } }