<?php
/**
 * Ptsv2paymentsOrderInformationAmountDetailsOrder
 *
 * PHP version 5
 *
 * @category Class
 * @package  CyberSource
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * CyberSource Merged Spec
 *
 * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
 *
 * OpenAPI spec version: 0.0.1
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */
/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace CyberSource\Model;

use \ArrayAccess;

/**
 * Ptsv2paymentsOrderInformationAmountDetailsOrder Class Doc Comment
 *
 * @category    Class
 * @package     CyberSource
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class Ptsv2paymentsOrderInformationAmountDetailsOrder implements ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'ptsv2payments_orderInformation_amountDetails_order';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'totalAmount' => 'string',
        'currency' => 'string',
        'subTotalAmount' => 'string',
        'handlingAmount' => 'string',
        'shippingAmount' => 'string',
        'shippingDiscountAmount' => 'string',
        'taxAmount' => 'string',
        'insuranceAmount' => 'string',
        'giftWrapAmount' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerFormats = [
        'totalAmount' => null,
        'currency' => null,
        'subTotalAmount' => null,
        'handlingAmount' => null,
        'shippingAmount' => null,
        'shippingDiscountAmount' => null,
        'taxAmount' => null,
        'insuranceAmount' => null,
        'giftWrapAmount' => null
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'totalAmount' => 'totalAmount',
        'currency' => 'currency',
        'subTotalAmount' => 'subTotalAmount',
        'handlingAmount' => 'handlingAmount',
        'shippingAmount' => 'shippingAmount',
        'shippingDiscountAmount' => 'shippingDiscountAmount',
        'taxAmount' => 'taxAmount',
        'insuranceAmount' => 'insuranceAmount',
        'giftWrapAmount' => 'giftWrapAmount'
    ];


    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'totalAmount' => 'setTotalAmount',
        'currency' => 'setCurrency',
        'subTotalAmount' => 'setSubTotalAmount',
        'handlingAmount' => 'setHandlingAmount',
        'shippingAmount' => 'setShippingAmount',
        'shippingDiscountAmount' => 'setShippingDiscountAmount',
        'taxAmount' => 'setTaxAmount',
        'insuranceAmount' => 'setInsuranceAmount',
        'giftWrapAmount' => 'setGiftWrapAmount'
    ];


    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'totalAmount' => 'getTotalAmount',
        'currency' => 'getCurrency',
        'subTotalAmount' => 'getSubTotalAmount',
        'handlingAmount' => 'getHandlingAmount',
        'shippingAmount' => 'getShippingAmount',
        'shippingDiscountAmount' => 'getShippingDiscountAmount',
        'taxAmount' => 'getTaxAmount',
        'insuranceAmount' => 'getInsuranceAmount',
        'giftWrapAmount' => 'getGiftWrapAmount'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    

    

    /**
     * Associative array for storing property values
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     * @param mixed[] $data Associated array of property values initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['totalAmount'] = isset($data['totalAmount']) ? $data['totalAmount'] : null;
        $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;
        $this->container['subTotalAmount'] = isset($data['subTotalAmount']) ? $data['subTotalAmount'] : null;
        $this->container['handlingAmount'] = isset($data['handlingAmount']) ? $data['handlingAmount'] : null;
        $this->container['shippingAmount'] = isset($data['shippingAmount']) ? $data['shippingAmount'] : null;
        $this->container['shippingDiscountAmount'] = isset($data['shippingDiscountAmount']) ? $data['shippingDiscountAmount'] : null;
        $this->container['taxAmount'] = isset($data['taxAmount']) ? $data['taxAmount'] : null;
        $this->container['insuranceAmount'] = isset($data['insuranceAmount']) ? $data['insuranceAmount'] : null;
        $this->container['giftWrapAmount'] = isset($data['giftWrapAmount']) ? $data['giftWrapAmount'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = [];

        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        return true;
    }


    /**
     * Gets totalAmount
     * @return string
     */
    public function getTotalAmount()
    {
        return $this->container['totalAmount'];
    }

    /**
     * Sets totalAmount
     * @param string $totalAmount Grand total for the order. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places
     * @return $this
     */
    public function setTotalAmount($totalAmount)
    {
        $this->container['totalAmount'] = $totalAmount;

        return $this;
    }

    /**
     * Gets currency
     * @return string
     */
    public function getCurrency()
    {
        return $this->container['currency'];
    }

    /**
     * Sets currency
     * @param string $currency Currency used for the order
     * @return $this
     */
    public function setCurrency($currency)
    {
        $this->container['currency'] = $currency;

        return $this;
    }

    /**
     * Gets subTotalAmount
     * @return string
     */
    public function getSubTotalAmount()
    {
        return $this->container['subTotalAmount'];
    }

    /**
     * Sets subTotalAmount
     * @param string $subTotalAmount Shipping discount amount for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
     * @return $this
     */
    public function setSubTotalAmount($subTotalAmount)
    {
        $this->container['subTotalAmount'] = $subTotalAmount;

        return $this;
    }

    /**
     * Gets handlingAmount
     * @return string
     */
    public function getHandlingAmount()
    {
        return $this->container['handlingAmount'];
    }

    /**
     * Sets handlingAmount
     * @param string $handlingAmount Aggregate handling charges for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
     * @return $this
     */
    public function setHandlingAmount($handlingAmount)
    {
        $this->container['handlingAmount'] = $handlingAmount;

        return $this;
    }

    /**
     * Gets shippingAmount
     * @return string
     */
    public function getShippingAmount()
    {
        return $this->container['shippingAmount'];
    }

    /**
     * Sets shippingAmount
     * @param string $shippingAmount Aggregate shipping charges for the transaction If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
     * @return $this
     */
    public function setShippingAmount($shippingAmount)
    {
        $this->container['shippingAmount'] = $shippingAmount;

        return $this;
    }

    /**
     * Gets shippingDiscountAmount
     * @return string
     */
    public function getShippingDiscountAmount()
    {
        return $this->container['shippingDiscountAmount'];
    }

    /**
     * Sets shippingDiscountAmount
     * @param string $shippingDiscountAmount Shipping discount amount for the transaction. If this amount has changed since the initial sessions request, you must include the new value in the order request. You must also include all additional amount fields that apply to the order and ensure the total amount equals the purchaseTotals_grandTotalAmount value.
     * @return $this
     */
    public function setShippingDiscountAmount($shippingDiscountAmount)
    {
        $this->container['shippingDiscountAmount'] = $shippingDiscountAmount;

        return $this;
    }

    /**
     * Gets taxAmount
     * @return string
     */
    public function getTaxAmount()
    {
        return $this->container['taxAmount'];
    }

    /**
     * Sets taxAmount
     * @param string $taxAmount Total tax amount. When the purchaseTotals_ taxAmount and ap_subtotalAmount fields are included in the request, do not include the tax amount as part of the subtotal amount calculation.
     * @return $this
     */
    public function setTaxAmount($taxAmount)
    {
        $this->container['taxAmount'] = $taxAmount;

        return $this;
    }

    /**
     * Gets insuranceAmount
     * @return string
     */
    public function getInsuranceAmount()
    {
        return $this->container['insuranceAmount'];
    }

    /**
     * Sets insuranceAmount
     * @param string $insuranceAmount Amount being charged for the insurance fee. Only supported when the payment_method is set to paypal.
     * @return $this
     */
    public function setInsuranceAmount($insuranceAmount)
    {
        $this->container['insuranceAmount'] = $insuranceAmount;

        return $this;
    }

    /**
     * Gets giftWrapAmount
     * @return string
     */
    public function getGiftWrapAmount()
    {
        return $this->container['giftWrapAmount'];
    }

    /**
     * Sets giftWrapAmount
     * @param string $giftWrapAmount Amount being charged as gift wrap fee.
     * @return $this
     */
    public function setGiftWrapAmount($giftWrapAmount)
    {
        $this->container['giftWrapAmount'] = $giftWrapAmount;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     * @param  integer $offset Offset
     * @param  mixed   $value  Value to be set
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     * @param  integer $offset Offset
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(\CyberSource\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\CyberSource\ObjectSerializer::sanitizeForSerialization($this));
    }
}


