public function toArray()
    {
        $card = str_array_filter([
            'id' => $this->id,
            'style' => $this->style,
            'format' => $this->cardFormat,
            'title' => $this->title,
            'url' => $this->url,
        ]);

        if (! str_empty($this->content)) {
            $card['description'] = [
                'value' => $this->content,
                'format' => $this->format,
            ];
        }

        if (! str_empty($this->thumbnail)) {
            $card['thumbnail'] = str_array_filter([
                'url' => $this->thumbnail,
                'url@2x' => $this->thumbnail2,
                'width' => $this->thumbnailWidth,
                'height' => $this->thumbnailHeight,
            ]);
        }

        if (! str_empty($this->activity)) {
            $card['activity'] = str_array_filter([
                'html' => $this->activity,
                'icon' => str_array_filter([
                    'url' => $this->activityIcon,
                    'url@2x' => $this->activityIcon2,
                ]),
            ]);
        }

        if (! str_empty($this->icon)) {
            $card['icon'] = str_array_filter([
                'url' => $this->icon,
                'url@2x' => $this->icon2,
            ]);
        }

        if (! empty($this->attributes)) {
            $card['attributes'] = array_map(function (CardAttribute $attribute) {
                return $attribute->toArray();
            }, $this->attributes);
        }

        return $card;
    }