index
Objects
StyleObject
class StyleObject(BaseModel)
An object describing a vector style.
Arguments:
BaseModelBaseModel - inherited from pydantic.
Attributes:
defaultstr - a default style name.styleslist[str] - list of style names.customdict - Geostyle json.
BaseInput
class BaseInput(BaseModel)
Base input event.
Arguments:
BaseModelBaseModel - inherited from pydantic
Attributes:
workspacestr - name of the workspace.layernamestr - name of the layer.datestr, optional - date in %YYYYmmDD format.descriptionstr, optional - description of the layer.style_jsonStyleObject, optional - input styling definitions.zonestr | int, optional - force publication to happen on another target zone ID.prefixstr, optional - input prefix to find source files.force_publishbool, optional - force publication even when databases block you.overwritebool, optional - overwrite previous publication.
Raises:
ValueError- raised when required input is invalid.
Returns:
_type_- description
is_none_with_prefix
@model_validator(mode="before")
@classmethod
def is_none_with_prefix(cls, data: dict) -> dict
Attempt to fix incoming data when date and prefix aren't present
Arguments:
datadict - input data
Raises:
ValueError- raised when both are None
Returns:
dict- fixed data
is_none_with_force
@model_validator(mode="before")
@classmethod
def is_none_with_force(cls, data: dict) -> dict
Method to run a specific override
Arguments:
datadict - input data
Raises:
ValueError- raised when zone information is missing
Returns:
dict- forced fix on data
Functions
lambda_handler
@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> dict
Lambda handler that deals with publication of vector data
Arguments:
eventdict - input event, must be convertable to BaseInputcontextdict - contains authentication information
Raises:
HTTPError- raised when publication endpoint fails
Returns:
dict- output event
Examples:
event = {
"workspace": "some-workspace",
"layername": "some-layer",
"date": "20210201",
"description": "some description",
"style_json": {
"default": "some_generic.json",
"styles": [
"some_generic.json",
"some_cool_style.json"
],
"custom": {
"name": "a styles",
"rules": [
"filter": [
"&&",
"attribute",
"this"
],
"symbolizer": {
"color": "red",
"opacity": 1,
},
"name": "rule name"
]
}
},
"zone": 1336,
"force_publish": False,
"overwrite": False
}