Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
RhysLees committed Dec 7, 2023
1 parent 5c3e097 commit 010d144
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Requests/Document/DeleteDocumentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function resolveEndpoint(): string
return '/FileCabinets/'.$this->fileCabinetId.'/Documents/'.$this->documentId;
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Response
{
return DeleteDocumentResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/GetDocumentCountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function defaultQuery(): array
];
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): int
{
return GetDocumentCountResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/GetDocumentDownloadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function defaultQuery(): array
];
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): string
{
return GetDocumentDownloadResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/GetDocumentPreviewRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): string
{
return GetDocumentPreviewResponse::fromResponse($response);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/Document/GetDocumentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\Requests\Document;

use CodebarAg\DocuWare\DTO\Document;
use CodebarAg\DocuWare\Responses\Document\GetDocumentResponse;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
Expand Down Expand Up @@ -38,7 +39,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Document
{
return GetDocumentResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/GetDocumentsDownloadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function defaultQuery(): array
];
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): string
{
return GetDocumentsDownloadResponse::fromResponse($response);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/Document/GetDocumentsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace CodebarAg\DocuWare\Requests\Document;

use CodebarAg\DocuWare\Responses\Document\GetDocumentsResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection
{
return GetDocumentsResponse::fromResponse($response);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/Document/PostDocumentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\Requests\Document;

use CodebarAg\DocuWare\DTO\Document;
use CodebarAg\DocuWare\DTO\DocumentIndex\PrepareDTO;
use CodebarAg\DocuWare\Responses\Document\PostDocumentResponse;
use Illuminate\Support\Collection;
Expand Down Expand Up @@ -45,7 +46,7 @@ protected function defaultBody(): array
return $body;
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Document
{
return PostDocumentResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/PostTransferDocumentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function defaultBody(): array
];
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): bool
{
return PostTransferDocumentResponse::fromResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/Document/PutDocumentFieldsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function defaultBody(): array

}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection
{
return PutDocumentFieldsResponse::fromResponse($response);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Requests/Fields/GetFieldsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace CodebarAg\DocuWare\Requests\Fields;

use CodebarAg\DocuWare\Responses\Fields\GetFieldsResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Enumerable;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
Expand Down Expand Up @@ -37,7 +39,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection|Enumerable
{
return GetFieldsResponse::fromResponse($response);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Requests/FileCabinets/GetFileCabinetsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace CodebarAg\DocuWare\Requests\FileCabinets;

use CodebarAg\DocuWare\Responses\FileCabinets\GetFileCabinetsResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Enumerable;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
Expand Down Expand Up @@ -32,7 +34,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection|Enumerable
{
return GetFileCabinetsResponse::fromResponse($response);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/Organization/GetOrganizationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\Requests\Organization;

use CodebarAg\DocuWare\DTO\Organization;
use CodebarAg\DocuWare\Responses\Organization\GetOrganizationResponse;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Organization
{
return GetOrganizationResponse::fromResponse($response);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Requests/Organization/GetOrganizationsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace CodebarAg\DocuWare\Requests\Organization;

use CodebarAg\DocuWare\Responses\Organization\GetOrganizationsResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Enumerable;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
Expand Down Expand Up @@ -32,7 +34,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection|Enumerable
{
return GetOrganizationsResponse::fromResponse($response);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Requests/Search/GetSearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\Requests\Search;

use CodebarAg\DocuWare\DTO\DocumentPaginator;
use CodebarAg\DocuWare\Responses\Search\GetSearchResponse;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
Expand Down Expand Up @@ -79,7 +80,7 @@ public function defaultBody(): array
];
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): DocumentPaginator
{
return GetSearchResponse::fromResponse($response, $this->page, $this->perPage);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Requests/Sections/GetSectionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace CodebarAg\DocuWare\Requests\Sections;

use CodebarAg\DocuWare\Responses\Sections\GetSectionsResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Enumerable;
use Illuminate\Support\Facades\Cache;
use Saloon\CachePlugin\Contracts\Cacheable;
use Saloon\CachePlugin\Drivers\LaravelCacheDriver;
Expand Down Expand Up @@ -45,7 +47,7 @@ public function cacheExpiryInSeconds(): int
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
public function createDtoFromResponse(Response $response): Collection|Enumerable
{
return GetSectionsResponse::fromResponse($response);
}
Expand Down

0 comments on commit 010d144

Please sign in to comment.