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