Search code examples
google-cloud-iot

iot_v1.types.FieldMask() How did it come?


code:

device_path = client.device_path(
        project_id, cloud_region, registry_id, device_id)
    mask = iot_v1.types.FieldMask()
    mask.paths.append('config')
    mask.paths.append('gateway_config')
    device = client.get_device(client.list_devices(parent=path, field_mask=mask))

Where does this FieldMask come from?


Solution

  • The field mask is: The fields of the Device resource to be returned in the response. The fields id and num_id are always returned, along with any other fields specified. Source.

    It comes from the defined protobuf types, which is part of the IoT package.