<?php


class Order implements \JsonSerializable
{
    private $code;	
    private $sessionID;
    private $date;	
    private $email;	
    private $b2bB2c;	
    private $itemValue;
    private $totalValue;
    private $numberOfInstallments;
    private $ip;
    private $isGift;
    private $giftMessage;
    private $observation;
    private $status;
    private $origin;
    private $channelID;
    private $reservationDate;
    private $country;
    private $nationality;
    private $product;
    private $customSla;
    private $bankAuthentication;
    private $subAcquirer;
    private $list;
    private $purchaseInformation;
    private $socialNetwork;
    private $billing;
    private $shipping;
    private $payments;
    private $items;

    public function jsonSerialize(): mixed
    {

        $obj = clone $this;
        $keys = get_object_vars($obj);
        foreach ($keys as $key => $value) {
            if ($value===null || $value==='') {
                unset($obj->{$key});
            }
        }

        return get_object_vars($obj);

    }

    /**
     * Get the value of code
     */ 
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Set the value of code
     *
     * @return  self
     */ 
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

    /**
     * Get the value of sessionID
     */ 
    public function getSessionID()
    {
        return $this->sessionID;
    }

    /**
     * Set the value of sessionID
     *
     * @return  self
     */ 
    public function setSessionID($sessionID)
    {
        $this->sessionID = $sessionID;

        return $this;
    }

    /**
     * Get the value of date
     */ 
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Set the value of date
     *
     * @return  self
     */ 
    public function setDate($date)
    {
        $this->date = $date;

        return $this;
    }

    /**
     * Get the value of email
     */ 
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set the value of email
     *
     * @return  self
     */ 
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

    /**
     * Get the value of b2bB2c
     */ 
    public function getB2bB2c()
    {
        return $this->b2bB2c;
    }

    /**
     * Set the value of b2bB2c
     *
     * @return  self
     */ 
    public function setB2bB2c($b2bB2c)
    {
        $this->b2bB2c = $b2bB2c;

        return $this;
    }

    /**
     * Get the value of itemValue
     */ 
    public function getItemValue()
    {
        return $this->itemValue;
    }

    /**
     * Set the value of itemValue
     *
     * @return  self
     */ 
    public function setItemValue($itemValue)
    {
        $this->itemValue = $itemValue;

        return $this;
    }

    

    /**
     * Get the value of numberOfInstallments
     */ 
    public function getNumberOfInstallments()
    {
        return $this->numberOfInstallments;
    }

    /**
     * Set the value of numberOfInstallments
     *
     * @return  self
     */ 
    public function setNumberOfInstallments($numberOfInstallments)
    {
        $this->numberOfInstallments = $numberOfInstallments;

        return $this;
    }

    /**
     * Get the value of ip
     */ 
    public function getIp()
    {
        return $this->ip;
    }

    /**
     * Set the value of ip
     *
     * @return  self
     */ 
    public function setIp($ip)
    {
        $this->ip = $ip;

        return $this;
    }

    /**
     * Get the value of isGift
     */ 
    public function getIsGift()
    {
        return $this->isGift;
    }

    /**
     * Set the value of isGift
     *
     * @return  self
     */ 
    public function setIsGift($isGift)
    {
        $this->isGift = $isGift;

        return $this;
    }

    /**
     * Get the value of giftMessage
     */ 
    public function getGiftMessage()
    {
        return $this->giftMessage;
    }

    /**
     * Set the value of giftMessage
     *
     * @return  self
     */ 
    public function setGiftMessage($giftMessage)
    {
        $this->giftMessage = $giftMessage;

        return $this;
    }

    /**
     * Get the value of observation
     */ 
    public function getObservation()
    {
        return $this->observation;
    }

    /**
     * Set the value of observation
     *
     * @return  self
     */ 
    public function setObservation($observation)
    {
        $this->observation = $observation;

        return $this;
    }

    /**
     * Get the value of status
     */ 
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set the value of status
     *
     * @return  self
     */ 
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get the value of origin
     */ 
    public function getOrigin()
    {
        return $this->origin;
    }

    /**
     * Set the value of origin
     *
     * @return  self
     */ 
    public function setOrigin($origin)
    {
        $this->origin = $origin;

        return $this;
    }

    /**
     * Get the value of channelID
     */ 
    public function getChannelID()
    {
        return $this->channelID;
    }

    /**
     * Set the value of channelID
     *
     * @return  self
     */ 
    public function setChannelID($channelID)
    {
        $this->channelID = $channelID;

        return $this;
    }

    /**
     * Get the value of reservationDate
     */ 
    public function getReservationDate()
    {
        return $this->reservationDate;
    }

    /**
     * Set the value of reservationDate
     *
     * @return  self
     */ 
    public function setReservationDate($reservationDate)
    {
        $this->reservationDate = $reservationDate;

        return $this;
    }

