github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/iotcloud/update_device_shadow.go (about)

     1  package iotcloud
     2  
     3  import (
     4  	github_com_morlay_goqcloud "github.com/morlay/goqcloud"
     5  )
     6  
     7  // 更新设备影子
     8  // https://cloud.tencent.com/document/api/634/19488
     9  
    10  type UpdateDeviceShadowRequest struct {
    11  	// 设备名称
    12  	DeviceName string `name:"DeviceName"`
    13  	// 产品ID
    14  	ProductId string `name:"ProductId"`
    15  	// 区域
    16  	Region string `name:"Region"`
    17  	// 当前版本号,需要和后台的version保持一致,才能更新成功
    18  	ShadowVersion int64 `name:"ShadowVersion"`
    19  	// 虚拟设备的状态,JSON字符串格式,由desired结构组成
    20  	State string `name:"State"`
    21  }
    22  
    23  func (req *UpdateDeviceShadowRequest) Invoke(client github_com_morlay_goqcloud.Client) (*UpdateDeviceShadowResponse, error) {
    24  	resp := &UpdateDeviceShadowResponse{}
    25  	err := client.Request("iotcloud", "UpdateDeviceShadow", "2018-06-14").Do(req, resp)
    26  	return resp, err
    27  }
    28  
    29  type UpdateDeviceShadowResponse struct {
    30  	github_com_morlay_goqcloud.TencentCloudBaseResponse
    31  	// 设备影子数据,JSON字符串格式
    32  	Data string `json:"Data"`
    33  }