Skip to content

Commit

Permalink
Merge pull request #18 from stitch-digital/johntrickett86-add-missing…
Browse files Browse the repository at this point in the history
…-requests

missed requests from initial commit
  • Loading branch information
johntrickett86 authored Oct 11, 2024
2 parents 1487b8f + 92efc57 commit 62c1d1f
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 8 deletions.
27 changes: 27 additions & 0 deletions src/Requests/Setup/Accounts/CostCentres/RetrieveCostCentres.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace StitchDigital\LaravelSimproApi\Requests\Setup\Accounts\CostCentres;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveCostCentres extends Request
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $costCenterId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/accounts/costCenters/'.$this->costCenterId;
}
}
28 changes: 28 additions & 0 deletions src/Requests/Setup/AssetTypes/GetAssetTypeAttachments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypeAttachments extends Request implements Paginatable
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/attachments/files/';
}
}
28 changes: 28 additions & 0 deletions src/Requests/Setup/AssetTypes/GetAssetTypeCustomFields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypeCustomFields extends Request implements Paginatable
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/customFields/';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypeServiceLevelFailurePoints extends Request implements Paginatable
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeServiceLevelID, protected int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/serviceLevels/'.$this->assetTypeServiceLevelID.'/failurePoints/';
}
}
28 changes: 28 additions & 0 deletions src/Requests/Setup/AssetTypes/GetAssetTypeServiceLevels.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypeServiceLevels extends Request implements Paginatable
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/serviceLevels/';
}
}
28 changes: 28 additions & 0 deletions src/Requests/Setup/AssetTypes/GetAssetTypeTestReadings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypeTestReadings extends Request implements Paginatable
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/testReadings/';
}
}
14 changes: 6 additions & 8 deletions src/Requests/Setup/AssetTypes/GetAssetTypes.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Setup\AssetTypes;
namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetAssetTypes extends Request implements Paginatable
{
public function __construct(protected readonly int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $companyId)
{
//
}

/**
* The endpoint for the request
*/
Expand Down
27 changes: 27 additions & 0 deletions src/Requests/Setup/AssetTypes/RetrieveAssetType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveAssetType extends Request
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId;
}
}
27 changes: 27 additions & 0 deletions src/Requests/Setup/AssetTypes/RetrieveAssetTypeTestReadings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Integrations\Simpro\Requests\Setup\AssetTypes;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveAssetTypeTestReadings extends Request
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $assetTypeTestReadingId, protected int $assetTypeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/assetTypes/'.$this->assetTypeId.'/testReadings/'.$this->assetTypeTestReadingId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace StitchDigital\LaravelSimproApi\Requests\Setup\StatusCodes\CustomerInvoices;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveInvoiceStatusCodes extends Request
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $statusCodeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/statusCodes/customerInvoices/'.$this->statusCodeId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace StitchDigital\LaravelSimproApi\Requests\Setup\StatusCodes\Projects;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveProjectStatusCodes extends Request
{
/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

public function __construct(protected readonly int $statusCodeId, protected int $companyId)
{
//
}

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/setup/statusCodes/projects/'.$this->statusCodeId;
}
}

0 comments on commit 62c1d1f

Please sign in to comment.