Skip to main content

prefect.server.models.block_types

Functions for interacting with block type ORM objects. Intended for internal use by the Prefect REST API.

Functions

emit_block_type_created_event

Emit an event when a block type is created.

emit_block_type_updated_event

Emit an event when a block type is updated.

emit_block_type_deleted_event

Emit an event when a block type is deleted.

create_block_type

Create a new block type. Args:
  • session: A database session
  • block_type: a block type object
Returns:
  • an ORM block type model

read_block_type

Reads a block type by id. Args:
  • session: A database session
  • block_type_id: a block_type id
Returns:
  • an ORM block type model

read_block_type_by_slug

Reads a block type by slug. Args:
  • session: A database session
  • block_type_slug: a block type slug
Returns:
  • an ORM block type model

read_block_types

Reads block types with an optional limit and offset Args: Returns:
  • List[BlockType]: List of

update_block_type

Update a block type by id. Args:
  • session: A database session
  • block_type_id: Data to update block type with
  • block_type: A block type id
Returns:
  • True if the block type was updated

delete_block_type

Delete a block type by id. Args:
  • session: A database session
  • block_type_id: A block type id
Returns:
  • True if the block type was updated