    /**
     * Get the value of country
     */ 
    public function getCountry()
    {
        return $this->country;
    }

    /**
     * Set the value of country
     *
     * @return  self
     */ 
    public function setCountry($country)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get the value of nationality
     */ 
    public function getNationality()
    {
        return $this->nationality;
    }

    /**
     * Set the value of nationality
     *
     * @return  self
     */ 
    public function setNationality($nationality)
    {
        $this->nationality = $nationality;

        return $this;
    }

    /**
     * Get the value of product
     */ 
    public function getProduct()
    {
        return $this->product;
    }

    /**
     * Set the value of product
     *
     * @return  self
     */ 
    public function setProduct($product)
    {
        $this->product = $product;

        return $this;
    }

    /**
     * Get the value of customSla
     */ 
    public function getCustomSla()
    {
        return $this->customSla;
    }

    /**
     * Set the value of customSla
     *
     * @return  self
     */ 
    public function setCustomSla($customSla)
    {
        $this->customSla = $customSla;

        return $this;
    }

    /**
     * Get the value of bankAuthentication
     */ 
    public function getBankAuthentication()
    {
        return $this->bankAuthentication;
    }

    /**
     * Set the value of bankAuthentication
     *
     * @return  self
     */ 
    public function setBankAuthentication($bankAuthentication)
    {
        $this->bankAuthentication = $bankAuthentication;

        return $this;
    }

    /**
     * Get the value of subAcquirer
     */ 
    public function getSubAcquirer()
    {
        return $this->subAcquirer;
    }

    /**
     * Set the value of subAcquirer
     *
     * @return  self
     */ 
    public function setSubAcquirer($subAcquirer)
    {
        $this->subAcquirer = $subAcquirer;

        return $this;
    }


    

    /**
     * Get the value of list
     */ 
    public function getList()
    {
        return $this->list;
    }

    /**
     * Set the value of list
     *
     * @return  self
     */ 
    public function setList($list)
    {
        $this->list = $list;

        return $this;
    }

    public function PurchaseInformation()
    {
        $purchase = new Purchase();
        $this->setPurchaseInformation($purchase);
        return $purchase;        
    }     

    /**
     * Get the value of purchaseInformation
     */ 
    public function getPurchaseInformation()
    {
        return $this->purchaseInformation;
    }

    /**
     * Set the value of purchaseInformation
     *
     * @return  self
     */ 
    public function setPurchaseInformation($purchaseInformation)
    {
        $this->purchaseInformation = $purchaseInformation;

        return $this;
    }

    /**
     * Get the value of socialNetwork
     */ 
    public function getSocialNetwork()
    {
        return $this->socialNetwork;
    }

    /**
     * Set the value of socialNetwork
     *
     * @return  self
     */ 
    public function setSocialNetwork($socialNetwork)
    {
        $this->socialNetwork = $socialNetwork;

        return $this;
    }

    public function Billing()
    {
        $billing = new Billing();
        $this->setBilling($billing);
        return $billing;        
    }    

    /**
     * Get the value of billing
     */ 
    public function getBilling()
    {
        return $this->billing;
    }

    /**
     * Set the value of billing
     *
     * @return  self
     */ 
    public function setBilling($billing)
    {
        $this->billing = $billing;
        return $this;
    }

    public function Shipping()
    {
        $shipping = new Shipping();
        $this->setShipping($shipping);
        return $shipping;        
    }

    /**
     * Get the value of shipping
     */ 
    public function getShipping()
    {
        return $this->shipping;
    }

    /**
     * Set the value of shipping
     *
     * @return  self
     */ 
    public function setShipping($shipping)
    {
        $this->shipping = $shipping;

        return $this;
    }

    /**
     * Get the value of payments
     */ 
    public function getPayments()
    {
        return $this->payments;
    }

    /**
     * Set the value of payments
     *
     * @return  self
     */ 
    public function setPayments($payments)
    {
        $this->payments = $payments;

        return $this;
    }

    public function addPayment(Payment $payment)
    {
        if ($this->payments == null) {
            $this->payments = [];
        }
        $this->payments[] = $payment;

        return $this;
    }      


    /**
     * Get the value of items
     */ 
    public function getItems()
    {
        return $this->items;
    }

    /**
     * Set the value of items
     *
     * @return  self
     */ 
    public function setItems($items)
    {
        $this->items = $items;

        return $this;
    }

    public function addItem(Item $item)
    {
        if ($this->items == null) {
            $this->items = [];
        }
        $this->items[] = $item;

        return $this;
    }     

    /**
     * Get the value of totalValue
     */ 
    public function getTotalValue()
    {
        return $this->totalValue;
    }

    /**
     * Set the value of totalValue
     *
     * @return  self
     */ 
    public function setTotalValue($totalValue)
    {
        $this->totalValue = $totalValue;

        return $this;
    }
}