diff --git a/docs/v2/accounting/index.html b/docs/v2/accounting/index.html index 5295ef1e..5b4805ff 100644 --- a/docs/v2/accounting/index.html +++ b/docs/v2/accounting/index.html @@ -6343,7 +6343,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods createAccount diff --git a/docs/v2/appstore/index.html b/docs/v2/appstore/index.html index fcec62bb..6d725964 100644 --- a/docs/v2/appstore/index.html +++ b/docs/v2/appstore/index.html @@ -1240,7 +1240,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods getSubscription diff --git a/docs/v2/assets/index.html b/docs/v2/assets/index.html index 7f00fd71..d2949999 100644 --- a/docs/v2/assets/index.html +++ b/docs/v2/assets/index.html @@ -1418,7 +1418,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods createAsset diff --git a/docs/v2/files/index.html b/docs/v2/files/index.html index 933a0f9e..b39d9c9f 100644 --- a/docs/v2/files/index.html +++ b/docs/v2/files/index.html @@ -1169,7 +1169,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods createFileAssociation diff --git a/docs/v2/finance/index.html b/docs/v2/finance/index.html index b61a2434..f482aedf 100644 --- a/docs/v2/finance/index.html +++ b/docs/v2/finance/index.html @@ -2715,7 +2715,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods getAccountingActivityAccountUsage diff --git a/docs/v2/payroll_au/index.html b/docs/v2/payroll_au/index.html index 6047d2d3..9697bf06 100644 --- a/docs/v2/payroll_au/index.html +++ b/docs/v2/payroll_au/index.html @@ -3411,7 +3411,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods approveLeaveApplication diff --git a/docs/v2/payroll_nz/index.html b/docs/v2/payroll_nz/index.html index 6705f673..2bfc8936 100644 --- a/docs/v2/payroll_nz/index.html +++ b/docs/v2/payroll_nz/index.html @@ -4086,7 +4086,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods approveTimesheet diff --git a/docs/v2/payroll_uk/index.html b/docs/v2/payroll_uk/index.html index a4d8b85c..ca3b1229 100644 --- a/docs/v2/payroll_uk/index.html +++ b/docs/v2/payroll_uk/index.html @@ -1091,6 +1091,53 @@ } }, "description" : "" +}; + defs["ContractType"] = { + "title" : "", + "type" : "string", + "description" : "The contract type of the employee.", + "example" : "FullTime", + "enum" : [ "FullTime", "PartTime", "ZeroHour", "Unspecified" ] +}; + defs["Contracts"] = { + "title" : "", + "required" : [ "contractType", "employmentStatus", "startDate" ], + "type" : "object", + "properties" : { + "startDate" : { + "type" : "string", + "description" : "The contract start date of the employee. This will be locked once an employee has been paid and cannot be changed (YYYY-MM-DD)", + "format" : "date", + "example" : "2024-12-02", + "x-is-date" : true + }, + "employmentStatus" : { + "$ref" : "#/components/schemas/EmploymentStatus" + }, + "contractType" : { + "$ref" : "#/components/schemas/ContractType" + }, + "publicKey" : { + "type" : "string", + "description" : "The public key of the contract. Public key is required if the intention is to edit an existing contract. If no key is supplied a new contract will be created", + "format" : "uuid" + }, + "isFixedTerm" : { + "type" : "boolean", + "description" : "describes whether the contract is fixed term (required if trying to create Fixed term contract)" + }, + "fixedTermEndDate" : { + "type" : "string", + "description" : "The fixed term end date of the employee. Not required if isFixedTerm is false or not provided (required if trying to create Fixed term contract)", + "format" : "date", + "example" : "2025-11-01", + "x-is-date" : true + }, + "developmentalRoleDetails" : { + "$ref" : "#/components/schemas/DevelopmentalRoleDetails" + } + }, + "description" : "" }; defs["CourtOrderLine"] = { "title" : "", @@ -1249,6 +1296,38 @@ } }, "description" : "" +}; + defs["DevelopmentalRoleDetails"] = { + "title" : "", + "required" : [ "developmentalRole", "endDate", "startDate" ], + "type" : "object", + "properties" : { + "startDate" : { + "type" : "string", + "description" : "The start date of the developmental role", + "format" : "date", + "example" : "2024-12-02", + "x-is-date" : true + }, + "endDate" : { + "type" : "string", + "description" : "The end date of the developmental role", + "format" : "date", + "example" : "2024-12-02", + "x-is-date" : true + }, + "developmentalRole" : { + "type" : "string", + "description" : "The developmental role type - \"Apprentice\" is the only supported role currently", + "example" : "Apprentice" + }, + "publicKey" : { + "type" : "string", + "description" : "The public key of the developmental role. Public key is required if the intention is to edit an existing developmental role. If no key is supplied a new developmental role will be created", + "format" : "uuid" + } + }, + "description" : "" }; defs["EarningsLine"] = { "title" : "", @@ -1613,6 +1692,13 @@ "isOffPayrollWorker" : { "type" : "boolean", "description" : "Whether the employee is an off payroll worker" + }, + "contracts" : { + "type" : "array", + "description" : "The employee's contracts", + "items" : { + "$ref" : "#/components/schemas/Contracts" + } } }, "description" : "" @@ -2300,6 +2386,13 @@ "items" : { "$ref" : "#/components/schemas/NICategory" } + }, + "contracts" : { + "type" : "array", + "description" : "The employee's contracts", + "items" : { + "$ref" : "#/components/schemas/Contracts" + } } }, "description" : "" @@ -2319,6 +2412,13 @@ } }, "description" : "" +}; + defs["EmploymentStatus"] = { + "title" : "", + "type" : "string", + "description" : "The employment status of the employee.", + "example" : "Employee", + "enum" : [ "Employee", "Worker", "Unspecified" ] }; defs["InvalidField"] = { "title" : "", @@ -3599,7 +3699,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods approveTimesheet diff --git a/docs/v2/projects/index.html b/docs/v2/projects/index.html index 3cb640b6..766c4bce 100644 --- a/docs/v2/projects/index.html +++ b/docs/v2/projects/index.html @@ -1461,7 +1461,7 @@ SDK: - VSN: 10.2.0 + VSN: 10.3.0 Methods createProject diff --git a/lib/Api/AccountingApi.php b/lib/Api/AccountingApi.php index d89ab5f7..d9c1182a 100644 --- a/lib/Api/AccountingApi.php +++ b/lib/Api/AccountingApi.php @@ -14,7 +14,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/AppStoreApi.php b/lib/Api/AppStoreApi.php index 7f4047b6..53ad5681 100644 --- a/lib/Api/AppStoreApi.php +++ b/lib/Api/AppStoreApi.php @@ -14,7 +14,7 @@ * * These endpoints are for Xero Partners to interact with the App Store Billing platform * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/AssetApi.php b/lib/Api/AssetApi.php index 2edc7adc..0e1c1b18 100644 --- a/lib/Api/AssetApi.php +++ b/lib/Api/AssetApi.php @@ -14,7 +14,7 @@ * * The Assets API exposes fixed asset related functions of the Xero Accounting application and can be used for a variety of purposes such as creating assets, retrieving asset valuations etc. * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/FilesApi.php b/lib/Api/FilesApi.php index 38cc96c3..255768ba 100644 --- a/lib/Api/FilesApi.php +++ b/lib/Api/FilesApi.php @@ -14,7 +14,7 @@ * * These endpoints are specific to Xero Files API * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/FinanceApi.php b/lib/Api/FinanceApi.php index 20428685..e1f8c61c 100644 --- a/lib/Api/FinanceApi.php +++ b/lib/Api/FinanceApi.php @@ -14,7 +14,7 @@ * * The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital. * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/IdentityApi.php b/lib/Api/IdentityApi.php index da015892..ba352d1d 100644 --- a/lib/Api/IdentityApi.php +++ b/lib/Api/IdentityApi.php @@ -14,7 +14,7 @@ * * These endpoints are related to managing authentication tokens and identity for Xero API * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/PayrollAuApi.php b/lib/Api/PayrollAuApi.php index 7b5e3f4b..be4ff437 100644 --- a/lib/Api/PayrollAuApi.php +++ b/lib/Api/PayrollAuApi.php @@ -14,7 +14,7 @@ * * This is the Xero Payroll API for orgs in Australia region. * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/PayrollNzApi.php b/lib/Api/PayrollNzApi.php index 72c0a66a..0a023af5 100644 --- a/lib/Api/PayrollNzApi.php +++ b/lib/Api/PayrollNzApi.php @@ -14,7 +14,7 @@ * * This is the Xero Payroll API for orgs in the NZ region. * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/PayrollUkApi.php b/lib/Api/PayrollUkApi.php index f7d513fc..57bb95bb 100644 --- a/lib/Api/PayrollUkApi.php +++ b/lib/Api/PayrollUkApi.php @@ -14,7 +14,7 @@ * * This is the Xero Payroll API for orgs in the UK region. * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Api/ProjectApi.php b/lib/Api/ProjectApi.php index 5725f4c8..cae77857 100644 --- a/lib/Api/ProjectApi.php +++ b/lib/Api/ProjectApi.php @@ -14,7 +14,7 @@ * * This is the Xero Projects API * - * OpenAPI spec version: 9.2.0 + * OpenAPI spec version: 9.3.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/Configuration.php b/lib/Configuration.php index 700d99a6..b7c51c68 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -157,7 +157,7 @@ class Configuration * * @var string */ - protected $userAgent = '[xero-php-oauth2 (10.2.0)]'; + protected $userAgent = '[xero-php-oauth2 (10.3.0)]'; /** * Debug switch (default set to false) @@ -696,8 +696,8 @@ public static function toDebugReport() $report = 'PHP SDK (XeroAPI\XeroPHP) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 9.2.0' . PHP_EOL; - $report .= ' SDK Package Version: 10.2.0' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 9.3.0' . PHP_EOL; + $report .= ' SDK Package Version: 10.3.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Models/PayrollUk/ContractType.php b/lib/Models/PayrollUk/ContractType.php new file mode 100644 index 00000000..3377aadd --- /dev/null +++ b/lib/Models/PayrollUk/ContractType.php @@ -0,0 +1,68 @@ + '\DateTime', + 'employment_status' => '\XeroAPI\XeroPHP\Models\PayrollUk\EmploymentStatus', + 'contract_type' => '\XeroAPI\XeroPHP\Models\PayrollUk\ContractType', + 'public_key' => 'string', + 'is_fixed_term' => 'bool', + 'fixed_term_end_date' => '\DateTime', + 'developmental_role_details' => '\XeroAPI\XeroPHP\Models\PayrollUk\DevelopmentalRoleDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'start_date' => 'date', + 'employment_status' => null, + 'contract_type' => null, + 'public_key' => 'uuid', + 'is_fixed_term' => null, + 'fixed_term_end_date' => 'date', + 'developmental_role_details' => 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 = [ + 'start_date' => 'startDate', + 'employment_status' => 'employmentStatus', + 'contract_type' => 'contractType', + 'public_key' => 'publicKey', + 'is_fixed_term' => 'isFixedTerm', + 'fixed_term_end_date' => 'fixedTermEndDate', + 'developmental_role_details' => 'developmentalRoleDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start_date' => 'setStartDate', + 'employment_status' => 'setEmploymentStatus', + 'contract_type' => 'setContractType', + 'public_key' => 'setPublicKey', + 'is_fixed_term' => 'setIsFixedTerm', + 'fixed_term_end_date' => 'setFixedTermEndDate', + 'developmental_role_details' => 'setDevelopmentalRoleDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start_date' => 'getStartDate', + 'employment_status' => 'getEmploymentStatus', + 'contract_type' => 'getContractType', + 'public_key' => 'getPublicKey', + 'is_fixed_term' => 'getIsFixedTerm', + 'fixed_term_end_date' => 'getFixedTermEndDate', + 'developmental_role_details' => 'getDevelopmentalRoleDetails' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start_date'] = isset($data['start_date']) ? $data['start_date'] : null; + $this->container['employment_status'] = isset($data['employment_status']) ? $data['employment_status'] : null; + $this->container['contract_type'] = isset($data['contract_type']) ? $data['contract_type'] : null; + $this->container['public_key'] = isset($data['public_key']) ? $data['public_key'] : null; + $this->container['is_fixed_term'] = isset($data['is_fixed_term']) ? $data['is_fixed_term'] : null; + $this->container['fixed_term_end_date'] = isset($data['fixed_term_end_date']) ? $data['fixed_term_end_date'] : null; + $this->container['developmental_role_details'] = isset($data['developmental_role_details']) ? $data['developmental_role_details'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['start_date'] === null) { + $invalidProperties[] = "'start_date' can't be null"; + } + if ($this->container['employment_status'] === null) { + $invalidProperties[] = "'employment_status' can't be null"; + } + if ($this->container['contract_type'] === null) { + $invalidProperties[] = "'contract_type' can't be null"; + } + 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 start_date + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime $start_date The contract start date of the employee. This will be locked once an employee has been paid and cannot be changed (YYYY-MM-DD) + * + * @return $this + */ + public function setStartDate($start_date) + { + + $this->container['start_date'] = $start_date; + + return $this; + } + + + + /** + * Gets employment_status + * + * @return \XeroAPI\XeroPHP\Models\PayrollUk\EmploymentStatus + */ + public function getEmploymentStatus() + { + return $this->container['employment_status']; + } + + /** + * Sets employment_status + * + * @param \XeroAPI\XeroPHP\Models\PayrollUk\EmploymentStatus $employment_status employment_status + * + * @return $this + */ + public function setEmploymentStatus($employment_status) + { + + $this->container['employment_status'] = $employment_status; + + return $this; + } + + + + /** + * Gets contract_type + * + * @return \XeroAPI\XeroPHP\Models\PayrollUk\ContractType + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param \XeroAPI\XeroPHP\Models\PayrollUk\ContractType $contract_type contract_type + * + * @return $this + */ + public function setContractType($contract_type) + { + + $this->container['contract_type'] = $contract_type; + + return $this; + } + + + + /** + * Gets public_key + * + * @return string|null + */ + public function getPublicKey() + { + return $this->container['public_key']; + } + + /** + * Sets public_key + * + * @param string|null $public_key The public key of the contract. Public key is required if the intention is to edit an existing contract. If no key is supplied a new contract will be created + * + * @return $this + */ + public function setPublicKey($public_key) + { + + $this->container['public_key'] = $public_key; + + return $this; + } + + + + /** + * Gets is_fixed_term + * + * @return bool|null + */ + public function getIsFixedTerm() + { + return $this->container['is_fixed_term']; + } + + /** + * Sets is_fixed_term + * + * @param bool|null $is_fixed_term describes whether the contract is fixed term (required if trying to create Fixed term contract) + * + * @return $this + */ + public function setIsFixedTerm($is_fixed_term) + { + + $this->container['is_fixed_term'] = $is_fixed_term; + + return $this; + } + + + + /** + * Gets fixed_term_end_date + * + * @return \DateTime|null + */ + public function getFixedTermEndDate() + { + return $this->container['fixed_term_end_date']; + } + + /** + * Sets fixed_term_end_date + * + * @param \DateTime|null $fixed_term_end_date The fixed term end date of the employee. Not required if isFixedTerm is false or not provided (required if trying to create Fixed term contract) + * + * @return $this + */ + public function setFixedTermEndDate($fixed_term_end_date) + { + + $this->container['fixed_term_end_date'] = $fixed_term_end_date; + + return $this; + } + + + + /** + * Gets developmental_role_details + * + * @return \XeroAPI\XeroPHP\Models\PayrollUk\DevelopmentalRoleDetails|null + */ + public function getDevelopmentalRoleDetails() + { + return $this->container['developmental_role_details']; + } + + /** + * Sets developmental_role_details + * + * @param \XeroAPI\XeroPHP\Models\PayrollUk\DevelopmentalRoleDetails|null $developmental_role_details developmental_role_details + * + * @return $this + */ + public function setDevelopmentalRoleDetails($developmental_role_details) + { + + $this->container['developmental_role_details'] = $developmental_role_details; + + 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() + { + return json_encode( + PayrollUkObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/PayrollUk/DevelopmentalRoleDetails.php b/lib/Models/PayrollUk/DevelopmentalRoleDetails.php new file mode 100644 index 00000000..c464c1e8 --- /dev/null +++ b/lib/Models/PayrollUk/DevelopmentalRoleDetails.php @@ -0,0 +1,413 @@ + '\DateTime', + 'end_date' => '\DateTime', + 'developmental_role' => 'string', + 'public_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'start_date' => 'date', + 'end_date' => 'date', + 'developmental_role' => null, + 'public_key' => 'uuid' + ]; + + /** + * 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 = [ + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'developmental_role' => 'developmentalRole', + 'public_key' => 'publicKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'developmental_role' => 'setDevelopmentalRole', + 'public_key' => 'setPublicKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'developmental_role' => 'getDevelopmentalRole', + 'public_key' => 'getPublicKey' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start_date'] = isset($data['start_date']) ? $data['start_date'] : null; + $this->container['end_date'] = isset($data['end_date']) ? $data['end_date'] : null; + $this->container['developmental_role'] = isset($data['developmental_role']) ? $data['developmental_role'] : null; + $this->container['public_key'] = isset($data['public_key']) ? $data['public_key'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['start_date'] === null) { + $invalidProperties[] = "'start_date' can't be null"; + } + if ($this->container['end_date'] === null) { + $invalidProperties[] = "'end_date' can't be null"; + } + if ($this->container['developmental_role'] === null) { + $invalidProperties[] = "'developmental_role' can't be null"; + } + 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 start_date + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime $start_date The start date of the developmental role + * + * @return $this + */ + public function setStartDate($start_date) + { + + $this->container['start_date'] = $start_date; + + return $this; + } + + + + /** + * Gets end_date + * + * @return \DateTime + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime $end_date The end date of the developmental role + * + * @return $this + */ + public function setEndDate($end_date) + { + + $this->container['end_date'] = $end_date; + + return $this; + } + + + + /** + * Gets developmental_role + * + * @return string + */ + public function getDevelopmentalRole() + { + return $this->container['developmental_role']; + } + + /** + * Sets developmental_role + * + * @param string $developmental_role The developmental role type - \"Apprentice\" is the only supported role currently + * + * @return $this + */ + public function setDevelopmentalRole($developmental_role) + { + + $this->container['developmental_role'] = $developmental_role; + + return $this; + } + + + + /** + * Gets public_key + * + * @return string|null + */ + public function getPublicKey() + { + return $this->container['public_key']; + } + + /** + * Sets public_key + * + * @param string|null $public_key The public key of the developmental role. Public key is required if the intention is to edit an existing developmental role. If no key is supplied a new developmental role will be created + * + * @return $this + */ + public function setPublicKey($public_key) + { + + $this->container['public_key'] = $public_key; + + 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() + { + return json_encode( + PayrollUkObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/PayrollUk/Employee.php b/lib/Models/PayrollUk/Employee.php index 19a5ae83..4936dd3a 100644 --- a/lib/Models/PayrollUk/Employee.php +++ b/lib/Models/PayrollUk/Employee.php @@ -75,7 +75,8 @@ class Employee implements ModelInterface, ArrayAccess 'ni_category' => '\XeroAPI\XeroPHP\Models\PayrollUk\NICategoryLetter', 'ni_categories' => '\XeroAPI\XeroPHP\Models\PayrollUk\NICategory[]', 'national_insurance_number' => 'string', - 'is_off_payroll_worker' => 'bool' + 'is_off_payroll_worker' => 'bool', + 'contracts' => '\XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]' ]; /** @@ -101,7 +102,8 @@ class Employee implements ModelInterface, ArrayAccess 'ni_category' => null, 'ni_categories' => null, 'national_insurance_number' => null, - 'is_off_payroll_worker' => null + 'is_off_payroll_worker' => null, + 'contracts' => null ]; /** @@ -148,7 +150,8 @@ public static function openAPIFormats() 'ni_category' => 'niCategory', 'ni_categories' => 'niCategories', 'national_insurance_number' => 'nationalInsuranceNumber', - 'is_off_payroll_worker' => 'isOffPayrollWorker' + 'is_off_payroll_worker' => 'isOffPayrollWorker', + 'contracts' => 'contracts' ]; /** @@ -174,7 +177,8 @@ public static function openAPIFormats() 'ni_category' => 'setNiCategory', 'ni_categories' => 'setNiCategories', 'national_insurance_number' => 'setNationalInsuranceNumber', - 'is_off_payroll_worker' => 'setIsOffPayrollWorker' + 'is_off_payroll_worker' => 'setIsOffPayrollWorker', + 'contracts' => 'setContracts' ]; /** @@ -200,7 +204,8 @@ public static function openAPIFormats() 'ni_category' => 'getNiCategory', 'ni_categories' => 'getNiCategories', 'national_insurance_number' => 'getNationalInsuranceNumber', - 'is_off_payroll_worker' => 'getIsOffPayrollWorker' + 'is_off_payroll_worker' => 'getIsOffPayrollWorker', + 'contracts' => 'getContracts' ]; /** @@ -296,6 +301,7 @@ public function __construct(array $data = null) $this->container['ni_categories'] = isset($data['ni_categories']) ? $data['ni_categories'] : null; $this->container['national_insurance_number'] = isset($data['national_insurance_number']) ? $data['national_insurance_number'] : null; $this->container['is_off_payroll_worker'] = isset($data['is_off_payroll_worker']) ? $data['is_off_payroll_worker'] : null; + $this->container['contracts'] = isset($data['contracts']) ? $data['contracts'] : null; } /** @@ -842,6 +848,33 @@ public function setIsOffPayrollWorker($is_off_payroll_worker) } + + /** + * Gets contracts + * + * @return \XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]|null + */ + public function getContracts() + { + return $this->container['contracts']; + } + + /** + * Sets contracts + * + * @param \XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]|null $contracts The employee's contracts + * + * @return $this + */ + public function setContracts($contracts) + { + + $this->container['contracts'] = $contracts; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Models/PayrollUk/Employment.php b/lib/Models/PayrollUk/Employment.php index 354b8e7d..13af8c49 100644 --- a/lib/Models/PayrollUk/Employment.php +++ b/lib/Models/PayrollUk/Employment.php @@ -62,7 +62,8 @@ class Employment implements ModelInterface, ArrayAccess 'start_date' => '\DateTime', 'employee_number' => 'string', 'ni_category' => '\XeroAPI\XeroPHP\Models\PayrollUk\NICategoryLetter', - 'ni_categories' => '\XeroAPI\XeroPHP\Models\PayrollUk\NICategory[]' + 'ni_categories' => '\XeroAPI\XeroPHP\Models\PayrollUk\NICategory[]', + 'contracts' => '\XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]' ]; /** @@ -75,7 +76,8 @@ class Employment implements ModelInterface, ArrayAccess 'start_date' => 'date', 'employee_number' => null, 'ni_category' => null, - 'ni_categories' => null + 'ni_categories' => null, + 'contracts' => null ]; /** @@ -109,7 +111,8 @@ public static function openAPIFormats() 'start_date' => 'startDate', 'employee_number' => 'employeeNumber', 'ni_category' => 'niCategory', - 'ni_categories' => 'niCategories' + 'ni_categories' => 'niCategories', + 'contracts' => 'contracts' ]; /** @@ -122,7 +125,8 @@ public static function openAPIFormats() 'start_date' => 'setStartDate', 'employee_number' => 'setEmployeeNumber', 'ni_category' => 'setNiCategory', - 'ni_categories' => 'setNiCategories' + 'ni_categories' => 'setNiCategories', + 'contracts' => 'setContracts' ]; /** @@ -135,7 +139,8 @@ public static function openAPIFormats() 'start_date' => 'getStartDate', 'employee_number' => 'getEmployeeNumber', 'ni_category' => 'getNiCategory', - 'ni_categories' => 'getNiCategories' + 'ni_categories' => 'getNiCategories', + 'contracts' => 'getContracts' ]; /** @@ -203,6 +208,7 @@ public function __construct(array $data = null) $this->container['employee_number'] = isset($data['employee_number']) ? $data['employee_number'] : null; $this->container['ni_category'] = isset($data['ni_category']) ? $data['ni_category'] : null; $this->container['ni_categories'] = isset($data['ni_categories']) ? $data['ni_categories'] : null; + $this->container['contracts'] = isset($data['contracts']) ? $data['contracts'] : null; } /** @@ -375,6 +381,33 @@ public function setNiCategories($ni_categories) } + + /** + * Gets contracts + * + * @return \XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]|null + */ + public function getContracts() + { + return $this->container['contracts']; + } + + /** + * Sets contracts + * + * @param \XeroAPI\XeroPHP\Models\PayrollUk\Contracts[]|null $contracts The employee's contracts + * + * @return $this + */ + public function setContracts($contracts) + { + + $this->container['contracts'] = $contracts; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Models/PayrollUk/EmploymentStatus.php b/lib/Models/PayrollUk/EmploymentStatus.php new file mode 100644 index 00000000..f687e13b --- /dev/null +++ b/lib/Models/PayrollUk/EmploymentStatus.php @@ -0,0 +1,66 @@ +