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

     1  package scf
     2  
     3  import (
     4  	github_com_morlay_goqcloud "github.com/morlay/goqcloud"
     5  )
     6  
     7  // 设置函数触发方式
     8  // https://cloud.tencent.com/document/api/583/18589
     9  
    10  type CreateTriggerRequest struct {
    11  	// 新建触发器绑定的函数名称
    12  	FunctionName string `name:"FunctionName"`
    13  	// 函数的版本
    14  	Qualifier *string `name:"Qualifier,omitempty"`
    15  	// 区域
    16  	Region string `name:"Region"`
    17  	// 触发器对应的参数,如果是 timer 类型的触发器其内容是 Linux cron 表达式,如果是其他触发器,见具体触发器说明
    18  	TriggerDesc *string `name:"TriggerDesc,omitempty"`
    19  	// 新建触发器名称。如果是定时触发器,名称支持英文字母、数字、连接符和下划线,最长100个字符;如果是其他触发器,见具体触发器绑定参数的说明
    20  	TriggerName string `name:"TriggerName"`
    21  	// 触发器类型,目前支持 cos 、cmq、 timers、 ckafka类型
    22  	Type string `name:"Type"`
    23  }
    24  
    25  func (req *CreateTriggerRequest) Invoke(client github_com_morlay_goqcloud.Client) (*CreateTriggerResponse, error) {
    26  	resp := &CreateTriggerResponse{}
    27  	err := client.Request("scf", "CreateTrigger", "2018-04-16").Do(req, resp)
    28  	return resp, err
    29  }
    30  
    31  type CreateTriggerResponse struct {
    32  	github_com_morlay_goqcloud.TencentCloudBaseResponse
    33  }