datasets.NewDatapointDescriptor
func NewDatapointDescriptor(dataset *datasets.Dataset) (*datasets.DatapointDescriptor, error)Create a reusable descriptor for decoding raw protobuf datapoints from a loaded dataset.
Use this helper when you want to query datasets without generated Go protobuf types.
Parameters
dataset *datasets.Dataset required A dataset returned by client.Datasets.Get or another dataset client method.
Returns
A DatapointDescriptor that can be passed to UnmarshalDatapoint or DatapointDecoder.Unmarshal.
Enum values
Use EnumNumber to look up the protobuf number for a string from your enum definition. This works for both scalar
values and individual values in a repeated field:
func (d *datasets.DatapointDescriptor) EnumNumber(
fieldName, value string,
) (protoreflect.EnumNumber, error)The method returns an error if the field isn’t a custom enum or the value isn’t allowed. Don’t use a value’s position in the schema list as its number. Query filters take strings directly, so you don’t need this conversion when filtering.
When the allowed values change, fetch the dataset again and rebuild the descriptor before using the new values. See the dynamic ingestion example.