<?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;
use PaypalServerSDKLib\Models\CaptureStatusWithDetails;

/**
 * Builder for model CaptureStatusWithDetails
 *
 * @see CaptureStatusWithDetails
 */
class CaptureStatusWithDetailsBuilder
{
    /**
     * @var CaptureStatusWithDetails
     */
    private $instance;

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

    /**
     * Initializes a new capture status with details Builder object.
     */
    public static function init(): self
    {
        return new self(new CaptureStatusWithDetails());
    }

    /**
     * Sets status field.
     */
    public function status(?string $value): self
    {
        $this->instance->setStatus($value);
        return $this;
    }

    /**
     * Sets status details field.
     */
    public function statusDetails(?CaptureStatusDetails $value): self
    {
        $this->instance->setStatusDetails($value);
        return $this;
    }

    /**
     * Initializes a new capture status with details object.
     */
    public function build(): CaptureStatusWithDetails
    {
        return CoreHelper::clone($this->instance);
    }
}
