<?php

declare(strict_types=1);

/*
 * PaypalServerSDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

namespace PaypalServerSDKLib\Models\Builders;

use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\CardSupplementaryData;
use PaypalServerSDKLib\Models\SupplementaryData;

/**
 * Builder for model SupplementaryData
 *
 * @see SupplementaryData
 */
class SupplementaryDataBuilder
{
    /**
     * @var SupplementaryData
     */
    private $instance;

    private function __construct(SupplementaryData $instance)
    {
        $this->instance = $instance;
    }

    /**
     * Initializes a new supplementary data Builder object.
     */
    public static function init(): self
    {
        return new self(new SupplementaryData());
    }

    /**
     * Sets card field.
     */
    public function card(?CardSupplementaryData $value): self
    {
        $this->instance->setCard($value);
        return $this;
    }

    /**
     * Initializes a new supplementary data object.
     */
    public function build(): SupplementaryData
    {
        return CoreHelper::clone($this->instance);
    }
}
