EasyPost\Object::__construct PHP Method

__construct() public method

constructor
public __construct ( string $id = null, string $apiKey = null, string $parent = null, string $name = null )
$id string
$apiKey string
$parent string
$name string
    public function __construct($id = null, $apiKey = null, $parent = null, $name = null)
    {
        $this->_apiKey = $apiKey;
        $this->_values = array();
        $this->_unsavedValues = array();
        $this->_immutableValues = array('_apiKey', 'id');
        $this->_parent = $parent;
        $this->_name = $name;
        $this->_retrieveOptions = array();
        if (is_array($id)) {
            foreach ($id as $key => $value) {
                if ($key != 'id') {
                    $this->_retrieveOptions[$key] = $value;
                }
            }
            $id = $id['id'];
        }
        if ($id) {
            $this->id = $id;
        }
    }