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

/**
 * Builder for model CallbackConfiguration
 *
 * @see CallbackConfiguration
 */
class CallbackConfigurationBuilder
{
    /**
     * @var CallbackConfiguration
     */
    private $instance;

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

    /**
     * Initializes a new Callback Configuration Builder object.
     *
     * @param string[] $callbackEvents
     * @param string $callbackUrl
     */
    public static function init(array $callbackEvents, string $callbackUrl): self
    {
        return new self(new CallbackConfiguration($callbackEvents, $callbackUrl));
    }

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