<?php

declare (strict_types=1);
/*
 * PaypalServerSdkLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */
namespace FormGent\PaypalServerSdkLib\Models\Builders;

use FormGent\Core\Utils\CoreHelper;
use FormGent\PaypalServerSdkLib\Models\Address;
use FormGent\PaypalServerSdkLib\Models\OrderTrackerResponse;
use FormGent\PaypalServerSdkLib\Models\PhoneNumberWithCountryCode;
use FormGent\PaypalServerSdkLib\Models\ShippingName;
use FormGent\PaypalServerSdkLib\Models\ShippingOption;
use FormGent\PaypalServerSdkLib\Models\ShippingWithTrackingDetails;
/**
 * Builder for model ShippingWithTrackingDetails
 *
 * @see ShippingWithTrackingDetails
 */
class ShippingWithTrackingDetailsBuilder
{
    /**
     * @var ShippingWithTrackingDetails
     */
    private $instance;
    private function __construct(ShippingWithTrackingDetails $instance)
    {
        $this->instance = $instance;
    }
    /**
     * Initializes a new Shipping With Tracking Details Builder object.
     */
    public static function init() : self
    {
        return new self(new ShippingWithTrackingDetails());
    }
    /**
     * Sets name field.
     *
     * @param ShippingName|null $value
     */
    public function name(?ShippingName $value) : self
    {
        $this->instance->setName($value);
        return $this;
    }
    /**
     * Sets email address field.
     *
     * @param string|null $value
     */
    public function emailAddress(?string $value) : self
    {
        $this->instance->setEmailAddress($value);
        return $this;
    }
    /**
     * Sets phone number field.
     *
     * @param PhoneNumberWithCountryCode|null $value
     */
    public function phoneNumber(?PhoneNumberWithCountryCode $value) : self
    {
        $this->instance->setPhoneNumber($value);
        return $this;
    }
    /**
     * Sets type field.
     *
     * @param string|null $value
     */
    public function type(?string $value) : self
    {
        $this->instance->setType($value);
        return $this;
    }
    /**
     * Sets options field.
     *
     * @param ShippingOption[]|null $value
     */
    public function options(?array $value) : self
    {
        $this->instance->setOptions($value);
        return $this;
    }
    /**
     * Sets address field.
     *
     * @param Address|null $value
     */
    public function address(?Address $value) : self
    {
        $this->instance->setAddress($value);
        return $this;
    }
    /**
     * Sets trackers field.
     *
     * @param OrderTrackerResponse[]|null $value
     */
    public function trackers(?array $value) : self
    {
        $this->instance->setTrackers($value);
        return $this;
    }
    /**
     * Initializes a new Shipping With Tracking Details object.
     */
    public function build() : ShippingWithTrackingDetails
    {
        return CoreHelper::clone($this->instance);
    }
}
