<?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\PhoneWithType;
use PaypalServerSdkLib\Models\SubscriptionCustomerInformation;

/**
 * Builder for model SubscriptionCustomerInformation
 *
 * @see SubscriptionCustomerInformation
 */
class SubscriptionCustomerInformationBuilder
{
    /**
     * @var SubscriptionCustomerInformation
     */
    private $instance;

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

    /**
     * Initializes a new Subscription Customer Information Builder object.
     */
    public static function init(): self
    {
        return new self(new SubscriptionCustomerInformation());
    }

    /**
     * Sets id field.
     *
     * @param string|null $value
     */
    public function id(?string $value): self
    {
        $this->instance->setId($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 field.
     *
     * @param PhoneWithType|null $value
     */
    public function phone(?PhoneWithType $value): self
    {
        $this->instance->setPhone($value);
        return $this;
    }

    /**
     * Initializes a new Subscription Customer Information object.
     */
    public function build(): SubscriptionCustomerInformation
    {
        return CoreHelper::clone($this->instance);
    }
}
