yunpian

package
v0.0.0-...-99f5a6d Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: MIT Imports: 15 Imported by: 1

README

云片 SDK for Go

yunpian-go-sdk 是由飞牛巴士实现的云片接口客户端SDK.

Installing

请使用以下命令进行安装

go get -u github.com/FeiniuBus/yunpian-go-sdk/yunpian

Getting Start

  • 以发送单条短信为例
package main

import (
	"log"

	"github.com/FeiniuBus/yunpian-go-sdk/yunpian"
)

func main() {
	cfg := yunpian.DefaultConfig().WithAPIKey("xxxxxxxxxxxxx")
	sms := yunpian.NewClient(cfg).SMS()

	input := &yunpian.SingleSendRequest{
		Text:   "【云片网】您的验证码是1234",
		Mobile: "13800138000",
	}

	resp, err := sms.SingleSend(input)
	if err != nil {
		log.Fatal(err)
		return
	}

	log.Printf(resp.Message)
}

Configuration

  • WithUseSSL(use bool): 是否开启HTTPS访问
  • WithHTTPClient(client *http.Client): 使用自定义HTTPClient

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIV1Response

type APIV1Response struct {
	V1Response
	Detail string `json:"detail"`
}

APIV1Response - API v1 接口通用响应

type BatchSendRequest

type BatchSendRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	Text        string `schema:"text,omitempty"`
	Extend      string `schema:"extend,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
}

BatchSendRequest - 批量发送请求参数

func (*BatchSendRequest) Verify

func (req *BatchSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type BatchSendResponse

type BatchSendResponse struct {
	TotalCount int                  `json:"total_count"`
	TotalFee   string               `json:"total_fee"`
	Unit       string               `json:"unit"`
	Data       []SingleSendResponse `json:"data"`
}

BatchSendResponse - 批量发送响应结构

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides a client to the YunPian API

func NewClient

func NewClient(config *Config) *Client

NewClient returns a new client

func (*Client) Flow

func (c *Client) Flow() *Flow

Flow is used to return a handle to the flow APIs

func (*Client) SMS

func (c *Client) SMS() *SMS

SMS is used to return a handle to the SMS APIs

func (*Client) Sign

func (c *Client) Sign() *Sign

Sign is used to return a handle to the sign APIs

func (*Client) TPL

func (c *Client) TPL() *TPL

TPL is used to return a handle to the TPL APIs

func (*Client) User

func (c *Client) User() *User

User is used to return a handle to the user APIs

func (*Client) Voice

func (c *Client) Voice() *Voice

Voice is used to return a handle to the voice APIs

type Config

type Config struct {
	UseSSL     *bool
	HTTPClient *http.Client
	APIKey     *string
	Context    context.Context
	// contains filtered or unexported fields
}

Config - SDK 配置项,可以将允许用户配置的参数放入这里

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default client config pointer

func DefaultDevConfig

func DefaultDevConfig() *Config

DefaultDevConfig returns a default dev client config pointer

func (*Config) MergeIn

func (c *Config) MergeIn(cfgs ...*Config)

MergeIn merges the passed in configs into the existing config object.

func (*Config) WithAPIKey

func (c *Config) WithAPIKey(key string) *Config

func (*Config) WithContext

func (c *Config) WithContext(ctx context.Context) *Config

func (*Config) WithHTTPClient

func (c *Config) WithHTTPClient(client *http.Client) *Config

func (*Config) WithUseSSL

func (c *Config) WithUseSSL(use bool) *Config

type ConversionError

type ConversionError struct {
	Key   string       // key from the source map.
	Type  reflect.Type // expected type of elem
	Index int          // index for multi-value fields; -1 for single-value fields.
	Err   error        // low-level error (when it exists)
}

ConversionError stores information about a failed conversion.

func (ConversionError) Error

func (e ConversionError) Error() string

type Converter

type Converter func(string) reflect.Value

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder decodes values from a map[string][]string to a struct.

func NewDecoder

func NewDecoder() *Decoder

NewDecoder returns a new Decoder.

func (*Decoder) Decode

func (d *Decoder) Decode(dst interface{}, src map[string][]string) error

Decode decodes a map[string][]string to a struct.

The first parameter must be a pointer to a struct.

The second parameter is a map, typically url.Values from an HTTP request. Keys are "paths" in dotted notation to the struct fields and nested structs.

See the package documentation for a full explanation of the mechanics.

func (*Decoder) IgnoreUnknownKeys

func (d *Decoder) IgnoreUnknownKeys(i bool)

IgnoreUnknownKeys controls the behaviour when the decoder encounters unknown keys in the map. If i is true and an unknown field is encountered, it is ignored. This is similar to how unknown keys are handled by encoding/json. If i is false then Decode will return an error. Note that any valid keys will still be decoded in to the target struct.

To preserve backwards compatibility, the default value is false.

func (*Decoder) RegisterConverter

func (d *Decoder) RegisterConverter(value interface{}, converterFunc Converter)

RegisterConverter registers a converter function for a custom type.

func (*Decoder) SetAliasTag

func (d *Decoder) SetAliasTag(tag string)

SetAliasTag changes the tag used to locate custom field aliases. The default tag is "schema".

func (*Decoder) ZeroEmpty

func (d *Decoder) ZeroEmpty(z bool)

ZeroEmpty controls the behaviour when the decoder encounters empty values in a map. If z is true and a key in the map has the empty string as a value then the corresponding struct field is set to the zero value. If z is false then empty strings are ignored.

The default value is false, that is empty values do not change the value of the struct field.

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder encodes values from a struct into url.Values.

func NewEncoder

func NewEncoder() *Encoder

NewEncoder returns a new Encoder with defaults.

func (*Encoder) Encode

func (e *Encoder) Encode(src interface{}, dst map[string][]string) error

Encode encodes a struct into map[string][]string.

Intended for use with url.Values.

func (*Encoder) RegisterEncoder

func (e *Encoder) RegisterEncoder(value interface{}, encoder func(reflect.Value) string)

RegisterEncoder registers a converter for encoding a custom type.

func (*Encoder) SetAliasTag

func (e *Encoder) SetAliasTag(tag string)

SetAliasTag changes the tag used to locate custom field aliases. The default tag is "schema".

type Flow

type Flow struct {
	// contains filtered or unexported fields
}

Flow is used to manipulate the flow API

func (*Flow) GetPackageV1

func (f *Flow) GetPackageV1(carrier string) (*FlowGetPackageResponse, error)

GetPackageV1 - 获取流量包V1

func (*Flow) PullStatusV1

func (f *Flow) PullStatusV1(pageSize int) (*FlowPullStatusResponse, error)

PullStatusV1 - 流量充值状态查询接口v1

func (*Flow) RechargeV1

func (f *Flow) RechargeV1(input *FlowRechargeRequest) (*FlowRechargeResponse, error)

RechargeV1 - 流量充值v1接口

type FlowGetPackageRequest

type FlowGetPackageRequest struct {
	Carrier string `schema:"carrier,omitempty"`
}

FlowGetPackageRequest - 获取流量包请求参数

type FlowGetPackageResponse

type FlowGetPackageResponse struct {
	V1Response
	Package []FlowPackage `json:"flow_package"`
}

FlowGetPackageResponse - 获取流量包响应

type FlowPackage

type FlowPackage struct {
	SN           int64   `json:"sn"`
	CarrierPrice float64 `json:"carrier_price"`
	Discount     float64 `json:"discount"`
	Capacity     int     `json:"capacity"`
	Carrier      int     `json:"carrier"`
	Name         string  `json:"name"`
}

FlowPackage - 流量包

type FlowPullStatusResponse

type FlowPullStatusResponse struct {
	V1Response
	Status []FlowStatus `json:"flow_status"`
}

FlowPullStatusResponse - 流量充值状态响应

type FlowRechargeRequest

type FlowRechargeRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	SN          int64  `schema:"sn,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
}

