<?php

namespace App\Data\Pagarme\Customer\Parts\Request;

use App\Data\Pagarme\PagarmeData;

final readonly class AddressData extends PagarmeData
{
    public function __construct(
        public ?string $line1,
        public ?string $line2,
        public ?string $zipCode,
        public ?string $city,
        public ?string $state,
        public ?string $country,
    ) {}

    public function toArray(): array
    {
        return $this->filterFilledRecursive([
            'line_1'   => $this->line1,
            'line_2'   => $this->line2,
            'zip_code' => $this->zipCode,
            'city'     => $this->city,
            'state'    => $this->state,
            'country'  => $this->country,
        ]);
    }
}
