/home/desid573/public_html/payment/xero-2/lib/Models/AppStore
Edit: /home/desid573/public_html/payment/xero-2/lib/Models/AppStore/Product.php (9186B)
'string',
'name' => 'string',
'type' => 'string',
'seat_unit' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPIFormats = [
'id' => 'uuid',
'name' => null,
'type' => null,
'seat_unit' => null
];
/**
* 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 attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'id' => 'id',
'name' => 'name',
'type' => 'type',
'seat_unit' => 'seatUnit'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'id' => 'setId',
'name' => 'setName',
'type' => 'setType',
'seat_unit' => 'setSeatUnit'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'id' => 'getId',
'name' => 'getName',
'type' => 'getType',
'seat_unit' => 'getSeatUnit'
];
/**
* 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;
}
const TYPE_FIXED = 'FIXED';
const TYPE_PER_SEAT = 'PER_SEAT';
/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getTypeAllowableValues()
{
return [
self::TYPE_FIXED,
self::TYPE_PER_SEAT,
];
}
/**
* 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['id'] = isset($data['id']) ? $data['id'] : null;
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
$this->container['seat_unit'] = isset($data['seat_unit']) ? $data['seat_unit'] : null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
$allowedValues = $this->getTypeAllowableValues();
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value for 'type', must be one of '%s'",
implode("', '", $allowedValues)
);
}
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 id
*
* @return string|null
*/
public function getId()
{
return $this->container['id'];
}
/**
* Sets id
*
* @param string|null $id The unique identifier for the product
*
* @return $this
*/
public function setId($id)
{
$this->container['id'] = $id;
return $this;
}
/**
* Gets name
*
* @return string|null
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string|null $name The name of the product
*
* @return $this
*/
public function setName($name)
{
$this->container['name'] = $name;
return $this;
}
/**
* Gets type
*
* @return string|null
*/
public function getType()
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type The pricing model of the product: * FIXED: Customers are charged a fixed amount for each billing period * PER_SEAT: Customers are charged based on the number of units they purchase
*
* @return $this
*/
public function setType($type)
{
$allowedValues = $this->getTypeAllowableValues();
if (!is_null($type) && !in_array($type, $allowedValues, true)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'type', must be one of '%s'",
implode("', '", $allowedValues)
)
);
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets seat_unit
*
* @return string|null
*/
public function getSeatUnit()
{
return $this->container['seat_unit'];
}
/**
* Sets seat_unit
*
* @param string|null $seat_unit The unit of the per seat product. e.g. \"user\", \"organisation\", \"SMS\", etc
*
* @return $this
*/
public function setSeatUnit($seat_unit)
{
$this->container['seat_unit'] = $seat_unit;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed
*/
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
*/
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
*/
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
return json_encode(
AppStoreObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
}