notify

package
v1.0.100 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion  = "cn-north-1"
	ServiceVersion = "2021-01-01"
	ServiceName    = "volc_voice_notify"
)
View Source
const TIME_LAYOUT = "2006-01-02 15:04:05"

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    "cloud-vms.volcengineapi.com",
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{

		"CreateTask": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateTask"},
				"Version": []string{ServiceVersion},
			},
		},
		"BatchAppend": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"BatchAppend"},
				"Version": []string{ServiceVersion},
			},
		},
		"PauseTask": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"PauseTask"},
				"Version": []string{ServiceVersion},
			},
		},
		"ResumeTask": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ResumeTask"},
				"Version": []string{ServiceVersion},
			},
		},

		"StopTask": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"StopTask"},
				"Version": []string{ServiceVersion},
			},
		},
		"UpdateTask": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateTask"},
				"Version": []string{ServiceVersion},
			},
		},
		"SingleBatchAppend": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"SingleBatchAppend"},
				"Version": []string{ServiceVersion},
			},
		},
		"SingleInfo": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"SingleInfo"},
				"Version": []string{ServiceVersion},
			},
		},
		"SingleCancel": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"SingleCancel"},
				"Version": []string{ServiceVersion},
			},
		},
		"FetchResource": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"FetchResource"},
				"Version": []string{ServiceVersion},
			},
		},
		"OpenCreateTts": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"OpenCreateTts"},
				"Version": []string{ServiceVersion},
			},
		},

		"OpenDeleteResource": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"OpenDeleteResource"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetResourceUploadUrl": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetResourceUploadUrl"},
				"Version": []string{ServiceVersion},
			},
		},
		"CommitResourceUpload": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CommitResourceUpload"},
				"Version": []string{ServiceVersion},
			},
		},
		"OpenUpdateResource": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"OpenUpdateResource"},
				"Version": []string{ServiceVersion},
			},
		},
		"QueryUsableResource": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"QueryUsableResource"},
				"Version": []string{ServiceVersion},
			},
		},
		"QueryOpenGetResource": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"QueryOpenGetResource"},
				"Version": []string{ServiceVersion},
			},
		},
	}
)
View Source
var DefaultInstance = NewInstance()

DefaultInstance 默认的实例

Functions

This section is empty.

Types

type BasicResourceResponse

type BasicResourceResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *BasicResourceResult
}

type BasicResourceResult

type BasicResourceResult struct {
	ResourceKey string
	Suffix      string
	Name        string
	UploadUrl   string
}

type BatchAppendRequest

type BatchAppendRequest struct {
	TaskOpenId string
	PhoneList  []*PhoneParam
}

type CommonResponse

type CommonResponse struct {
	ResponseMetadata *base.ResponseMetadata
}

type CreateTaskRequest

type CreateTaskRequest struct {
	Name            string
	PhoneList       []*PhoneParam
	Resource        string
	StartTime       JsonTime
	EndTime         JsonTime
	Concurrency     int32
	Start           bool  `json:",omitempty"`
	MaxRingDuration int32 `json:",omitempty"`
	//max 3
	RingAgainTimes int32 `json:",omitempty"`
	//min 5
	RingAgainInterval int32 `json:",omitempty"`
	Unique            bool
	ForbidTimeList    []*ForbidTimeItem `json:",omitempty"`
	NumberPoolNo      string
	NumberList        []string `json:",omitempty"`
	SelectNumberType  int32
	SelectNumberRule  int32
	Type              int32
	FinishWhenListEnd bool `json:",omitempty"`
}

type CreateTtsResourceRequest

type CreateTtsResourceRequest struct {
	Name               string
	TtsTemplateContent string
	Remark             string
}

type EditTaskRequest

type EditTaskRequest struct {
	TaskOpenId  string
	StartTime   JsonTime
	EndTime     JsonTime
	Recall      bool
	Concurrency int32
	//max 3
	RingAgainTimes int32
	//min 5
	RingAgainInterval int32
	ForbidTimeList    []*ForbidTimeItem `json:",omitempty"`
}

type FailItem

type FailItem struct {
	Index int32
	Phone string
	Type  string
}

type FetchVoiceResourceRequest

type FetchVoiceResourceRequest struct {
	Url  string
	Name string
}

type ForbidTimeItem

type ForbidTimeItem struct {
	//星期几,不填代表每天都生效,1表示周日,2表示周一,以此类推
	Weekdays []int32 `json:",omitempty"`

	//时间段,至少应该有一个时间段,example:["09:00-10:00","15:00-16:00"]
	Times []string
}

type GetResourceResult

type GetResourceResult struct {
	Records []*Resource
	Total   int32
	Limit   int32
	Offset  int32
}

type JsonTime

type JsonTime time.Time

func (JsonTime) MarshalJSON

func (this JsonTime) MarshalJSON() ([]byte, error)

实现它的json序列化方法

func (JsonTime) UnmarshalJSON

func (this JsonTime) UnmarshalJSON(bytes []byte) error

type Notify

type Notify struct {
	Client *base.Client
}

IAM .

func NewInstance

func NewInstance() *Notify

NewInstance 创建一个实例

func (*Notify) BatchAppend

func (p *Notify) BatchAppend(req *BatchAppendRequest) (*TaskAppendResponse, int, error)

func (*Notify) CommitVoiceResourceUpload

