<?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\CardAttributesResponse;
use PaypalServerSdkLib\Models\CardVaultResponse;

/**
 * Builder for model CardAttributesResponse
 *
 * @see CardAttributesResponse
 */
class CardAttributesResponseBuilder
{
    /**
     * @var CardAttributesResponse
     */
    private $instance;

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

    /**
     * Initializes a new Card Attributes Response Builder object.
     */
    public static function init(): self
    {
        return new self(new CardAttributesResponse());
    }

    /**
     * Sets vault field.
     *
     * @param CardVaultResponse|null $value
     */
    public function vault(?CardVaultResponse $value): self
    {
        $this->instance->setVault($value);
        return $this;
    }

    /**
     * Initializes a new Card Attributes Response object.
     */
    public function build(): CardAttributesResponse
    {
        return CoreHelper::clone($this->instance);
    }
}
