<?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.
     */
    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);
    }
}
