viam.resource.types =================== .. py:module:: viam.resource.types Attributes ---------- .. autoapisummary:: viam.resource.types.RESOURCE_NAMESPACE_RDK viam.resource.types.RESOURCE_TYPE_COMPONENT viam.resource.types.RESOURCE_TYPE_SERVICE viam.resource.types.ResourceCreator viam.resource.types.Validator Classes ------- .. autoapisummary:: viam.resource.types.API viam.resource.types.ModelFamily viam.resource.types.Model viam.resource.types.SupportsGetGeometries Functions --------- .. autoapisummary:: viam.resource.types.resource_name_from_string Module Contents --------------- .. py:data:: RESOURCE_NAMESPACE_RDK :value: 'rdk' .. py:data:: RESOURCE_TYPE_COMPONENT :value: 'component' .. py:data:: RESOURCE_TYPE_SERVICE :value: 'service' .. py:class:: API(namespace: str, resource_type: str, resource_subtype: str) Represents a known component/service (resource) API .. py:attribute:: namespace :type: str The namespace of the resource .. py:attribute:: resource_type :type: str The type of the resource, for example `component` or `service` .. py:attribute:: resource_subtype :type: str The subtype of the resource for example `servo`, `arm`, `vision` .. py:method:: __str__() -> str .. py:method:: __repr__() -> str .. py:method:: __hash__() -> int .. py:method:: __eq__(other: object) -> bool .. py:method:: from_resource_name(resource_name: viam.proto.common.ResourceName) -> typing_extensions.Self :classmethod: Convert a ```ResourceName``` into a ```API``` :param resource_name: The ResourceName to convert :type resource_name: viam.proto.common.ResourceName :returns: A new API :rtype: Self .. py:method:: from_string(string: str) -> typing_extensions.Self :classmethod: Create a ```API``` from its string representation (namespace:resource_type:resource_subtype) :param string: The API as a string :type string: str :raises ValueError: Raised if the string does not represent a valid API :returns: A new API :rtype: Self .. py:class:: ModelFamily(namespace: str, family: str) Represents a family of related models .. py:attribute:: namespace :type: str The namespace of the model family .. py:attribute:: family :type: str The family name .. py:attribute:: DEFAULT_FAMILY_NAME :type: ClassVar[str] :value: 'builtin' .. py:attribute:: DEFAULT :type: ClassVar[ModelFamily] .. py:method:: __str__() -> str .. py:method:: __repr__() -> str .. py:method:: __hash__() -> int .. py:method:: __eq__(other: object) -> bool .. py:class:: Model(model_family: ModelFamily, name: str) Represents a specific model within a family of models .. py:attribute:: model_family :type: ModelFamily The family to which this model belongs .. py:attribute:: name :type: str The name of the model .. py:method:: __str__() -> str .. py:method:: __repr__() -> str .. py:method:: __hash__() -> int .. py:method:: __eq__(other: object) -> bool .. py:method:: from_string(model: str, *, ignore_errors=False) -> typing_extensions.Self :classmethod: Create a ```Model``` from its string representation (namespace:family:name). :param model: The Model as a string :type model: str :param ignore_errors: If namespace or family are not found in the string, default to empty string rather than raise an exception. Defaults to False. :type ignore_errors: bool, optional :raises ValueError: Raised if the provided string is not a valid Model :returns: The Model :rtype: Self .. py:function:: resource_name_from_string(string: str) -> viam.proto.common.ResourceName Create a ResourceName from its string representation (namespace:resource_type:resource_subtype/name) :param string: The ResourceName as a string :type string: str :raises ValueError: Raised if the provided string is not a valid ResourceName :returns: The new ResourceName :rtype: viam.proto.common.ResourceName .. py:data:: ResourceCreator :type: TypeAlias :value: Callable[[ComponentConfig, Mapping[ResourceName, 'ResourceBase']], 'ResourceBase'] .. py:data:: Validator :type: TypeAlias :value: Callable[[ComponentConfig], Tuple[Sequence[str], Sequence[str]]] .. py:class:: SupportsGetGeometries Bases: :py:obj:`Protocol` The SupportsGetGeometries protocol defines the requirements for a resource to call get_geometries. .. py:method:: GetGeometries(request: viam.proto.common.GetGeometriesRequest, *, timeout: Optional[float] = None, **kwargs) -> viam.proto.common.GetGeometriesResponse :async: