Skip to content

Commit

Permalink
feat(lib): generate code from braze-specification
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and github-actions[bot] committed Aug 21, 2023
1 parent 2c9b6f2 commit 482c7ad
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions lib/Model/CampaignsTriggerScheduleUpdatePostBodySchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ public function isInitialized($property): bool
return array_key_exists($property, $this->initialized);
}
/**
* @var string
* @var \DateTime
*/
protected $time;
/**
* @var bool
*/
protected $inLocalTime;

public function getTime(): string
public function getTime(): \DateTime
{
return $this->time;
}

public function setTime(string $time): self
public function setTime(\DateTime $time): self
{
$this->initialized['time'] = true;
$this->time = $time;
Expand Down
6 changes: 3 additions & 3 deletions lib/Model/CanvasTriggerScheduleUpdatePostBodySchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ public function isInitialized($property): bool
return array_key_exists($property, $this->initialized);
}
/**
* @var string
* @var \DateTime
*/
protected $time;
/**
* @var bool
*/
protected $inLocalTime;

public function getTime(): string
public function getTime(): \DateTime
{
return $this->time;
}

public function setTime(string $time): self
public function setTime(\DateTime $time): self
{
$this->initialized['time'] = true;
$this->time = $time;
Expand Down
12 changes: 6 additions & 6 deletions lib/Model/MessagesLiveActivityUpdatePostBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public function isInitialized($property): bool
*/
protected $endActivity;
/**
* @var string
* @var \DateTime
*/
protected $dismissalDate;
/**
* @var string
* @var \DateTime
*/
protected $staleDate;
/**
Expand Down Expand Up @@ -102,25 +102,25 @@ public function setEndActivity(bool $endActivity): self
return $this;
}

public function getDismissalDate(): string
public function getDismissalDate(): \DateTime
{
return $this->dismissalDate;
}

public function setDismissalDate(string $dismissalDate): self
public function setDismissalDate(\DateTime $dismissalDate): self
{
$this->initialized['dismissalDate'] = true;
$this->dismissalDate = $dismissalDate;

return $this;
}

public function getStaleDate(): string
public function getStaleDate(): \DateTime
{
return $this->staleDate;
}

public function setStaleDate(string $staleDate): self
public function setStaleDate(\DateTime $staleDate): self
{
$this->initialized['staleDate'] = true;
$this->staleDate = $staleDate;
Expand Down
6 changes: 3 additions & 3 deletions lib/Model/MessagesScheduleUpdatePostBodySchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public function isInitialized($property): bool
return array_key_exists($property, $this->initialized);
}
/**
* @var string
* @var \DateTime
*/
protected $time;

public function getTime(): string
public function getTime(): \DateTime
{
return $this->time;
}

public function setTime(string $time): self
public function setTime(\DateTime $time): self
{
$this->initialized['time'] = true;
$this->time = $time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
return $object;
}
if (\array_key_exists('time', $data)) {
$object->setTime($data['time']);
$object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time']));
unset($data['time']);
}
if (\array_key_exists('in_local_time', $data)) {
Expand All @@ -76,7 +76,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('time') && null !== $object->getTime()) {
$data['time'] = $object->getTime();
$data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP');
}
if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) {
$data['in_local_time'] = $object->getInLocalTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
return $object;
}
if (\array_key_exists('time', $data)) {
$object->setTime($data['time']);
$object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time']));
unset($data['time']);
}
if (\array_key_exists('in_local_time', $data)) {
Expand All @@ -76,7 +76,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('time') && null !== $object->getTime()) {
$data['time'] = $object->getTime();
$data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP');
}
if ($object->isInitialized('inLocalTime') && null !== $object->getInLocalTime()) {
$data['in_local_time'] = $object->getInLocalTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public function denormalize($data, $class, $format = null, array $context = [])
unset($data['end_activity']);
}
if (\array_key_exists('dismissal_date', $data)) {
$object->setDismissalDate($data['dismissal_date']);
$object->setDismissalDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['dismissal_date']));
unset($data['dismissal_date']);
}
if (\array_key_exists('stale_date', $data)) {
$object->setStaleDate($data['stale_date']);
$object->setStaleDate(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['stale_date']));
unset($data['stale_date']);
}
if (\array_key_exists('notification', $data)) {
Expand Down Expand Up @@ -108,10 +108,10 @@ public function normalize($object, $format = null, array $context = [])
$data['end_activity'] = $object->getEndActivity();
}
if ($object->isInitialized('dismissalDate') && null !== $object->getDismissalDate()) {
$data['dismissal_date'] = $object->getDismissalDate();
$data['dismissal_date'] = $object->getDismissalDate()->format('Y-m-d\\TH:i:sP');
}
if ($object->isInitialized('staleDate') && null !== $object->getStaleDate()) {
$data['stale_date'] = $object->getStaleDate();
$data['stale_date'] = $object->getStaleDate()->format('Y-m-d\\TH:i:sP');
}
if ($object->isInitialized('notification') && null !== $object->getNotification()) {
$data['notification'] = $this->normalizer->normalize($object->getNotification(), 'json', $context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
return $object;
}
if (\array_key_exists('time', $data)) {
$object->setTime($data['time']);
$object->setTime(\DateTime::createFromFormat('Y-m-d\\TH:i:sP', $data['time']));
unset($data['time']);
}
foreach ($data as $key => $value) {
Expand All @@ -72,7 +72,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('time') && null !== $object->getTime()) {
$data['time'] = $object->getTime();
$data['time'] = $object->getTime()->format('Y-m-d\\TH:i:sP');
}
foreach ($object as $key => $value) {
if (preg_match('/.*/', (string) $key)) {
Expand Down

0 comments on commit 482c7ad

Please sign in to comment.