func (p *Notify) CommitVoiceResourceUpload(req *UploadVoiceResourceRequest) (*BasicResourceResponse, int, error)

func (*Notify) CreateTask

func (p *Notify) CreateTask(req *CreateTaskRequest) (*TaskAppendResponse, int, error)

func (*Notify) CreateTtsResource

func (p *Notify) CreateTtsResource(req *CreateTtsResourceRequest) (*BasicResourceResponse, int, error)

func (*Notify) DeleteResourceByResourceKey

func (p *Notify) DeleteResourceByResourceKey(resourceKey string) (*CommonResponse, int, error)

func (*Notify) FetchVoiceResourceByUrl

func (p *Notify) FetchVoiceResourceByUrl(req *FetchVoiceResourceRequest) (*BasicResourceResponse, int, error)

func (*Notify) GenerateVoiceResourceUploadUrl

func (p *Notify) GenerateVoiceResourceUploadUrl(req *UploadVoiceResourceRequest) (*BasicResourceResponse, int, error)

func (*Notify) GetAPIInfo

func (p *Notify) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*Notify) GetServiceInfo

func (p *Notify) GetServiceInfo() *base.ServiceInfo

GetServiceInfo interface

func (*Notify) OpenUpdateResource

func (p *Notify) OpenUpdateResource(resourceKey string, name string) (*BasicResourceResponse, int, error)

func (*Notify) PauseTask

func (p *Notify) PauseTask(taskOpenId string) (*CommonResponse, int, error)

func (*Notify) QueryOpenGetResource

func (p *Notify) QueryOpenGetResource(req *QueryOpenGetResourceRequest) (*QueryOpenGetResourceResponse, int, error)

func (*Notify) QueryUsableResource

func (p *Notify) QueryUsableResource(resourceType string) (*QueryUsableResourceResponse, int, error)

func (*Notify) ResumeTask

func (p *Notify) ResumeTask(taskOpenId string) (*CommonResponse, int, error)

func (*Notify) SetHost

func (p *Notify) SetHost(host string)

SetHost .

func (*Notify) SetRegion

func (p *Notify) SetRegion(region string)

SetHost .

func (*Notify) SetSchema

func (p *Notify) SetSchema(schema string)

SetSchema .

func (*Notify) SingleBatchAppend

func (p *Notify) SingleBatchAppend(req *SingleAppendRequest) (*SingleAppendResponse, int, error)

func (*Notify) SingleCancel

func (p *Notify) SingleCancel(taskOpenId string) (*CommonResponse, int, error)

func (*Notify) SingleInfo

func (p *Notify) SingleInfo(taskOpenId string) (*SingleInfoResponse, int, error)

func (*Notify) StopTask

func (p *Notify) StopTask(taskOpenId string) (*CommonResponse, int, error)

func (*Notify) UpdateTask

func (p *Notify) UpdateTask(req *EditTaskRequest) (*TaskAppendResponse, int, error)

type PhoneParam

type PhoneParam struct {
	Phone      string
	PhoneParam map[string]interface{}
	TtsContent string
	Ext        string
	SmsParam   map[string]interface{}
}

type QueryOpenGetResourceRequest

type QueryOpenGetResourceRequest struct {
	Type    int32
	Keyword string `json:",omitempty"`
	State   int32  `json:",omitempty"`
	Limit   int32  `json:",omitempty"`
	Offset  int32  `json:",omitempty"`
}

type QueryOpenGetResourceResponse

type QueryOpenGetResourceResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *GetResourceResult
}

type QueryUsableResourceResponse

type QueryUsableResourceResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           []*Resource
}

type Resource

type Resource struct {
	ResourceKey string
	Suffix      string
	Name        string
	Duration    int32
	State       int32
	CreateTime  string
	Type        int32
	Remark      string
}

type SingleAppendRequest

type SingleAppendRequest struct {
	List []*SingleParam
}

type SingleAppendResponse

type SingleAppendResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *SingleAppendResult
}

type SingleAppendResult

type SingleAppendResult struct {
	SuccessList []*SingleResultItem
	FailList    []*SingleResultItem
}

type SingleInfo

type SingleInfo struct {
	SingleOpenId string
	Resource     string
	Phone        string
	Ext          string
	CreateTime   JsonTime
	State        string
	ReleaseTime  JsonTime
	Duration     int32
}

type SingleInfoResponse

type SingleInfoResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *SingleInfo
}

type SingleParam

type SingleParam struct {
	SingleOpenId string
	Phone        string
	Resource     string
	TriggerTime  JsonTime `json:",omitempty"`
	//max 3
	RingAgainTimes int32 `json:",omitempty"`
	//min 5
	RingAgainInterval int32 `json:",omitempty"`
	PhoneParam        map[string]interface{}
	TtsContent        string
	Ext               string
	NumberPoolNo      string
	NumberList        []string `json:",omitempty"`
	NumberType        int32
	Type              int32
	SelectNumberRule  int32             `json:",omitempty"`
	ForbidTimeList    []*ForbidTimeItem `json:",omitempty"`
}

type SingleResultItem

type SingleResultItem struct {
	Phone        string
	SingleOpenId string
	Type         string
}

type TaskAppendResponse

type TaskAppendResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *TaskAppendResult
}

type TaskAppendResult

type TaskAppendResult struct {
	TaskOpenId string
	FailList   []*FailItem
}

type UploadVoiceResourceRequest

type UploadVoiceResourceRequest struct {
	FileName string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL