Service Customization Helpers

exception bosdyn.client.service_customization_helpers.InvalidCustomParamSpecError[source]

Bases: ValueError

Error indicating that the defined custom parameter Spec is invalid, with a list of error messages explaining why the spec is invalid

bosdyn.client.service_customization_helpers.validate_dict_spec(dict_spec: Spec) None[source]

Checks that a DictParam.Spec is valid

Parameters:

dict_spec (service_customization_pb2.DictParam.Spec) – Spec to be validated

Returns:

None for a valid spec

Raises:

InvalidCustomParamSpecError with a list of error messages for invalid specs.

bosdyn.client.service_customization_helpers.create_value_validator(dict_spec: Spec) Callable[[DictParam], CustomParamError | None][source]

Checks if the DictParam.Spec is value and if so, returns a function that can be used to validate any DictParam value

Parameters:

dict_spec (service_customization_pb2.DictParam.Spec) – Spec to be validated and validate values against

Raises:

InvalidCustomParamSpecError with a list of error messages if the dict_spec is invalid

Returns:

A validate_value function that can be called on any value to verify it against this Spec. The returned function will itself return None if called on a valid value, and a CustomParamError with a status besides STATUS_OK for an invalid spec