nat.registry_handlers.schemas.search#

Attributes#

Classes#

SearchFields

Enum where members are also (and must be) strings

VisualizeFields

Enum where members are also (and must be) strings

SearchQuery

Represents the search criteria that will be used to discover useful NAT components.

SearchResponseItem

Represents an individual item in the search response, including elements of it's discovery metadata.

SearchResponse

Represents a data model of the expected search response.

Module Contents#

logger#
class SearchFields#

Bases: enum.StrEnum

Enum where members are also (and must be) strings

Initialize self. See help(type(self)) for accurate signature.

ALL = 'all'#
PACKAGE = 'package'#
VERSION = 'version'#
COMPONENT_NAME = 'component_name'#
DESCRIPTION = 'description'#
DEVELOPER_NOTES = 'developer_notes'#
class VisualizeFields#

Bases: enum.StrEnum

Enum where members are also (and must be) strings

Initialize self. See help(type(self)) for accurate signature.

PACKAGE = 'package'#
VERSION = 'version'#
COMPONENT_TYPE = 'component_type'#
COMPONENT_NAME = 'component_name'#
DESCRIPTION = 'description'#
class SearchQuery(/, **data: Any)#

Bases: pydantic.BaseModel

Represents the search criteria that will be used to discover useful NAT components.

Args:

query (str): A query string used to find useful NAT components. fields (list[SearchFields]): The list of fields used when applying the query string. component_types (list[ComponentEnum]): NAT components types to filter search results. top_k (int): Specifies the number of search results to provide.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

query: str = '*'#
fields: list[SearchFields]#
component_types: list[nat.data_models.component.ComponentEnum]#
top_k: int = 10#
class SearchResponseItem(/, **data: Any)#

Bases: pydantic.BaseModel

Represents an individual item in the search response, including elements of it’s discovery metadata.

Args:

package (str): The name of the NAT package that includes the component. version (str): The version of the NAT package that includes the component. component_type (ComponentEnum): Type of NAT component this item represents. description (str): A description of this NAT component. developer_notes (str): Additional details that would help a developer use this component.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

package: str#
version: str#
component_type: nat.data_models.component.ComponentEnum#
component_name: str#
description: str#
developer_notes: str#
class SearchResponse(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a data model of the expected search response.

Args:

results (list[SearchResponseItem]): A list of results that matched the search criteria. params (SearchQuery): The search criterial that produced these search results. status (StatusMessage): Provides metadata describing the success or errors that occurred when making the search request.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

results: list[SearchResponseItem] = []#
params: SearchQuery#
status: nat.registry_handlers.schemas.status.StatusMessage#