FlowRechargeRequest - 充值流量请求参数

func (*FlowRechargeRequest) Verify

func (req *FlowRechargeRequest) Verify() error

Verify used to check the correctness of the request parameters

type FlowRechargeResponse

type FlowRechargeResponse struct {
	V1Response
	Result struct {
		Count int     `json:"count"`
		Fee   float64 `json:"fee"`
		SID   string  `json:"sid"`
	}
}

FlowRechargeResponse - 充值流量响应

type FlowStatus

type FlowStatus struct {
	SID             string `json:"sid"`
	UserReceiveTime string `json:"user_receive_time"`
	ErrorMessage    string `json:"error_msg"`
	Mobile          string `json:"mobile"`
	ReportStatus    string `json:"report_status"`
	SN              int64  `json:"sn"`
}

FlowStatus - 流量充值状态

type GetRecordRequest

type GetRecordRequest struct {
	Mobile    string `schema:"mobile,omitempty"`
	StartTime string `schema:"start_time,omitempty"`
	EndTime   string `schema:"end_time,omitempty"`
	PageNum   int    `schema:"page_num,omitempty"`
	PageSize  int    `schema:"page_size,omitempty"`
	Type      string `schema:"type,omitempty"`
}

GetRecordRequest - 查短信发送记录请求参数

func (*GetRecordRequest) Verify

func (req *GetRecordRequest) Verify() error

Verify used to check the correctness of the request parameters

type GetRecordResponse

type GetRecordResponse struct {
	SID             string  `json:"sid"`
	Mobile          string  `json:"mobile"`
	SendTime        string  `json:"send_time"`
	Text            string  `json:"text"`
	SendStatus      string  `json:"send_status"`
	ReportStatus    string  `json:"report_status"`
	Fee             float64 `json:"fee"`
	UserReceiveTime string  `json:"user_receive_time"`
	ErrorMessage    string  `json:"error_msg"`
	UID             string  `json:"uid"`
}

