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

/**
 * Builder for model PhoneNumber
 *
 * @see PhoneNumber
 */
class PhoneNumberBuilder
{
    /**
     * @var PhoneNumber
     */
    private $instance;

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

    /**
     * Initializes a new phone number Builder object.
     */
    public static function init(string $nationalNumber): self
    {
        return new self(new PhoneNumber($nationalNumber));
    }

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