Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmypuckett committed Dec 10, 2023
2 parents 5063f15 + 148747d commit 1776dea
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1
0.5.0
51 changes: 51 additions & 0 deletions src/Holiday.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Spinen\Halo;

use Carbon\Carbon;
use Spinen\Halo\Support\Model;

/**
* Class Holiday
*
* @property bool $allday
* @property bool $isrecurring
* @property Carbon $date
* @property Carbon $end_date
* @property float $duration
* @property int $agent_id
* @property int $entity
* @property int $holid
* @property int $holiday_type
* @property int $workday_id
* @property string $agent_name
* @property string $id
* @property string $name
*/
class Holiday extends Model
{
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'agent_id' => 'int',
'agent_name' => 'string',
'allday' => 'bool',
'date' => 'datetime',
'duration' => 'float',
'end_date' => 'datetime',
'entity' => 'int',
'holid' => 'int',
'holiday_type' => 'int',
'id' => 'string',
'isrecurring' => 'bool',
'workday_id' => 'int',
];

/**
* Is the model readonly?
*/
protected bool $readonlyModel = true;
}
59 changes: 59 additions & 0 deletions src/Sla.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Spinen\Halo;

use Spinen\Halo\Support\Model;

/**
* Class Sla
*
* @property array $access_control
* @property array $priorities
* @property bool $autoreleaseoption
* @property bool $dontsendholdreminders
* @property bool $hoursaretechslocaltime
* @property bool $response_reset_approval
* @property bool $responsereset
* @property bool $trackslafixbytime
* @property bool $trackslaresponsetime
* @property int $access_control_level
* @property int $autoreleaselimit
* @property int $id
* @property int $slstatusafterfirstwarning
* @property int $slstatusaftersecondwarning
* @property int $statusafterautorelease
* @property int $workday_id
* @property string $guid
* @property string $name
* @property string $statusafterautorelease_name
* @property string $workday_name
*/
class Sla extends Model
{
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'access_control_level' => 'int',
'autoreleaselimit' => 'int',
'autoreleaseoption' => 'bool',
'dontsendholdreminders' => 'bool',
'hoursaretechslocaltime' => 'bool',
'id' => 'int',
'response_reset_approval' => 'bool',
'responsereset' => 'bool',
'slstatusafterfirstwarning' => 'int',
'slstatusaftersecondwarning' => 'int',
'statusafterautorelease' => 'int',
'trackslafixbytime' => 'bool',
'trackslaresponsetime' => 'bool',
'workday_id' => 'int',
];

/**
* Path to API endpoint.
*/
protected string $path = '/sla';
}
12 changes: 12 additions & 0 deletions src/Support/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use Spinen\Halo\Quote;
use Spinen\Halo\Report;
use Spinen\Halo\Site;
use Spinen\Halo\Sla;
use Spinen\Halo\Status;
use Spinen\Halo\Supplier;
use Spinen\Halo\Team;
Expand All @@ -40,6 +41,7 @@
use Spinen\Halo\User;
use Spinen\Halo\Webhook;
use Spinen\Halo\WebhookEvent;
use Spinen\Halo\Workday;

/**
* Class Builder
Expand All @@ -63,6 +65,7 @@
* @property Collection $quotes
* @property Collection $reports
* @property Collection $sites
* @property Collection $slas
* @property Collection $statuses
* @property Collection $suppliers
* @property Collection $teams
Expand All @@ -71,7 +74,9 @@
* @property Collection $users
* @property Collection $webhook_events
* @property Collection $webhooks
* @property Collection $workdays
* @property User $user
* @property Client $client
*
* @method self actions()
* @method self agents()
Expand All @@ -93,6 +98,7 @@
* @method self reports()
* @method self search($for)
* @method self sites()
* @method self slas()
* @method self statuses()
* @method self suppliers()
* @method self teams()
Expand All @@ -101,6 +107,7 @@
* @method self users()
* @method self webhook_events()
* @method self webhooks()
* @method self workdays()
*/
class Builder
{
Expand Down Expand Up @@ -152,6 +159,7 @@ class Builder
'quotes' => Quote::class,
'reports' => Report::class,
'sites' => Site::class,
'slas' => Sla::class,
'statuses' => Status::class,
'suppliers' => Supplier::class,
'teams' => Team::class,
Expand All @@ -160,6 +168,7 @@ class Builder
'users' => User::class,
'webhook_events' => WebhookEvent::class,
'webhooks' => Webhook::class,
'workdays' => Workday::class,
];

/**
Expand Down Expand Up @@ -203,6 +212,9 @@ public function __get(string $name): Collection|Model|null
$name === 'agent' => $this->newInstanceForModel(Agent::class)
->get(extra: 'me')
->first(),
$name === 'client' => $this->newInstanceForModel(Client::class)
->get(extra: 'me')
->first(),
$name === 'user' => $this->newInstanceForModel(User::class)
->get(extra: 'me')
->first(),
Expand Down
85 changes: 85 additions & 0 deletions src/Workday.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php

namespace Spinen\Halo;

use Carbon\Carbon;
use Spinen\Halo\Support\Model;

/**
* Class Workday
*
* @property array $access_control
* @property array $holidays
* @property array $timeslots
* @property bool $alldayssame
* @property bool $incfriday
* @property bool $incmonday
* @property bool $incsaturday
* @property bool $incsunday
* @property bool $incthursday
* @property bool $inctuesday
* @property bool $incwednesday
* @property Carbon $end
* @property Carbon $endfriday
* @property Carbon $endmonday
* @property Carbon $endsaturday
* @property Carbon $endsunday
* @property Carbon $endthursday
* @property Carbon $endtuesday
* @property Carbon $endwednesday
* @property Carbon $start
* @property Carbon $startfriday
* @property Carbon $startmonday
* @property Carbon $startsaturday
* @property Carbon $startsunday
* @property Carbon $startthursday
* @property Carbon $starttuesday
* @property Carbon $startwednesday
* @property int $access_control_level
* @property int $id
* @property string $guid
* @property string $name
* @property string $summary
* @property string $timezone
*/
class Workday extends Model
{
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'access_control_level' => 'int',
'alldayssame' => 'bool',
'end' => 'datetime',
'endfriday' => 'datetime',
'endmonday' => 'datetime',
'endsaturday' => 'datetime',
'endsunday' => 'datetime',
'endthursday' => 'datetime',
'endtuesday' => 'datetime',
'endwednesday' => 'datetime',
'id' => 'int',
'incfriday' => 'bool',
'incmonday' => 'bool',
'incsaturday' => 'bool',
'incsunday' => 'bool',
'incthursday' => 'bool',
'inctuesday' => 'bool',
'incwednesday' => 'bool',
'start' => 'datetime',
'startfriday' => 'datetime',
'startmonday' => 'datetime',
'startsaturday' => 'datetime',
'startsunday' => 'datetime',
'startthursday' => 'datetime',
'starttuesday' => 'datetime',
'startwednesday' => 'datetime',
];

/**
* Path to API endpoint.
*/
protected string $path = '/workday';
}

0 comments on commit 1776dea

Please sign in to comment.