GetRecordResponse - 查短信发送记录响应

type GetTotalFeeRequest

type GetTotalFeeRequest struct {
	Date string `schema:"date"`
}

GetTotalFeeRequest - 日账单导出请求参数

func (*GetTotalFeeRequest) Verify

func (req *GetTotalFeeRequest) Verify() error

Verify used to check the correctness of the request parameters

type GetTotalFeeResponse

type GetTotalFeeResponse struct {
	Count        int    `json:"totalCount"`
	Fee          string `json:"totalFee"`
	SuccessCount int    `json:"totalSuccessCount"`
	FailedCount  int    `json:"totalFailedCount"`
	UnknownCount int    `json:"totalUnknownCount"`
}

GetTotalFeeResponse - 日账单导出响应

type MultiError

type MultiError map[string]error

MultiError stores multiple decoding errors.

Borrowed from the App Engine SDK.

func (MultiError) Error

func (e MultiError) Error() string

type MultiSendRequest

type MultiSendRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	Text        string `schema:"text,omitempty"`
	Extend      string `schema:"extend,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
}

MultiSendRequest - 批量个性化发送请求参数

func (*MultiSendRequest) Verify

func (req *MultiSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type MultiSendResponse

type MultiSendResponse struct {
	TotalCount int                  `json:"total_count"`
	TotalFee   string               `json:"total_fee"`
	Unit       string               `json:"unit"`
	Data       []SingleSendResponse `json:"data"`
}

MultiSendResponse - 批量个性化发送响应

type PullReplyRequest

type PullReplyRequest struct {
	PageSize int `schema:"page_size,omitempty"`
}

PullReplyRequest - 获取回复短信请求参数

type PullReplyResponse

type PullReplyResponse struct {
	ID         string `json:"id"`
	Mobile     string `json:"mobile"`
	Text       string `json:"text"`
	ReplyTime  string `json:"reply_time"`
	Extend     string `json:"extend"`
	BaseExtend string `json:"base_extend"`
	Sign       string `json:"_sign"`
}

PullReplyResponse - 获取回复短信响应

type PullStatusRequest

type PullStatusRequest struct {
	PageSize int `schema:"page_size,omitempty"`
}

PullStatusRequest - 获取状态报告请求参数

type PullStatusResponse

type PullStatusResponse struct {
	SID             int64  `json:"sid"`
	UID             string `json:"uid"`
	UserReceiveTime string `json:"user_receive_time"`
	ErrorMessage    string `json:"error_msg"`
	Mobile          string `json:"mobile"`
	ReportStatus    string `json:"report_status"`
}

PullStatusResponse - 获取状态报告响应

type SMS

type SMS struct {
	// contains filtered or unexported fields
}

SMS is used to manipulate the sms API

func (*SMS) BatchSend

func (sms *SMS) BatchSend(input *BatchSendRequest) (*BatchSendResponse, error)

BatchSend - 批量发送接口

func (*SMS) CountV1

func (sms *SMS) CountV1(input *SMSCountV1Request) (*SMSCountV1Response, error)

CountV1 - 统计短信条数接口(V1)

func (*SMS) GetBlackWorldV1

func (sms *SMS) GetBlackWorldV1(text string) (*SMSGetBlackWorldV1Response, error)

GetBlackWorldV1 - 查屏蔽词接口(V1)

func (*SMS) GetRecord

func (sms *SMS) GetRecord(input *GetRecordRequest) ([]*GetRecordResponse, error)

GetRecord - 查短信发送记录接口

func (*SMS) GetRecordV1

func (sms *SMS) GetRecordV1(input *SMSGetRecordV1Request) (*SMSGetRecordV1Response, error)

GetRecordV1 - 查短信发送记录接口(V1)

func (*SMS) GetReplyV1

func (sms *SMS) GetReplyV1(input *SMSGetReplyV1Request) (*SMSGetReplyV1Response, error)

GetReplyV1 - 查回复的短信接口(V1)

func (*SMS) GetTotalFee

func (sms *SMS) GetTotalFee(input *GetTotalFeeRequest) (*GetTotalFeeResponse, error)

GetTotalFee - 日账单导出接口

func (*SMS) MultiSend

func (sms *SMS) MultiSend(input *MultiSendRequest) (*MultiSendResponse, error)

MultiSend - 批量个性化发送接口

func (*SMS) MutilSendV1

func (sms *SMS) MutilSendV1(input *SMSMultiSendV1Request) ([]*SMSMutilSendV1Response, error)

MutilSendV1 - 批量个性化发送接口(V1)

func (*SMS) PullReply

func (sms *SMS) PullReply(input *PullReplyRequest) ([]*PullReplyResponse, error)

PullReply - 获取回复短信接口

func (*SMS) PullReplyV1

func (sms *SMS) PullReplyV1(pageSize int) (*SMSPullReplyV1Response, error)

PullReplyV1 - 获取回复短信接口(V1)

func (*SMS) PullStatus

func (sms *SMS) PullStatus(input *PullStatusRequest) ([]*PullStatusResponse, error)

PullStatus - 获取状态报告接口

func (*SMS) PullStatusV1

func (sms *SMS) PullStatusV1(pageSize int) (*SMSPullStatusV1Response, error)

PullStatusV1 - 获取状态报告接口(V1)

func (*SMS) SendV1

func (sms *SMS) SendV1(input *SingleSendRequest) (*SMSSendV1Response, error)

SendV1 - 智能匹配模板发送接口(V1)

func (*SMS) SingleSend

func (sms *SMS) SingleSend(input *SingleSendRequest) (*SingleSendResponse, error)

SingleSend - 单条短信发送接口

func (*SMS) TPLBatchSend

func (sms *SMS) TPLBatchSend(input *TPLBatchSendRequest) (*BatchSendResponse, error)

TPLBatchSend - 指定模板群发

func (*SMS) TPLSingleSend

func (sms *SMS) TPLSingleSend(input *TPLSingleSendRequest) (*SingleSendResponse, error)

TPLSingleSend - 指定模板单发接口

type SMSCountV1Request

type SMSCountV1Request struct {
	Mobile    string `schema:"mobile,omitempty"`
	StartTime string `schema:"start_time,omitempty"`
	EndTime   string `schema:"end_time,omitempty"`
	PageNum   int    `schema:"page_num,omitempty"`
	PageSize  int    `schema:"page_size,omitempty"`
}

SMSCountV1Request - 统计短信条数请求参数(V1)

func (*SMSCountV1Request) Verify

func (req *SMSCountV1Request) Verify() error

Verify used to check the correctness of the request parameters

type SMSCountV1Response

type SMSCountV1Response struct {
	V1Response
	Total int `json:"total"`
}

SMSCountV1Response - 统计短信条数响应(V1)

type SMSGetBlackWorldV1Response

type SMSGetBlackWorldV1Response struct {
	V1Response
	Result struct {
		BlackWorld string `json:"black_word"`
	} `json:"result"`
}

SMSGetBlackWorldV1Response - 查屏蔽词响应(V1)

type SMSGetRecordV1Request

type SMSGetRecordV1Request struct {
	Mobile    string `schema:"mobile,omitempty"`
	StartTime string `schema:"start_time,omitempty"`
	EndTime   string `schema:"end_time,omitempty"`
	PageNum   int    `schema:"page_num,omitempty"`
	PageSize  int    `schema:"page_size,omitempty"`
}

SMSGetRecordV1Request - 查短信发送记录请求参数(V1)

func (*SMSGetRecordV1Request) Verify

func (req *SMSGetRecordV1Request) Verify() error

Verify used to check the correctness of the request parameters

type SMSGetRecordV1Response

type SMSGetRecordV1Response struct {
	V1Response
	SMS []GetRecordResponse `json:"sms"`
}

SMSGetRecordV1Response - 查短信发送记录响应(V1)

type SMSGetReplyV1Request

type SMSGetReplyV1Request struct {
	StartTime string `schema:"start_time,omitempty"`
	EndTime   string `schema:"end_time,omitempty"`
	PageNum   int    `schema:"page_num,omitempty"`
	PageSize  int    `schema:"page_size,omitempty"`
	Mobile    string `schema:"mobile,omitempty"`
}

SMSGetReplyV1Request - 查回复的短信请求参数(V1)

func (*SMSGetReplyV1Request) Verify

func (req *SMSGetReplyV1Request) Verify() error

Verify used to check the correctness of the request parameters

type SMSGetReplyV1Response

type SMSGetReplyV1Response struct {
	V1Response
	Reply []struct {
		Mobile string `json:"mobile"`
		Text   string `json:"text"`
		Time   string `json:"reply_time"`
	} `json:"sms_reply"`
}

SMSGetReplyV1Response - 查回复的短信响应(V1)

type SMSMultiSendV1Request

type SMSMultiSendV1Request struct {
	Mobile      string `schema:"mobile,omitempty"`
	Text        string `schema:"text,omitempty"`
	Extend      string `schema:"extend,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
	UID         string `schema:"uid,omitempty"`
}

