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

/**
 * Builder for model OrderUpdateCallbackErrorResponseDetails
 *
 * @see OrderUpdateCallbackErrorResponseDetails
 */
class OrderUpdateCallbackErrorResponseDetailsBuilder
{
    /**
     * @var OrderUpdateCallbackErrorResponseDetails
     */
    private $instance;

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

    /**
     * Initializes a new Order Update Callback Error Response Details Builder object.
     *
     * @param string $issue
     */
    public static function init(string $issue): self
    {
        return new self(new OrderUpdateCallbackErrorResponseDetails($issue));
    }

    /**
     * Sets field field.
     *
     * @param string|null $value
     */
    public function field(?string $value): self
    {
        $this->instance->setField($value);
        return $this;
    }

    /**
     * Sets value field.
     *
     * @param string|null $value
     */
    public function value(?string $value): self
    {
        $this->instance->setValue($value);
        return $this;
    }

    /**
     * Initializes a new Order Update Callback Error Response Details object.
     */
    public function build(): OrderUpdateCallbackErrorResponseDetails
    {
        return CoreHelper::clone($this->instance);
    }
}
