generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from stitch-digital/21-request-group-quotes
21 request group quotes
- Loading branch information
Showing
78 changed files
with
2,659 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/Requests/Quotes/AttachmentFolders/CreateQuoteAttachmentFolder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders; | ||
|
||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
|
||
class CreateQuoteAttachmentFolder extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
*/ | ||
public function __construct(protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function defaultBody(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Requests/Quotes/AttachmentFolders/DeleteQuoteAttachmentFolder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
|
||
class DeleteQuoteAttachmentFolder extends Request | ||
{ | ||
public function __construct(protected int $folderId, protected readonly int $quoteId, protected readonly int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::DELETE; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Requests/Quotes/AttachmentFolders/GetQuoteAttachmentFolders.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\PaginationPlugin\Contracts\Paginatable; | ||
|
||
class GetQuoteAttachmentFolders extends Request implements Paginatable | ||
{ | ||
public function __construct(protected readonly int $quoteId, protected readonly int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* The HTTP method of the request | ||
*/ | ||
protected Method $method = Method::GET; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Requests/Quotes/AttachmentFolders/RetrieveQuoteAttachmentFolder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
|
||
class RetrieveQuoteAttachmentFolder extends Request | ||
{ | ||
public function __construct(protected int $folderId, protected readonly int $quoteId, protected int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* The HTTP method of the request | ||
*/ | ||
protected Method $method = Method::GET; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/Requests/Quotes/AttachmentFolders/UpdateQuoteAttachmentFolder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders; | ||
|
||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
|
||
class UpdateQuoteAttachmentFolder extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
*/ | ||
public function __construct(protected int $folderId, protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::PATCH; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function defaultBody(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments; | ||
|
||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
|
||
class CreateQuoteAttachment extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
*/ | ||
public function __construct(protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/'; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function defaultBody(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
|
||
class DeleteQuoteAttachment extends Request | ||
{ | ||
public function __construct(protected string $attachmentId, protected readonly int $quoteId, protected int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* The HTTP method of the request | ||
*/ | ||
protected Method $method = Method::DELETE; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/'.$this->attachmentId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments; | ||
|
||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
|
||
class UpdateQuoteAttachment extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
*/ | ||
public function __construct(protected string $attachmentId, protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::PATCH; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/'.$this->attachmentId; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function defaultBody(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes; | ||
|
||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
|
||
class CreateQuote extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
*/ | ||
public function __construct(protected readonly int $companyId, protected readonly array $data) | ||
{ | ||
// | ||
} | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function defaultBody(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\CustomFields; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\PaginationPlugin\Contracts\Paginatable; | ||
|
||
class GetQuoteCustomFields extends Request implements Paginatable | ||
{ | ||
public function __construct(protected readonly int $quoteId, protected readonly int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* The HTTP method of the request | ||
*/ | ||
protected Method $method = Method::GET; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/customFields/'; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Requests/Quotes/CustomFields/RetrieveQuoteCustomField.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace StitchDigital\LaravelSimproApi\Requests\Quotes\CustomFields; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
|
||
class RetrieveQuoteCustomField extends Request | ||
{ | ||
public function __construct(protected readonly int $customFieldId, protected readonly int $quoteId, protected readonly int $companyId) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* The HTTP method of the request | ||
*/ | ||
protected Method $method = Method::GET; | ||
|
||
/** | ||
* The endpoint for the request | ||
*/ | ||
public function resolveEndpoint(): string | ||
{ | ||
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/customFields/'.$this->customFieldId; | ||
} | ||
} |
Oops, something went wrong.