* }>, * seconds: int, * cost: int|null * } */ class DetailedWithDataReportResource extends BaseResource { /** * @var Data */ private array $data; /** * @var Data */ private array $historyData; /** * @param Data $data * @param Data $historyData */ public function __construct(Report $resource, array $data, array $historyData) { parent::__construct($resource); $this->data = $data; $this->historyData = $historyData; } /** * Transform the resource into an array. * * @return array>> */ public function toArray(Request $request): array { return [ /** @var string $name Name */ 'name' => $this->resource->name, /** @var string|null $email Description */ 'description' => $this->resource->description, /** @var string|null $public_until Date until the report is public */ 'public_until' => $this->formatDateTime($this->resource->public_until), /** @var string $currency Currency code (ISO 4217) */ 'currency' => $this->resource->organization->currency, /** @var string $number_format Number format */ 'number_format' => $this->resource->organization->number_format, /** @var string $currency_format Currency format */ 'currency_format' => $this->resource->organization->currency_format, /** @var string $date_format Date format */ 'date_format' => $this->resource->organization->date_format, /** @var string $interval_format Interval format */ 'interval_format' => $this->resource->organization->interval_format, /** @var string $time_format Time format */ 'time_format' => $this->resource->organization->time_format, 'properties' => [ /** @var string $group Type of first grouping */ 'group' => $this->resource->properties->group->value, /** @var string $sub_group Type of second grouping */ 'sub_group' => $this->resource->properties->subGroup->value, /** @var string $history_group Type of grouping of the historic aggregation (time chart) */ 'history_group' => $this->resource->properties->historyGroup->value, /** @var string $start Start date of the report */ 'start' => $this->formatDateTime($this->resource->properties->start), /** @var string $end End date of the report */ 'end' => $this->formatDateTime($this->resource->properties->end), ], /** @var array{ * grouped_type: string|null, * grouped_data: null|array * }>, * seconds: int, * cost: int * } $data Aggregated data */ 'data' => $this->data, /** @var array{ * grouped_type: string|null, * grouped_data: null|array * }>, * seconds: int, * cost: int * } $history_data Historic aggregated data */ 'history_data' => $this->historyData, ]; } }