SMSMultiSendV1Request - 批量个性化发送请求参数(V1)

func (*SMSMultiSendV1Request) Verify

func (req *SMSMultiSendV1Request) Verify() error

Verify used to check the correctness of the request parameters

type SMSMutilSendV1Response

type SMSMutilSendV1Response struct {
	V1Response
	Result struct {
		Count int     `json:"count"`
		Fee   float64 `json:"fee"`
		SID   int64   `json:"sid"`
	} `json:"result"`
}

SMSMutilSendV1Response - 批量个性化发送响应(V1)

type SMSPullReplyV1Response

type SMSPullReplyV1Response struct {
	V1Response
	Reply []SMSReply `json:"sms_reply"`
}

SMSPullReplyV1Response - 获取回复短信响应(V1)

type SMSPullStatusV1Response

type SMSPullStatusV1Response struct {
	V1Response
	Status []PullStatusResponse `json:"sms_status"`
}

SMSPullStatusV1Response - 获取状态报告响应v1

type SMSReply

type SMSReply struct {
	Mobile     string `json:"mobile"`
	Time       string `json:"reply_time"`
	Text       string `json:"text"`
	Extend     string `json:"extend"`
	BaseExtend string `json:"base_extend"`
}

SMSReply -

type SMSSendRequest

type SMSSendRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	Text        string `schema:"text,omitempty"`
	Extend      string `schema:"extend,omitempty"`
	UID         string `schema:"uid,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
}

SMSSendRequest - 智能匹配模板发送请求参数(V1)

func (*SMSSendRequest) Verify

func (req *SMSSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type SMSSendV1Response

type SMSSendV1Response struct {
	V1Response
	Result struct {
		Count int     `json:"count"`
		Fee   float64 `json:"fee"`
		SID   int64   `json:"sid"`
	} `json:"result"`
}

SMSSendV1Response - 智能匹配模板发送响应(V1)

type Sign

type Sign struct {
	// contains filtered or unexported fields
}

Sign is used to manipulate the sign API

func (*Sign) Add

func (sign *Sign) Add(input *SignAddRequest) (*SignAddResponse, error)

Add - 添加签名接口

func (*Sign) Get

func (sign *Sign) Get(input *SignGetRequest) (*SignGetResponse, error)

Get - 获取签名接口

func (*Sign) Update

func (sign *Sign) Update(input *SignUpdateRequest) (*SignUpdateResponse, error)

Update - 修改签名接口

type SignAddEntry

type SignAddEntry struct {
	ApplyState   string `json:"apply_state"`
	Sign         string `json:"sign"`
	ApplyVIP     bool   `json:"is_apply_vip"`
	OnlyGlobal   bool   `json:"is_only_global"`
	IndustryType string `json:"industry_type"`
}

SignAddEntry is

type SignAddRequest

type SignAddRequest struct {
	Sign         string `schema:"sign,omitempty"`
	Notify       bool   `schema:"notify,omitempty"`
	ApplyVIP     bool   `schema:"apply_vip,omitempty"`
	OnlyGlobal   bool   `schema:"is_only_global,omitempty"`
	IndustryType string `schema:"industry_type,omitempty"`
	LicenseURL   string `schema:"license_url,omitempty"`
}

SignAddRequest - 添加签名请求参数

func (*SignAddRequest) Verify

func (req *SignAddRequest) Verify() error

Verify used to check the correctness of the request parameters

type SignAddResponse

type SignAddResponse struct {
	Code    int            `json:"code"`
	Message string         `json:"msg"`
	Sign    []SignAddEntry `json:"sign"`
}

SignAddResponse - 添加签名响应

type SignGetEntry

type SignGetEntry struct {
	Chan         string `json:"chan"`
	CheckStatus  string `json:"check_status"`
	Enabled      bool   `json:"enabled"`
	Extend       string `json:"extend"`
	IndustryType string `json:"industry_type"`
	OnlyGlobal   bool   `json:"only_global"`
	Remark       string `json:"remark"`
	Sign         string `json:"sign"`
	VIP          bool   `json:"vip"`
}

SignGetEntry is

type SignGetRequest

type SignGetRequest struct {
	Sign     string `schema:"sign,omitempty"`
	PageNum  int    `schema:"page_num,omitempty"`
	PageSize int    `schema:"page_size,omitempty"`
}

SignGetRequest - 获取签名请求参数

type SignGetResponse

type SignGetResponse struct {
	Code  int            `json:"code"`
	Total int            `json:"total"`
	Sign  []SignGetEntry `json:"sign"`
}

SignGetResponse - 获取签名响应

type SignUpdateEntry

type SignUpdateEntry struct {
	ApplyState   string `json:"apply_state"`
	Sign         string `json:"sign"`
	ApplyVIP     bool   `json:"is_apply_vip"`
	OnlyGlobal   bool   `json:"is_only_global"`
	IndustryType string `json:"industry_type"`
}

SignUpdateEntry is

type SignUpdateRequest

type SignUpdateRequest struct {
	OldSign      string `schema:"old_sign,omitempty"`
	Sign         string `schema:"sign,omitempty"`
	Notify       bool   `schema:"notify,omitempty"`
	ApplyVIP     bool   `schema:"apply_vip,omitempty"`
	OnlyGlobal   bool   `schema:"is_only_global,omitempty"`
	IndustryType string `schema:"industry_type,omitempty"`
	LicenseURL   string `schema:"license_url,omitempty"`
}

SignUpdateRequest - 修改签名请求参数

func (*SignUpdateRequest) Verify

func (req *SignUpdateRequest) Verify() error

Verify used to check the correctness of the request parameters

type SignUpdateResponse

type SignUpdateResponse struct {
	Code    int             `json:"code"`
	Message string          `json:"msg"`
	Sign    SignUpdateEntry `json:"sign"`
}

SignUpdateResponse - 修改签名响应

type SingleSendRequest

type SingleSendRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	Text        string `schema:"text,omitempty"`
	Extend      string `schema:"extend,omitempty"`
	UID         string `schema:"uid,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
	Register    bool   `schema:"register,omitempty"`
}

