<?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\UniversalProductCode;

/**
 * Builder for model UniversalProductCode
 *
 * @see UniversalProductCode
 */
class UniversalProductCodeBuilder
{
    /**
     * @var UniversalProductCode
     */
    private $instance;

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

    /**
     * Initializes a new Universal Product Code Builder object.
     *
     * @param string $type
     * @param string $code
     */
    public static function init(string $type, string $code): self
    {
        return new self(new UniversalProductCode($type, $code));
    }

    /**
     * Initializes a new Universal Product Code object.
     */
    public function build(): UniversalProductCode
    {
        return CoreHelper::clone($this->instance);
    }
}
