This module defines the model and functions related to a publication.

class here.platform.model.publication.Publication(catalog, layers: List[Layer], dependencies: List[VersionDependency] | None = None, publication_info: Tuple[str, int | None] | None = None)[source]#

Bases: object

A publication is needed to write to a catalog.

Create a publication via the Catalog.init_publication function, specifying to which layers you want to write to. The request is validated and a Publication is returned when it can be satisfied.

Use the publication in the set_* and write_* method of Layer classes, for layers that need a publication to operate.

When writing is complete, close the publication by either calling the complete function, or cancel. Note however that not all the layer types support cancelling and rolling back a publication.

cancel(strict: bool = False)[source]#

Cancel the publication, usually as a result of errors.

After calling this function, the object can’t be used anymore. Pending transactions are rolled back, but data written to APIs that are not transaction-based stay written. :param strict: True to require that the publication exists, False to allow it to have

already been cancelled.

complete()[source]#

Complete the publication succesfully.

After calling this function, the object can’t be used anymore. Pending transactions are committed.

class here.platform.model.publication.PublicationState(value)[source]#

Bases: Enum

Enum class for publication states.

CANCELLED = 'cancelled'#
EXPIRED = 'expired'#
FAILED = 'failed'#
INITIALIZED = 'initialized'#
SUBMITTED = 'submitted'#
SUCCEEDED = 'succeeded'#