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

/**
 * Builder for model CaptureStatusDetails
 *
 * @see CaptureStatusDetails
 */
class CaptureStatusDetailsBuilder
{
    /**
     * @var CaptureStatusDetails
     */
    private $instance;

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

    /**
     * Initializes a new Capture Status Details Builder object.
     */
    public static function init(): self
    {
        return new self(new CaptureStatusDetails());
    }

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

    /**
     * Initializes a new Capture Status Details object.
     */
    public function build(): CaptureStatusDetails
    {
        return CoreHelper::clone($this->instance);
    }
}
