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

     1  package iot
     2  
     3  import (
     4  	github_com_morlay_goqcloud "github.com/morlay/goqcloud"
     5  )
     6  
     7  // 新增设备
     8  // https://cloud.tencent.com/document/api/568/16465
     9  
    10  type AddDeviceRequest struct {
    11  	// 设备名称,唯一标识某产品下的一个设备
    12  	DeviceName string `name:"DeviceName"`
    13  	// 产品Id
    14  	ProductId string `name:"ProductId"`
    15  	// 区域
    16  	Region string `name:"Region"`
    17  }
    18  
    19  func (req *AddDeviceRequest) Invoke(client github_com_morlay_goqcloud.Client) (*AddDeviceResponse, error) {
    20  	resp := &AddDeviceResponse{}
    21  	err := client.Request("iot", "AddDevice", "2018-01-23").Do(req, resp)
    22  	return resp, err
    23  }
    24  
    25  type AddDeviceResponse struct {
    26  	github_com_morlay_goqcloud.TencentCloudBaseResponse
    27  	// 设备信息
    28  	Device Device `json:"Device"`
    29  }