File tree 2 files changed +30
-12
lines changed
ogc_api_processes_fastapi
2 files changed +30
-12
lines changed Original file line number Diff line number Diff line change 1
1
"""API routes registration and initialization."""
2
2
3
3
import typing
4
- from typing import Callable
4
+ from typing import Any , Callable
5
5
6
6
import fastapi
7
7
import pydantic
@@ -60,8 +60,26 @@ def instantiate_app(
60
60
exception_handler : Callable [
61
61
[fastapi .Request , exceptions .OGCAPIException ], fastapi .responses .JSONResponse
62
62
] = exceptions .ogc_api_exception_handler ,
63
+ ** kwargs : Any ,
63
64
) -> fastapi .FastAPI :
64
- app = fastapi .FastAPI ()
65
+ """Instantiate FastAPI application.
66
+
67
+ Parameters
68
+ ----------
69
+ client : clients.BaseClient
70
+ Client to be used for API requests.
71
+ exception_handler : Callable[[fastapi.Request, exceptions.OGCAPIException],
72
+ fastapi.responses.JSONResponse], optional
73
+ Exception handler, by default exceptions.ogc_api_exception_handler
74
+ **kwargs : Any
75
+ Additional parameters passed to `fastapi.Fastapi()`.
76
+
77
+ Returns
78
+ -------
79
+ fastapi.FastAPI
80
+ FastAPI application.
81
+ """
82
+ app = fastapi .FastAPI (** kwargs )
65
83
router = instantiate_router (client )
66
84
app .include_router (router )
67
85
app = exceptions .include_exception_handlers (app , exception_handler )
Original file line number Diff line number Diff line change @@ -34,14 +34,14 @@ class AdditionalParameter(pydantic.BaseModel):
34
34
35
35
36
36
class JobControlOptions (enum .Enum ):
37
- sync_execute : str = "sync-execute"
38
- async_execute : str = "async-execute"
39
- dismiss : str = "dismiss"
37
+ sync_execute = "sync-execute"
38
+ async_execute = "async-execute"
39
+ dismiss = "dismiss"
40
40
41
41
42
42
class TransmissionMode (enum .Enum ):
43
- value : str = "value"
44
- reference : str = "reference"
43
+ value = "value"
44
+ reference = "reference"
45
45
46
46
47
47
class PaginationQueryParameters (pydantic .BaseModel ):
@@ -260,11 +260,11 @@ class ProcessDescription(ProcessSummary):
260
260
261
261
262
262
class StatusCode (str , enum .Enum ):
263
- accepted : str = "accepted"
264
- running : str = "running"
265
- successful : str = "successful"
266
- failed : str = "failed"
267
- dismissed : str = "dismissed"
263
+ accepted = "accepted"
264
+ running = "running"
265
+ successful = "successful"
266
+ failed = "failed"
267
+ dismissed = "dismissed"
268
268
269
269
270
270
class JobType (enum .Enum ):
You can’t perform that action at this time.
0 commit comments