Skip to content

Commit

Permalink
Merge pull request #50 from apideck-libraries/generator-update
Browse files Browse the repository at this point in the history
Automated update by SDK Generator
  • Loading branch information
thim81 authored Dec 11, 2023
2 parents 8660f12 + 7342c12 commit 52ac517
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- main

permissions:
id-token: write # This is required for requesting the JWT
id-token: write
contents: write

jobs:
release:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- main

permissions:
id-token: write # This is required for requesting the JWT
id-token: write
contents: write

jobs:
sync-branch:
name: Update generator-update branch
Expand Down
19 changes: 17 additions & 2 deletions src/gen/docs/models/Employee.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Name | Type | Description | Notes
`company_name` | **string** | The name of the company. | [optional]
`employment_start_date` | **string** | A Start Date is the date that the employee started working at the company | [optional]
`employment_end_date` | **string** | An End Date is the date that the employee ended working at the company | [optional]
`leaving_reason` | [**OneOfStringNull**](OneOfStringNull.md) | | [optional]
`leaving_reason` | **string** | The reason because the employment ended. | [optional]
`employee_number` | **string** | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | [optional]
`employment_status` | [**\Apideck\Client\Model\EmploymentStatus**](EmploymentStatus.md) | | [optional]
`employment_role` | [**\Apideck\Client\Model\EmployeeEmploymentRole**](EmployeeEmploymentRole.md) | | [optional]
Expand Down Expand Up @@ -75,6 +75,21 @@ Name | Type | Description | Notes



<a name="LEAVING_REASON"></a>
## Enum: Employee.leaving_reason


* `DISMISSED` (value: `'dismissed'`)

* `RESIGNED` (value: `'resigned'`)

* `REDUNDANCY` (value: `'redundancy'`)

* `OTHER` (value: `'other'`)




## Referenced Types:


Expand All @@ -97,7 +112,7 @@ Name | Type | Description | Notes



* [`OneOfStringNull`](OneOfStringNull.md)


* [`EmploymentStatus`](EmploymentStatus.md)
* [`EmployeeEmploymentRole`](EmployeeEmploymentRole.md)
Expand Down
44 changes: 41 additions & 3 deletions src/gen/lib/Model/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Employee implements ModelInterface, ArrayAccess, \JsonSerializable
'company_name' => 'string',
'employment_start_date' => 'string',
'employment_end_date' => 'string',
'leaving_reason' => 'OneOfStringNull',
'leaving_reason' => 'string',
'employee_number' => 'string',
'employment_status' => '\Apideck\Client\Model\EmploymentStatus',
'employment_role' => '\Apideck\Client\Model\EmployeeEmploymentRole',
Expand Down Expand Up @@ -482,6 +482,25 @@ public function getModelName()
return self::$openAPIModelName;
}

const LEAVING_REASON_DISMISSED = 'dismissed';
const LEAVING_REASON_RESIGNED = 'resigned';
const LEAVING_REASON_REDUNDANCY = 'redundancy';
const LEAVING_REASON_OTHER = 'other';

/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getLeavingReasonAllowableValues()
{
return [
self::LEAVING_REASON_DISMISSED,
self::LEAVING_REASON_RESIGNED,
self::LEAVING_REASON_REDUNDANCY,
self::LEAVING_REASON_OTHER,
];
}

/**
* Associative array for storing property values
Expand Down Expand Up @@ -577,6 +596,15 @@ public function listInvalidProperties()
if ($this->container['id'] === null) {
$invalidProperties[] = "'id' can't be null";
}
$allowedValues = $this->getLeavingReasonAllowableValues();
if (!is_null($this->container['leaving_reason']) && !in_array($this->container['leaving_reason'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value '%s' for 'leaving_reason', must be one of '%s'",
$this->container['leaving_reason'],
implode("', '", $allowedValues)
);
}

if (!is_null($this->container['country_of_birth']) && (mb_strlen($this->container['country_of_birth']) > 2)) {
$invalidProperties[] = "invalid value for 'country_of_birth', the character length must be smaller than or equal to 2.";
}
Expand Down Expand Up @@ -1109,7 +1137,7 @@ public function setEmploymentEndDate($employment_end_date)
/**
* Gets leaving_reason
*
* @return OneOfStringNull|null
* @return string|null
*/
public function getLeavingReason()
{
Expand All @@ -1119,12 +1147,22 @@ public function getLeavingReason()
/**
* Sets leaving_reason
*
* @param OneOfStringNull|null $leaving_reason leaving_reason
* @param string|null $leaving_reason The reason because the employment ended.
*
* @return self
*/
public function setLeavingReason($leaving_reason)
{
$allowedValues = $this->getLeavingReasonAllowableValues();
if (!is_null($leaving_reason) && !in_array($leaving_reason, $allowedValues, true)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value '%s' for 'leaving_reason', must be one of '%s'",
$leaving_reason,
implode("', '", $allowedValues)
)
);
}
$this->container['leaving_reason'] = $leaving_reason;

return $this;
Expand Down

0 comments on commit 52ac517

Please sign in to comment.