首页 > 解决方案 > iot_v1.types.FieldMask() 是怎么来的?

问题描述

代码:

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))

这个 FieldMask 是从哪里来的?

标签: google-cloud-iot

解决方案


字段掩码是: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

它来自定义的 protobuf types,它是 IoT 包的一部分。


推荐阅读