File tree Expand file tree Collapse file tree 2 files changed +30
-12
lines changed
ogc_api_processes_fastapi Expand file tree Collapse file tree 2 files changed +30
-12
lines changed Original file line number Diff line number Diff line change 11"""API routes registration and initialization."""
22
33import typing
4- from typing import Callable
4+ from typing import Any , Callable
55
66import fastapi
77import pydantic
@@ -60,8 +60,26 @@ def instantiate_app(
6060 exception_handler : Callable [
6161 [fastapi .Request , exceptions .OGCAPIException ], fastapi .responses .JSONResponse
6262 ] = exceptions .ogc_api_exception_handler ,
63+ ** kwargs : Any ,
6364) -> 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 )
6583 router = instantiate_router (client )
6684 app .include_router (router )
6785 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):
3434
3535
3636class 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"
4040
4141
4242class TransmissionMode (enum .Enum ):
43- value : str = "value"
44- reference : str = "reference"
43+ value = "value"
44+ reference = "reference"
4545
4646
4747class PaginationQueryParameters (pydantic .BaseModel ):
@@ -260,11 +260,11 @@ class ProcessDescription(ProcessSummary):
260260
261261
262262class 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"
268268
269269
270270class JobType (enum .Enum ):
You can’t perform that action at this time.
0 commit comments