// Copyright 2019 Yunion // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package notify import ( "yunion.io/x/jsonutils" "yunion.io/x/pkg/tristate" "yunion.io/x/onecloud/pkg/apis" ) const ( WEBHOOK_SIGNATURE_HEADER = "X-Auth-Token" ) type RobotCreateInput struct { apis.SharableVirtualResourceCreateInput apis.EnabledBaseResourceCreateInput // description: robot type // enum: ["feishu","dingtalk","workwx","webhook"] // example: webhook Type string `json:"type"` // description: address // example: http://helloworld.io/test/webhook Address string `json:"address"` // description: Language preference // example: zh_CN Lang string `json:"lang"` Header jsonutils.JSONObject `json:"header"` Body jsonutils.JSONObject `json:"body"` MsgKey string `json:"msg_key"` SecretKey string `json:"secret_key"` UseTemplate tristate.TriState `json:"use_template"` } type RobotDetails struct { apis.SharableVirtualResourceDetails } type RobotListInput struct { apis.SharableVirtualResourceListInput apis.EnabledResourceBaseListInput // description: robot type // enum: ["feishu","dingtalk","workwx","webhook"] // example: webhook Type string `json:"type"` // description: Language preference // example: en Lang string `json:"lang"` } type RobotUpdateInput struct { apis.SharableVirtualResourceBaseUpdateInput // description: address // example: http://helloworld.io/test/webhook Address string `json:"address"` // description: Language preference // example: en Lang string `json:"lang"` Header jsonutils.JSONObject `json:"header"` Body jsonutils.JSONObject `json:"body"` MsgKey string `json:"msg_key"` SecretKey string `json:"secret_key"` }