<?php
/**
 * OrderShippingAddress
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  Bigcommerce\OrdersV2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Orders V2
 *
 * Manage order coupons, messages, products, shipping addresses, statuses, taxes, shipments, and shipping address quotes.  - [Authentication](#authentication) - [Order](#order)  ## Authentication  Authenticate requests by including an [OAuth](https://developer.bigcommerce.com/api-docs/getting-started/authentication) `access_token` request header.  ```http GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/{{ENDPOINT}} Content-Type: application/json X-Auth-Token: {{ACCESS_TOKEN}} ```  ### OAuth Scopes  |  **UI Name** | **Permission** | **Parameter** | | --- | --- | --- | |  Orders | modify | `store_v2_orders` | |  Orders | read-only | `store_v2_orders_read_only` |   ## Order  The Order object contains a record of the purchase agreement between a shopper and a merchant. To learn more about creating orders, see [Orders API Guide](/api-docs/orders/orders-api-overview).  ### Currency Fields  The **default** currency refers to the transactional currency which is the currency the shopper pays in.  The **display** currency refers to the presentational currency used to present prices to the shopper on the storefront.  * `currency_id` - the display currency ID. Depending on the currency selected, the value may be different from the transactional currency. * `currency_code` - the currency code of the display currency used to present prices to the shopper on the storefront. Depending on the currency selected, the value may be different from the transactional currency. * `currency_exchange_rate` - the exchange rate between the store's default currency and the display currency. For orders created using the V2 endpoints, this value is always 1 (only in the storefront this value can be different to 1). * `default_currency_id` - the transactional currency ID. * `default_currency_code` - the currency code of the transactional currency the shopper pays in.  The following additional fields are returned on orders when Multi-Currency is enabled on the store:  * `store_default_currency_code` - the currency code of the store's default currency. * `store_default_to_transactional_exchange_rate` - the exchange rate between the store's default currency and the transactional currency used in the order.  **Example:**  ```json {   ...   \"currency_id\": 4,   \"currency_code\": \"EUR\",   \"currency_exchange_rate\": 1,   \"default_currency_id\": 4,   \"default_currency_code\": \"EUR\",   \"store_default_currency_code\": \"USD\",   \"store_default_to_transactional_exchange_rate\": \"100.0000000000\"   ... } ```
 *
 * The version of the OpenAPI document: 
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.13.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Bigcommerce\OrdersV2\Model;

use \ArrayAccess;
use \Bigcommerce\OrdersV2\ObjectSerializer;

/**
 * OrderShippingAddress Class Doc Comment
 *
 * @category Class
 * @package  Bigcommerce\OrdersV2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class OrderShippingAddress implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'first_name' => 'string',
        'last_name' => 'string',
        'company' => 'string',
        'street_1' => 'string',
        'street_2' => 'string',
        'city' => 'string',
        'state' => 'string',
        'zip' => 'string',
        'country' => 'string',
        'country_iso2' => 'string',
        'phone' => 'string',
        'email' => 'string',
        'shipping_method' => 'string',
        'id' => 'int',
        'order_id' => 'int',
        'items_total' => 'float',
        'items_shipped' => 'float',
        'base_cost' => 'string',
        'cost_ex_tax' => 'string',
        'cost_inc_tax' => 'string',
        'cost_tax' => 'string',
        'cost_tax_class_id' => 'int',
        'base_handling_cost' => 'string',
        'handling_cost_ex_tax' => 'string',
        'handling_cost_inc_tax' => 'string',
        'handling_cost_tax' => 'string',
        'handling_cost_tax_class_id' => 'int',
        'shipping_zone_id' => 'float',
        'shipping_zone_name' => 'string',
        'form_fields' => '\Bigcommerce\OrdersV2\Model\FormFields[]',
        'shipping_quotes' => '\Bigcommerce\OrdersV2\Model\ShippingQuotesResource'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'first_name' => null,
        'last_name' => null,
        'company' => null,
        'street_1' => null,
        'street_2' => null,
        'city' => null,
        'state' => null,
        'zip' => null,
        'country' => null,
        'country_iso2' => null,
        'phone' => null,
        'email' => null,
        'shipping_method' => null,
        'id' => null,
        'order_id' => null,
        'items_total' => null,
        'items_shipped' => null,
        'base_cost' => null,
        'cost_ex_tax' => null,
        'cost_inc_tax' => null,
        'cost_tax' => null,
        'cost_tax_class_id' => null,
        'base_handling_cost' => null,
        'handling_cost_ex_tax' => null,
        'handling_cost_inc_tax' => null,
        'handling_cost_tax' => null,
        'handling_cost_tax_class_id' => null,
        'shipping_zone_id' => null,
        'shipping_zone_name' => null,
        'form_fields' => null,
        'shipping_quotes' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'first_name' => false,
        'last_name' => false,
        'company' => false,
        'street_1' => false,
        'street_2' => false,
        'city' => false,
        'state' => false,
        'zip' => false,
        'country' => false,
        'country_iso2' => false,
        'phone' => false,
        'email' => false,
        'shipping_method' => false,
        'id' => false,
        'order_id' => false,
        'items_total' => false,
        'items_shipped' => false,
        'base_cost' => false,
        'cost_ex_tax' => false,
        'cost_inc_tax' => false,
        'cost_tax' => false,
        'cost_tax_class_id' => false,
        'base_handling_cost' => false,
        'handling_cost_ex_tax' => false,
        'handling_cost_inc_tax' => false,
        'handling_cost_tax' => false,
        'handling_cost_tax_class_id' => false,
        'shipping_zone_id' => false,
        'shipping_zone_name' => false,
        'form_fields' => false,
        'shipping_quotes' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'first_name' => 'first_name',
        'last_name' => 'last_name',
        'company' => 'company',
        'street_1' => 'street_1',
        'street_2' => 'street_2',
        'city' => 'city',
        'state' => 'state',
        'zip' => 'zip',
        'country' => 'country',
        'country_iso2' => 'country_iso2',
        'phone' => 'phone',
        'email' => 'email',
        'shipping_method' => 'shipping_method',
        'id' => 'id',
        'order_id' => 'order_id',
        'items_total' => 'items_total',
        'items_shipped' => 'items_shipped',
        'base_cost' => 'base_cost',
        'cost_ex_tax' => 'cost_ex_tax',
        'cost_inc_tax' => 'cost_inc_tax',
        'cost_tax' => 'cost_tax',
        'cost_tax_class_id' => 'cost_tax_class_id',
        'base_handling_cost' => 'base_handling_cost',
        'handling_cost_ex_tax' => 'handling_cost_ex_tax',
        'handling_cost_inc_tax' => 'handling_cost_inc_tax',
        'handling_cost_tax' => 'handling_cost_tax',
        'handling_cost_tax_class_id' => 'handling_cost_tax_class_id',
        'shipping_zone_id' => 'shipping_zone_id',
        'shipping_zone_name' => 'shipping_zone_name',
        'form_fields' => 'form_fields',
        'shipping_quotes' => 'shipping_quotes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'first_name' => 'setFirstName',
        'last_name' => 'setLastName',
        'company' => 'setCompany',
        'street_1' => 'setStreet1',
        'street_2' => 'setStreet2',
        'city' => 'setCity',
        'state' => 'setState',
        'zip' => 'setZip',
        'country' => 'setCountry',
        'country_iso2' => 'setCountryIso2',
        'phone' => 'setPhone',
        'email' => 'setEmail',
        'shipping_method' => 'setShippingMethod',
        'id' => 'setId',
        'order_id' => 'setOrderId',
        'items_total' => 'setItemsTotal',
        'items_shipped' => 'setItemsShipped',
        'base_cost' => 'setBaseCost',
        'cost_ex_tax' => 'setCostExTax',
        'cost_inc_tax' => 'setCostIncTax',
        'cost_tax' => 'setCostTax',
        'cost_tax_class_id' => 'setCostTaxClassId',
        'base_handling_cost' => 'setBaseHandlingCost',
        'handling_cost_ex_tax' => 'setHandlingCostExTax',
        'handling_cost_inc_tax' => 'setHandlingCostIncTax',
        'handling_cost_tax' => 'setHandlingCostTax',
        'handling_cost_tax_class_id' => 'setHandlingCostTaxClassId',
        'shipping_zone_id' => 'setShippingZoneId',
        'shipping_zone_name' => 'setShippingZoneName',
        'form_fields' => 'setFormFields',
        'shipping_quotes' => 'setShippingQuotes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'first_name' => 'getFirstName',
        'last_name' => 'getLastName',
        'company' => 'getCompany',
        'street_1' => 'getStreet1',
        'street_2' => 'getStreet2',
        'city' => 'getCity',
        'state' => 'getState',
        'zip' => 'getZip',
        'country' => 'getCountry',
        'country_iso2' => 'getCountryIso2',
        'phone' => 'getPhone',
        'email' => 'getEmail',
        'shipping_method' => 'getShippingMethod',
        'id' => 'getId',
        'order_id' => 'getOrderId',
        'items_total' => 'getItemsTotal',
        'items_shipped' => 'getItemsShipped',
        'base_cost' => 'getBaseCost',
        'cost_ex_tax' => 'getCostExTax',
        'cost_inc_tax' => 'getCostIncTax',
        'cost_tax' => 'getCostTax',
        'cost_tax_class_id' => 'getCostTaxClassId',
        'base_handling_cost' => 'getBaseHandlingCost',
        'handling_cost_ex_tax' => 'getHandlingCostExTax',
        'handling_cost_inc_tax' => 'getHandlingCostIncTax',
        'handling_cost_tax' => 'getHandlingCostTax',
        'handling_cost_tax_class_id' => 'getHandlingCostTaxClassId',
        'shipping_zone_id' => 'getShippingZoneId',
        'shipping_zone_name' => 'getShippingZoneName',
        'form_fields' => 'getFormFields',
        'shipping_quotes' => 'getShippingQuotes'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


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

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('first_name', $data ?? [], null);
        $this->setIfExists('last_name', $data ?? [], null);
        $this->setIfExists('company', $data ?? [], null);
        $this->setIfExists('street_1', $data ?? [], null);
        $this->setIfExists('street_2', $data ?? [], null);
        $this->setIfExists('city', $data ?? [], null);
        $this->setIfExists('state', $data ?? [], null);
        $this->setIfExists('zip', $data ?? [], null);
        $this->setIfExists('country', $data ?? [], null);
        $this->setIfExists('country_iso2', $data ?? [], null);
        $this->setIfExists('phone', $data ?? [], null);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('shipping_method', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('order_id', $data ?? [], null);
        $this->setIfExists('items_total', $data ?? [], null);
        $this->setIfExists('items_shipped', $data ?? [], null);
        $this->setIfExists('base_cost', $data ?? [], null);
        $this->setIfExists('cost_ex_tax', $data ?? [], null);
        $this->setIfExists('cost_inc_tax', $data ?? [], null);
        $this->setIfExists('cost_tax', $data ?? [], null);
        $this->setIfExists('cost_tax_class_id', $data ?? [], null);
        $this->setIfExists('base_handling_cost', $data ?? [], null);
        $this->setIfExists('handling_cost_ex_tax', $data ?? [], null);
        $this->setIfExists('handling_cost_inc_tax', $data ?? [], null);
        $this->setIfExists('handling_cost_tax', $data ?? [], null);
        $this->setIfExists('handling_cost_tax_class_id', $data ?? [], null);
        $this->setIfExists('shipping_zone_id', $data ?? [], null);
        $this->setIfExists('shipping_zone_name', $data ?? [], null);
        $this->setIfExists('form_fields', $data ?? [], null);
        $this->setIfExists('shipping_quotes', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

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

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets first_name
     *
     * @return string|null
     */
    public function getFirstName()
    {
        return $this->container['first_name'];
    }

    /**
     * Sets first_name
     *
     * @param string|null $first_name first_name
     *
     * @return self
     */
    public function setFirstName($first_name)
    {
        if (is_null($first_name)) {
            throw new \InvalidArgumentException('non-nullable first_name cannot be null');
        }
        $this->container['first_name'] = $first_name;

        return $this;
    }

    /**
     * Gets last_name
     *
     * @return string|null
     */
    public function getLastName()
    {
        return $this->container['last_name'];
    }

    /**
     * Sets last_name
     *
     * @param string|null $last_name last_name
     *
     * @return self
     */
    public function setLastName($last_name)
    {
        if (is_null($last_name)) {
            throw new \InvalidArgumentException('non-nullable last_name cannot be null');
        }
        $this->container['last_name'] = $last_name;

        return $this;
    }

    /**
     * Gets company
     *
     * @return string|null
     */
    public function getCompany()
    {
        return $this->container['company'];
    }

    /**
     * Sets company
     *
     * @param string|null $company company
     *
     * @return self
     */
    public function setCompany($company)
    {
        if (is_null($company)) {
            throw new \InvalidArgumentException('non-nullable company cannot be null');
        }
        $this->container['company'] = $company;

        return $this;
    }

    /**
     * Gets street_1
     *
     * @return string|null
     */
    public function getStreet1()
    {
        return $this->container['street_1'];
    }

    /**
     * Sets street_1
     *
     * @param string|null $street_1 Street address (first line).
     *
     * @return self
     */
    public function setStreet1($street_1)
    {
        if (is_null($street_1)) {
            throw new \InvalidArgumentException('non-nullable street_1 cannot be null');
        }
        $this->container['street_1'] = $street_1;

        return $this;
    }

    /**
     * Gets street_2
     *
     * @return string|null
     */
    public function getStreet2()
    {
        return $this->container['street_2'];
    }

    /**
     * Sets street_2
     *
     * @param string|null $street_2 Street address (second line).
     *
     * @return self
     */
    public function setStreet2($street_2)
    {
        if (is_null($street_2)) {
            throw new \InvalidArgumentException('non-nullable street_2 cannot be null');
        }
        $this->container['street_2'] = $street_2;

        return $this;
    }

    /**
     * Gets city
     *
     * @return string|null
     */
    public function getCity()
    {
        return $this->container['city'];
    }

    /**
     * Sets city
     *
     * @param string|null $city city
     *
     * @return self
     */
    public function setCity($city)
    {
        if (is_null($city)) {
            throw new \InvalidArgumentException('non-nullable city cannot be null');
        }
        $this->container['city'] = $city;

        return $this;
    }

    /**
     * Gets state
     *
     * @return string|null
     */
    public function getState()
    {
        return $this->container['state'];
    }

    /**
     * Sets state
     *
     * @param string|null $state state
     *
     * @return self
     */
    public function setState($state)
    {
        if (is_null($state)) {
            throw new \InvalidArgumentException('non-nullable state cannot be null');
        }
        $this->container['state'] = $state;

        return $this;
    }

    /**
     * Gets zip
     *
     * @return string|null
     */
    public function getZip()
    {
        return $this->container['zip'];
    }

    /**
     * Sets zip
     *
     * @param string|null $zip Zip or postal code, as a string.
     *
     * @return self
     */
    public function setZip($zip)
    {
        if (is_null($zip)) {
            throw new \InvalidArgumentException('non-nullable zip cannot be null');
        }
        $this->container['zip'] = $zip;

        return $this;
    }

    /**
     * Gets country
     *
     * @return string|null
     */
    public function getCountry()
    {
        return $this->container['country'];
    }

    /**
     * Sets country
     *
     * @param string|null $country country
     *
     * @return self
     */
    public function setCountry($country)
    {
        if (is_null($country)) {
            throw new \InvalidArgumentException('non-nullable country cannot be null');
        }
        $this->container['country'] = $country;

        return $this;
    }

    /**
     * Gets country_iso2
     *
     * @return string|null
     */
    public function getCountryIso2()
    {
        return $this->container['country_iso2'];
    }

    /**
     * Sets country_iso2
     *
     * @param string|null $country_iso2 2-letter ISO Alpha-2 code for the country.
     *
     * @return self
     */
    public function setCountryIso2($country_iso2)
    {
        if (is_null($country_iso2)) {
            throw new \InvalidArgumentException('non-nullable country_iso2 cannot be null');
        }
        $this->container['country_iso2'] = $country_iso2;

        return $this;
    }

    /**
     * Gets phone
     *
     * @return string|null
     */
    public function getPhone()
    {
        return $this->container['phone'];
    }

    /**
     * Sets phone
     *
     * @param string|null $phone Recipient's telephone number.
     *
     * @return self
     */
    public function setPhone($phone)
    {
        if (is_null($phone)) {
            throw new \InvalidArgumentException('non-nullable phone cannot be null');
        }
        $this->container['phone'] = $phone;

        return $this;
    }

    /**
     * Gets email
     *
     * @return string|null
     */
    public function getEmail()
    {
        return $this->container['email'];
    }

    /**
     * Sets email
     *
     * @param string|null $email Recipient's email address.
     *
     * @return self
     */
    public function setEmail($email)
    {
        if (is_null($email)) {
            throw new \InvalidArgumentException('non-nullable email cannot be null');
        }
        $this->container['email'] = $email;

        return $this;
    }

    /**
     * Gets shipping_method
     *
     * @return string|null
     */
    public function getShippingMethod()
    {
        return $this->container['shipping_method'];
    }

    /**
     * Sets shipping_method
     *
     * @param string|null $shipping_method Text code identifying the BigCommerce shipping module selected by the customer.
     *
     * @return self
     */
    public function setShippingMethod($shipping_method)
    {
        if (is_null($shipping_method)) {
            throw new \InvalidArgumentException('non-nullable shipping_method cannot be null');
        }
        $this->container['shipping_method'] = $shipping_method;

        return $this;
    }

    /**
     * Gets id
     *
     * @return int|null
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int|null $id ID of this shipping address.
     *
     * @return self
     */
    public function setId($id)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets order_id
     *
     * @return int|null
     */
    public function getOrderId()
    {
        return $this->container['order_id'];
    }

    /**
     * Sets order_id
     *
     * @param int|null $order_id ID of the order.
     *
     * @return self
     */
    public function setOrderId($order_id)
    {
        if (is_null($order_id)) {
            throw new \InvalidArgumentException('non-nullable order_id cannot be null');
        }
        $this->container['order_id'] = $order_id;

        return $this;
    }

    /**
     * Gets items_total
     *
     * @return float|null
     */
    public function getItemsTotal()
    {
        return $this->container['items_total'];
    }

    /**
     * Sets items_total
     *
     * @param float|null $items_total The total number of items in the order.
     *
     * @return self
     */
    public function setItemsTotal($items_total)
    {
        if (is_null($items_total)) {
            throw new \InvalidArgumentException('non-nullable items_total cannot be null');
        }
        $this->container['items_total'] = $items_total;

        return $this;
    }

    /**
     * Gets items_shipped
     *
     * @return float|null
     */
    public function getItemsShipped()
    {
        return $this->container['items_shipped'];
    }

    /**
     * Sets items_shipped
     *
     * @param float|null $items_shipped The number of items that have been shipped.
     *
     * @return self
     */
    public function setItemsShipped($items_shipped)
    {
        if (is_null($items_shipped)) {
            throw new \InvalidArgumentException('non-nullable items_shipped cannot be null');
        }
        $this->container['items_shipped'] = $items_shipped;

        return $this;
    }

    /**
     * Gets base_cost
     *
     * @return string|null
     */
    public function getBaseCost()
    {
        return $this->container['base_cost'];
    }

    /**
     * Sets base_cost
     *
     * @param string|null $base_cost The base value of the order’s items. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setBaseCost($base_cost)
    {
        if (is_null($base_cost)) {
            throw new \InvalidArgumentException('non-nullable base_cost cannot be null');
        }
        $this->container['base_cost'] = $base_cost;

        return $this;
    }

    /**
     * Gets cost_ex_tax
     *
     * @return string|null
     */
    public function getCostExTax()
    {
        return $this->container['cost_ex_tax'];
    }

    /**
     * Sets cost_ex_tax
     *
     * @param string|null $cost_ex_tax The value of the order’s items, excluding tax. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setCostExTax($cost_ex_tax)
    {
        if (is_null($cost_ex_tax)) {
            throw new \InvalidArgumentException('non-nullable cost_ex_tax cannot be null');
        }
        $this->container['cost_ex_tax'] = $cost_ex_tax;

        return $this;
    }

    /**
     * Gets cost_inc_tax
     *
     * @return string|null
     */
    public function getCostIncTax()
    {
        return $this->container['cost_inc_tax'];
    }

    /**
     * Sets cost_inc_tax
     *
     * @param string|null $cost_inc_tax The value of the order’s items, including tax. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setCostIncTax($cost_inc_tax)
    {
        if (is_null($cost_inc_tax)) {
            throw new \InvalidArgumentException('non-nullable cost_inc_tax cannot be null');
        }
        $this->container['cost_inc_tax'] = $cost_inc_tax;

        return $this;
    }

    /**
     * Gets cost_tax
     *
     * @return string|null
     */
    public function getCostTax()
    {
        return $this->container['cost_tax'];
    }

    /**
     * Sets cost_tax
     *
     * @param string|null $cost_tax The tax amount on the order. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setCostTax($cost_tax)
    {
        if (is_null($cost_tax)) {
            throw new \InvalidArgumentException('non-nullable cost_tax cannot be null');
        }
        $this->container['cost_tax'] = $cost_tax;

        return $this;
    }

    /**
     * Gets cost_tax_class_id
     *
     * @return int|null
     */
    public function getCostTaxClassId()
    {
        return $this->container['cost_tax_class_id'];
    }

    /**
     * Sets cost_tax_class_id
     *
     * @param int|null $cost_tax_class_id The ID of the tax class applied to the product. (NOTE: Value ignored if automatic tax is enabled.)
     *
     * @return self
     */
    public function setCostTaxClassId($cost_tax_class_id)
    {
        if (is_null($cost_tax_class_id)) {
            throw new \InvalidArgumentException('non-nullable cost_tax_class_id cannot be null');
        }
        $this->container['cost_tax_class_id'] = $cost_tax_class_id;

        return $this;
    }

    /**
     * Gets base_handling_cost
     *
     * @return string|null
     */
    public function getBaseHandlingCost()
    {
        return $this->container['base_handling_cost'];
    }

    /**
     * Sets base_handling_cost
     *
     * @param string|null $base_handling_cost The base handling charge. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setBaseHandlingCost($base_handling_cost)
    {
        if (is_null($base_handling_cost)) {
            throw new \InvalidArgumentException('non-nullable base_handling_cost cannot be null');
        }
        $this->container['base_handling_cost'] = $base_handling_cost;

        return $this;
    }

    /**
     * Gets handling_cost_ex_tax
     *
     * @return string|null
     */
    public function getHandlingCostExTax()
    {
        return $this->container['handling_cost_ex_tax'];
    }

    /**
     * Sets handling_cost_ex_tax
     *
     * @param string|null $handling_cost_ex_tax The handling charge, excluding tax. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setHandlingCostExTax($handling_cost_ex_tax)
    {
        if (is_null($handling_cost_ex_tax)) {
            throw new \InvalidArgumentException('non-nullable handling_cost_ex_tax cannot be null');
        }
        $this->container['handling_cost_ex_tax'] = $handling_cost_ex_tax;

        return $this;
    }

    /**
     * Gets handling_cost_inc_tax
     *
     * @return string|null
     */
    public function getHandlingCostIncTax()
    {
        return $this->container['handling_cost_inc_tax'];
    }

    /**
     * Sets handling_cost_inc_tax
     *
     * @param string|null $handling_cost_inc_tax The handling charge, including tax. (Float, Float-As-String, Integer)
     *
     * @return self
     */
    public function setHandlingCostIncTax($handling_cost_inc_tax)
    {
        if (is_null($handling_cost_inc_tax)) {
            throw new \InvalidArgumentException('non-nullable handling_cost_inc_tax cannot be null');
        }
        $this->container['handling_cost_inc_tax'] = $handling_cost_inc_tax;

        return $this;
    }

    /**
     * Gets handling_cost_tax
     *
     * @return string|null
     */
    public function getHandlingCostTax()
    {
        return $this->container['handling_cost_tax'];
    }

    /**
     * Sets handling_cost_tax
     *
     * @param string|null $handling_cost_tax handling_cost_tax
     *
     * @return self
     */
    public function setHandlingCostTax($handling_cost_tax)
    {
        if (is_null($handling_cost_tax)) {
            throw new \InvalidArgumentException('non-nullable handling_cost_tax cannot be null');
        }
        $this->container['handling_cost_tax'] = $handling_cost_tax;

        return $this;
    }

    /**
     * Gets handling_cost_tax_class_id
     *
     * @return int|null
     */
    public function getHandlingCostTaxClassId()
    {
        return $this->container['handling_cost_tax_class_id'];
    }

    /**
     * Sets handling_cost_tax_class_id
     *
     * @param int|null $handling_cost_tax_class_id A read-only value. Do not attempt to set or modify this value in a POST or PUT operation. (NOTE: Value ignored if automatic tax is enabled on the store.)
     *
     * @return self
     */
    public function setHandlingCostTaxClassId($handling_cost_tax_class_id)
    {
        if (is_null($handling_cost_tax_class_id)) {
            throw new \InvalidArgumentException('non-nullable handling_cost_tax_class_id cannot be null');
        }
        $this->container['handling_cost_tax_class_id'] = $handling_cost_tax_class_id;

        return $this;
    }

    /**
     * Gets shipping_zone_id
     *
     * @return float|null
     */
    public function getShippingZoneId()
    {
        return $this->container['shipping_zone_id'];
    }

    /**
     * Sets shipping_zone_id
     *
     * @param float|null $shipping_zone_id Numeric ID of the shipping zone.
     *
     * @return self
     */
    public function setShippingZoneId($shipping_zone_id)
    {
        if (is_null($shipping_zone_id)) {
            throw new \InvalidArgumentException('non-nullable shipping_zone_id cannot be null');
        }
        $this->container['shipping_zone_id'] = $shipping_zone_id;

        return $this;
    }

    /**
     * Gets shipping_zone_name
     *
     * @return string|null
     */
    public function getShippingZoneName()
    {
        return $this->container['shipping_zone_name'];
    }

    /**
     * Sets shipping_zone_name
     *
     * @param string|null $shipping_zone_name Name of the shipping zone.
     *
     * @return self
     */
    public function setShippingZoneName($shipping_zone_name)
    {
        if (is_null($shipping_zone_name)) {
            throw new \InvalidArgumentException('non-nullable shipping_zone_name cannot be null');
        }
        $this->container['shipping_zone_name'] = $shipping_zone_name;

        return $this;
    }

    /**
     * Gets form_fields
     *
     * @return \Bigcommerce\OrdersV2\Model\FormFields[]|null
     */
    public function getFormFields()
    {
        return $this->container['form_fields'];
    }

    /**
     * Sets form_fields
     *
     * @param \Bigcommerce\OrdersV2\Model\FormFields[]|null $form_fields form_fields
     *
     * @return self
     */
    public function setFormFields($form_fields)
    {
        if (is_null($form_fields)) {
            throw new \InvalidArgumentException('non-nullable form_fields cannot be null');
        }
        $this->container['form_fields'] = $form_fields;

        return $this;
    }

    /**
     * Gets shipping_quotes
     *
     * @return \Bigcommerce\OrdersV2\Model\ShippingQuotesResource|null
     */
    public function getShippingQuotes()
    {
        return $this->container['shipping_quotes'];
    }

    /**
     * Sets shipping_quotes
     *
     * @param \Bigcommerce\OrdersV2\Model\ShippingQuotesResource|null $shipping_quotes shipping_quotes
     *
     * @return self
     */
    public function setShippingQuotes($shipping_quotes)
    {
        if (is_null($shipping_quotes)) {
            throw new \InvalidArgumentException('non-nullable shipping_quotes cannot be null');
        }
        $this->container['shipping_quotes'] = $shipping_quotes;

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

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

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

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


