<?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\RefundPaymentInstruction;
use PaypalServerSdkLib\Models\RefundPlatformFee;

/**
 * Builder for model RefundPaymentInstruction
 *
 * @see RefundPaymentInstruction
 */
class RefundPaymentInstructionBuilder
{
    /**
     * @var RefundPaymentInstruction
     */
    private $instance;

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

    /**
     * Initializes a new Refund Payment Instruction Builder object.
     */
    public static function init(): self
    {
        return new self(new RefundPaymentInstruction());
    }

    /**
     * Sets platform fees field.
     *
     * @param RefundPlatformFee[]|null $value
     */
    public function platformFees(?array $value): self
    {
        $this->instance->setPlatformFees($value);
        return $this;
    }

    /**
     * Initializes a new Refund Payment Instruction object.
     */
    public function build(): RefundPaymentInstruction
    {
        return CoreHelper::clone($this->instance);
    }
}
