-
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 #30 from Codycody31/main
Update build tag and introduce ATIS audio file functionality
- Loading branch information
Showing
15 changed files
with
477 additions
and
72 deletions.
There are no files selected for viewing
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
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
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,33 @@ | ||
<?php | ||
|
||
namespace App\OpenApi\Parameters; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Parameter; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\ParametersFactory; | ||
|
||
class GetTextToSpeechParameters extends ParametersFactory | ||
{ | ||
/** | ||
* @return Parameter[] | ||
*/ | ||
public function build(): array | ||
{ | ||
return [ | ||
|
||
Parameter::query() | ||
->name('icao') | ||
->description('ICAO code of the airport') | ||
->required(true) | ||
->schema(Schema::string()) | ||
->example('KJAX'), | ||
Parameter::query() | ||
->name('id') | ||
->description('ID of the ATIS audio file') | ||
->required(true) | ||
->schema(Schema::string()) | ||
->example('1'), | ||
|
||
]; | ||
} | ||
} |
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 | ||
|
||
namespace App\OpenApi\Parameters\TTS; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Parameter; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\ParametersFactory; | ||
|
||
class DeleteParameters extends ParametersFactory | ||
{ | ||
/** | ||
* @return Parameter[] | ||
*/ | ||
public function build(): array | ||
{ | ||
return [ | ||
|
||
Parameter::query() | ||
->name('id') | ||
->description('The ID of the ATIS audio file.') | ||
->required() | ||
->schema(Schema::string()), | ||
Parameter::query() | ||
->name('password') | ||
->description('The password for the ATIS audio file if it is protected.') | ||
->schema(Schema::string()), | ||
|
||
]; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/app/OpenApi/RequestBodies/TTS/GetTextToSpeechRequestBody.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,31 @@ | ||
<?php | ||
|
||
namespace App\OpenApi\RequestBodies\TTS; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\RequestBody; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\RequestBodyFactory; | ||
|
||
class GetTextToSpeechRequestBody extends RequestBodyFactory | ||
{ | ||
public function build(): RequestBody | ||
{ | ||
$response = Schema::object()->properties( | ||
Schema::string('id') | ||
->example('1') | ||
->description('The ID of the ATIS audio file.') | ||
->required(), | ||
Schema::string('icao') | ||
->example('KJAX') | ||
->description('The ICAO code of the airport.') | ||
->required(), | ||
); | ||
|
||
return RequestBody::create('GetTextToSpeech') | ||
->description('Get TTS file for an airport.') | ||
->content( | ||
MediaType::json()->schema($response) | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/OpenApi/Responses/TTS/Delete/ErrorMissingIdResponse.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,28 @@ | ||
<?php | ||
|
||
namespace App\OpenApi\Responses\TTS\Delete; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\ResponseFactory; | ||
use Vyuldashev\LaravelOpenApi\Contracts\Reusable; | ||
|
||
class ErrorMissingIdResponse extends ResponseFactory implements Reusable | ||
{ | ||
public function build(): Response | ||
{ | ||
$response = Schema::object()->properties( | ||
Schema::string('status')->example('error'), | ||
Schema::string('message')->example('You must provide an ATIS ID.'), | ||
Schema::integer('code')->example(400), | ||
Schema::object('data')->nullable() | ||
); | ||
|
||
return Response::create('TTSErrorMissingId') | ||
->description('Missing ATIS ID') | ||
->content( | ||
MediaType::json()->schema($response) | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/OpenApi/Responses/TTS/Delete/ErrorNotFoundResponse.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,28 @@ | ||
<?php | ||
|
||
namespace App\OpenApi\Responses\TTS\Delete; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\ResponseFactory; | ||
use Vyuldashev\LaravelOpenApi\Contracts\Reusable; | ||
|
||
class ErrorNotFoundResponse extends ResponseFactory implements Reusable | ||
{ | ||
public function build(): Response | ||
{ | ||
$response = Schema::object()->properties( | ||
Schema::string('status')->example('error'), | ||
Schema::string('message')->example('ATIS audio file not found.'), | ||
Schema::integer('code')->example(404), | ||
Schema::object('data')->nullable() | ||
); | ||
|
||
return Response::create('TTSErrorNotFound') | ||
->description('Cannot find the ATIS audio file.') | ||
->content( | ||
MediaType::json()->schema($response) | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/OpenApi/Responses/TTS/Delete/ErrorPasswordProtectedResponse.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,28 @@ | ||
<?php | ||
|
||
namespace App\OpenApi\Responses\TTS\Delete; | ||
|
||
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response; | ||
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema; | ||
use Vyuldashev\LaravelOpenApi\Factories\ResponseFactory; | ||
use Vyuldashev\LaravelOpenApi\Contracts\Reusable; | ||
|
||
class ErrorPasswordProtectedResponse extends ResponseFactory implements Reusable | ||
{ | ||
public function build(): Response | ||
{ | ||
$response = Schema::object()->properties( | ||
Schema::string('status')->example('error'), | ||
Schema::string('message')->example('Password is missing or incorrect.'), | ||
Schema::integer('code')->example(401), | ||
Schema::object('data')->nullable() | ||
); | ||
|
||
return Response::create('ErrorPasswordProtectedResponse') | ||
->description('Password is missing or incorrect.') | ||
->content( | ||
MediaType::json()->schema($response) | ||
); | ||
} | ||
} |
Oops, something went wrong.