Skip to content

Commit

Permalink
Merge pull request #40 from jolicode/fix/re-add-is_admin-and-is_proje…
Browse files Browse the repository at this point in the history
…ct_manager

force re-add the is_admin and is_project_manager properties
  • Loading branch information
xavierlacot authored Aug 8, 2022
2 parents 25fceac + 813bd4e commit e5cf68e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Resources/harvest-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,14 @@ components:
description: 'Date and time the user was last updated.'
nullable: true
format: date-time
is_admin:
type: boolean
description: 'Whether the user has Admin permissions.'
nullable: true
is_project_manager:
type: boolean
description: 'Whether the user has Project Manager permissions.'
nullable: true
ExpenseReportsResult:
type: object
externalDocs:
Expand Down
48 changes: 48 additions & 0 deletions generated/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ class User
* @var \DateTime|null
*/
protected $updatedAt;
/**
* Whether the user has Admin permissions.
*
* @var bool|null
*/
protected $isAdmin;
/**
* Whether the user has Project Manager permissions.
*
* @var bool|null
*/
protected $isProjectManager;

/**
* Unique ID for the user.
Expand Down Expand Up @@ -401,4 +413,40 @@ public function setUpdatedAt(?\DateTime $updatedAt): self

return $this;
}

/**
* Whether the user has Admin permissions.
*/
public function getIsAdmin(): ?bool
{
return $this->isAdmin;
}

/**
* Whether the user has Admin permissions.
*/
public function setIsAdmin(?bool $isAdmin): self
{
$this->isAdmin = $isAdmin;

return $this;
}

/**
* Whether the user has Project Manager permissions.
*/
public function getIsProjectManager(): ?bool
{
return $this->isProjectManager;
}

/**
* Whether the user has Project Manager permissions.
*/
public function setIsProjectManager(?bool $isProjectManager): self
{
$this->isProjectManager = $isProjectManager;

return $this;
}
}
16 changes: 16 additions & 0 deletions generated/Normalizer/UserNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ public function denormalize($data, $class, $format = null, array $context = [])
} elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) {
$object->setUpdatedAt(null);
}
if (\array_key_exists('is_admin', $data) && null !== $data['is_admin']) {
$object->setIsAdmin($data['is_admin']);
} elseif (\array_key_exists('is_admin', $data) && null === $data['is_admin']) {
$object->setIsAdmin(null);
}
if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) {
$object->setIsProjectManager($data['is_project_manager']);
} elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) {
$object->setIsProjectManager(null);
}

return $object;
}
Expand Down Expand Up @@ -204,6 +214,12 @@ public function normalize($object, $format = null, array $context = [])
if (null !== $object->getUpdatedAt()) {
$data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z');
}
if (null !== $object->getIsAdmin()) {
$data['is_admin'] = $object->getIsAdmin();
}
if (null !== $object->getIsProjectManager()) {
$data['is_project_manager'] = $object->getIsProjectManager();
}

return $data;
}
Expand Down

0 comments on commit e5cf68e

Please sign in to comment.