SingleSendRequest - 单条短信发送参数

func (*SingleSendRequest) Verify

func (req *SingleSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type SingleSendResponse

type SingleSendResponse struct {
	Code    int     `json:"code"`
	Message string  `json:"msg"`
	Count   int     `json:"count"`
	Fee     float64 `json:"fee"`
	Unit    string  `json:"unit"`
	Mobile  string  `json:"mobile"`
	SID     int64   `json:"sid"`
}

SingleSendResponse - 单条短信发送响应

func (*SingleSendResponse) IsSuccess

func (resp *SingleSendResponse) IsSuccess() bool

IsSuccess used to determine whether to send successfully

type TPL

type TPL struct {
	// contains filtered or unexported fields
}

TPL is used to manipulate the tpl API

func (*TPL) Add

func (tpl *TPL) Add(input *TPLAddRequest) (*TPLResponse, error)

Add - 添加模版接口

func (*TPL) AddV1

func (tpl *TPL) AddV1(input *TPLAddV1Request) (*TPLV1Response, error)

AddV1 - 添加模版v1接口

func (*TPL) AddVoiceNotify

func (tpl *TPL) AddVoiceNotify(input *TPLAddVoiceNotifyRequest) (*TPLAddVoiceNotifyResponse, error)

AddVoiceNotify - 添加语音通知模版接口

func (*TPL) Del

func (tpl *TPL) Del(input *TPLDelRequest) (*TPLResponse, error)

Del - 删除模板接口

func (*TPL) DelV1

func (tpl *TPL) DelV1(id int64) (*APIV1Response, error)

DelV1 - 模版删除接口v1

func (*TPL) Get

func (tpl *TPL) Get(input *TPLGetRequest) (*TPLResponse, error)

Get - 获取模板接口

func (*TPL) GetDefault

func (tpl *TPL) GetDefault(input *TPLGetRequest) (*TPLResponse, error)

GetDefault - 取默认模板接口

func (*TPL) GetV1

func (tpl *TPL) GetV1(id int64) (*TPLV1Response, error)

GetV1 - 获取模版v1接口

func (*TPL) List

func (tpl *TPL) List() ([]*TPLResponse, error)

List - 获取模版列表接口

func (*TPL) ListDefault

func (tpl *TPL) ListDefault() ([]*TPLResponse, error)

ListDefault - 获取默认模版列表接口

func (*TPL) ListV1

func (tpl *TPL) ListV1() (*TPLListV1Response, error)

ListV1 - 获取模版列表v1接口

func (*TPL) Update

func (tpl *TPL) Update(input *TPLUpdateRequest) (*TPLUpdateResponse, error)

Update - 修改模版接口

func (*TPL) UpdateV1

func (tpl *TPL) UpdateV1(input *TPLUpdateV1Request) (*TPLV1Response, error)

UpdateV1 - 模版更新接口v1

func (*TPL) UpdateVocieNotify

func (tpl *TPL) UpdateVocieNotify(input *TPLUpdateVoiceNotifyRequest) (*TPLUpdateVoiceNotifyResponse, error)

UpdateVocieNotify - 修改语音通知模版接口

type TPLAddRequest

type TPLAddRequest struct {
	Content    string `schema:"tpl_content,omitempty"`
	NotifyType int    `schema:"notify_type,omitempty"`
	Language   string `schema:"lang,omitempty"`
}

TPLAddRequest - 添加模版请求参数

func (*TPLAddRequest) Verify

func (req *TPLAddRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLAddV1Request

type TPLAddV1Request struct {
	Content    string `schema:"tpl_content,omitempty"`
	NotifyType int    `schema:"notify_type,omitempty"`
}

TPLAddV1Request - 添加模版V1请求参数

func (*TPLAddV1Request) Verify

func (req *TPLAddV1Request) Verify() error

Verify used to check the correctness of the request parameters

type TPLAddVoiceNotifyRequest

type TPLAddVoiceNotifyRequest struct {
	Content    string `schema:"tpl_content,omitempty"`
	NotifyType int    `scheam:"notify_type,omitempty"`
}

TPLAddVoiceNotifyRequest - 添加语音通知模版请求参数

func (*TPLAddVoiceNotifyRequest) Verify

func (req *TPLAddVoiceNotifyRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLAddVoiceNotifyResponse

type TPLAddVoiceNotifyResponse struct {
	ID          string `json:"tpl_id"`
	Content     string `json:"tpl_content"`
	CheckStatus string `json:"check_status"`
	Reason      string `json:"reason"`
}

TPLAddVoiceNotifyResponse - 添加语音通知模版响应

type TPLBatchSendRequest

type TPLBatchSendRequest struct {
	Mobile   string `schema:"mobile,omitempty"`
	TPLID    int64  `schema:"tpl_id,omitempty"`
	TPLValue string `schema:"tpl_value,omitempty"`
	Extend   string `schema:"extend,omitempty"`
	UID      string `schema:"uid,omitempty"`
}

TPLBatchSendRequest - 指定模板群发请求参数

func (*TPLBatchSendRequest) Verify

func (req *TPLBatchSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLDelRequest

type TPLDelRequest struct {
	ID int64 `schema:"tpl_id"`
}

TPLDelRequest - 删除模板请求参数

func (*TPLDelRequest) Verify

func (req *TPLDelRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLGetRequest

type TPLGetRequest struct {
	ID int64 `schema:"tpl_id,omitempty"`
}

TPLGetRequest - 获取模板请求参数

func (*TPLGetRequest) Verify

func (req *TPLGetRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLListV1Response

type TPLListV1Response struct {
	V1Response
	Template []Template `json:"template"`
}

TPLListV1Response - 获取模版列表v1响应

type TPLResponse

type TPLResponse struct {
	ID          int64  `json:"tpl_id"`
	Content     string `json:"tpl_content"`
	Status      string `json:"check_status"`
	Reason      string `json:"reason"`
	Language    string `json:"lang"`
	CountryCode string `json:"country_code"`
}

TPLResponse - 模版响应

type TPLSingleSendRequest

type TPLSingleSendRequest struct {
	Mobile   string `schema:"mobile,omitempty"`
	TPLID    int64  `schema:"tpl_id,omitempty"`
	TPLValue string `schema:"tpl_value,omitempty"`
	Extend   string `schema:"extend,omitempty"`
	UID      string `schema:"uid,omitempty"`
}

TPLSingleSendRequest - 指定模板单发请求参数

func (*TPLSingleSendRequest) Verify

func (req *TPLSingleSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLUpdateRequest

type TPLUpdateRequest struct {
	ID       int64  `schema:"tpl_id,omitempty"`
	Content  string `schema:"tpl_content,omitempty"`
	Language string `json:"lang,omitempty"`
}

TPLUpdateRequest - 修改模版请求参数

func (*TPLUpdateRequest) Verify

func (req *TPLUpdateRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLUpdateResponse

type TPLUpdateResponse struct {
	Code     int         `json:"code"`
	Message  string      `json:"msg"`
	Template TPLResponse `json:"template"`
}

TPLUpdateResponse - 修改模版响应

type TPLUpdateV1Request

type TPLUpdateV1Request struct {
	ID      int64  `schema:"tpl_id,omitempty"`
	Content string `schema:"tpl_content,omitempty"`
}

TPLUpdateV1Request - 修改模版v1请求参数

func (*TPLUpdateV1Request) Verify

func (req *TPLUpdateV1Request) Verify() error

Verify used to check the correctness of the request parameters

type TPLUpdateVoiceNotifyRequest

type TPLUpdateVoiceNotifyRequest struct {
	ID      int64  `schema:"tpl_id,omitempty"`
	Content string `schema:"tpl_content,omitempty"`
}

TPLUpdateVoiceNotifyRequest - 修改语音通知模版请求参数

func (*TPLUpdateVoiceNotifyRequest) Verify

func (req *TPLUpdateVoiceNotifyRequest) Verify() error

Verify used to check the correctness of the request parameters

type TPLUpdateVoiceNotifyResponse

type TPLUpdateVoiceNotifyResponse struct {
	ID          int64  `json:"tpl_id"`
	Content     string `json:"tpl_content"`
	CheckStatus string `json:"check_status"`
	Reason      string `json:"reason"`
}

TPLUpdateVoiceNotifyResponse - 修改语音通知模版响应

type TPLV1Response

type TPLV1Response struct {
	V1Response
	Template Template `json:"template"`
}

TPLV1Response - 添加模版v1响应

type Template

type Template struct {
	ID          int64  `json:"tpl_id"`
	Content     string `json:"tpl_content"`
	CheckStatus string `json:"check_status"`
	Reason      string `json:"reason"`
}

Template - 模版

type User

type User struct {
	// contains filtered or unexported fields
}

User is used to manipulate the user API

func (*User) Get

func (u *User) Get() (*UserResponse, error)

Get - 查询账户信息接口

func (*User) GetV1

func (u *User) GetV1() (*UserGetV1Response, error)

GetV1 - 获取用户接口v1

func (*User) Set

func (u *User) Set(input *UserSetRequest) (*UserResponse, error)

Set - 修改账号信息接口

func (*User) SetV1

func (u *User) SetV1(input *UserSetRequest) (*APIV1Response, error)

SetV1 - 设置用户接口V1

type UserGetV1Response

type UserGetV1Response struct {
	V1Response
	User UserResponse `json:"user"`
}

UserGetV1Response - v1用户获取接口响应

type UserResponse

type UserResponse struct {
	Nick             string  `json:"nick"`
	Created          string  `json:"gmt_created"`
	Mobile           string  `json:"mobile"`
	Email            string  `json:"email"`
	IPWhitelist      string  `json:"ip_whitelist"`
	APIVersion       string  `json:"api_version"`
	Balance          float64 `json:"balance"`
	AlarmBalance     int64   `json:"alarm_balance"`
	EmergencyContact string  `json:"emergency_contact"`
	EmergencyMobile  string  `json:"emergency_mobile"`
}

UserResponse - 账户信息响应

type UserSetRequest

type UserSetRequest struct {
	EmergencyContact string `schema:"emergency_contact,omitempty"`
	EmergencyMobile  string `schema:"emergency_mobile,omitempty"`
	AlarmBalance     int64  `schema:"alarm_balance,omitempty"`
}

UserSetRequest - 修改账号信息请求参数

type V1Response

type V1Response struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`
}

V1Response - v1接口通用响应

type Voice

type Voice struct {
	// contains filtered or unexported fields
}

Voice is used to manipulate the voice API

func (*Voice) PullStatus

func (v *Voice) PullStatus(input *VoicePullStatusRequest) ([]*VoicePullStatusResponse, error)

PullStatus - 语音状态报告获取接口

func (*Voice) PullStatusV1

func (v *Voice) PullStatusV1(pageSize int) (*VoicePullStatusV1Response, error)

PullStatusV1 - 获取语音状态报告接口v1

func (*Voice) Send

func (v *Voice) Send(input *VoiceSendRequest) (*VoiceSendResponse, error)

Send - 语音验证码发送接口

func (*Voice) SendV1

func (v *Voice) SendV1(input *VoiceSendRequest) (*VoiceSendV1Response, error)

SendV1 - 发送语音验证码v1

func (*Voice) TPLNotify

func (v *Voice) TPLNotify(input *VoiceTPLNotifyRequest) (*VoiceTPLNotifyResponse, error)

TPLNotify - 发送语音通知接口

type VoicePullStatusRequest

type VoicePullStatusRequest struct {
	PageSize int `schema:"page_size,omitempty"`
	Type     int `scheam:"type,omitempty"`
}

VoicePullStatusRequest - 语音状态报告获取请求参数

type VoicePullStatusResponse

type VoicePullStatusResponse struct {
	SID             string `json:"sid"`
	UID             string `json:"uid"`
	UserReceiveTime string `json:"user_receive_time"`
	Duration        int    `json:"duration"`
	ErrorMessage    string `json:"error_msg"`
	Mobile          string `json:"mobile"`
	ReportStatus    string `json:"report_status"`
}

VoicePullStatusResponse - 语音状态报告获取响应

type VoicePullStatusV1Response

type VoicePullStatusV1Response struct {
	V1Response
	Status []VoicePullStatusResponse `json:"voice_status"`
}

VoicePullStatusV1Response - 获取语音状态报告响应v1

type VoiceSendRequest

type VoiceSendRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	Code        string `schema:"code,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
	DisplayNum  string `schema:"display_num,omitempty"`
}

VoiceSendRequest - 语音验证码请求参数

func (*VoiceSendRequest) Verify

func (req *VoiceSendRequest) Verify() error

Verify used to check the correctness of the request parameters

type VoiceSendResponse

type VoiceSendResponse struct {
	Count int    `json:"count"`
	Fee   int    `json:"fee"`
	SID   string `json:"sid"`
}

VoiceSendResponse - 语音验证码响应

type VoiceSendV1Response

type VoiceSendV1Response struct {
	V1Response
	Result VoiceSendResponse `json:"result"`
}

VoiceSendV1Response - 语音验证码发送响应v1

type VoiceTPLNotifyRequest

type VoiceTPLNotifyRequest struct {
	Mobile      string `schema:"mobile,omitempty"`
	TPLID       int64  `schema:"tpl_id,omitempty"`
	TPLValue    string `schema:"tpl_value,omitempty"`
	CallbackURL string `schema:"callback_url,omitempty"`
}

VoiceTPLNotifyRequest - 发送语音通知请求参数

func (*VoiceTPLNotifyRequest) Verify

func (req *VoiceTPLNotifyRequest) Verify() error

Verify used to check the correctness of the request parameters

type VoiceTPLNotifyResponse

type VoiceTPLNotifyResponse struct {
	Count int    `json:"count"`
	Fee   int    `json:"fee"`
	SID   string `json:"sid"`
}

VoiceTPLNotifyResponse - 发送语音通知响应

Jump to

Keyboard shortcuts

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