Documentation ¶
Index ¶
- Constants
- func CheckError(condition bool, errMessage string) error
- func CreateMobileBlack(cli bce.Client, args *CreateMobileBlackArgs) error
- func DeleteMobileBlack(cli bce.Client, args *DeleteMobileBlackArgs) error
- func DeleteSignature(cli bce.Client, args *DeleteSignatureArgs) error
- func DeleteTemplate(cli bce.Client, args *DeleteTemplateArgs) error
- func ModifySignature(cli bce.Client, args *ModifySignatureArgs) error
- func ModifyTemplate(cli bce.Client, args *ModifyTemplateArgs) error
- func UpdateQuotaRate(cli bce.Client, args *UpdateQuotaRateArgs) error
- type CreateMobileBlackArgs
- type CreateSignatureArgs
- type CreateSignatureResult
- type CreateTemplateArgs
- type CreateTemplateResult
- type DeleteMobileBlackArgs
- type DeleteSignatureArgs
- type DeleteTemplateArgs
- type GetMobileBlackArgs
- type GetMobileBlackResult
- type GetSignatureArgs
- type GetSignatureResult
- type GetTemplateArgs
- type GetTemplateResult
- type ListStatisticsArgs
- type ListStatisticsResponse
- type MobileBlackDetail
- type ModifySignatureArgs
- type ModifyTemplateArgs
- type QueryQuotaRateResult
- type SendMessageItem
- type SendSmsArgs
- type SendSmsResult
- type StatisticsResult
- type UpdateQuotaRateArgs
Constants ¶
const ( REQUEST_URI_SEND_SMS = "/api/v3/sendsms" REQUEST_URI_SIGNATURE = "/sms/v3/signatureApply" REQUEST_URI_TEMPLATE = "/sms/v3/template" REQUEST_URI_QUOTA = "/sms/v3/quota" REQUEST_URI_BLACK = "/sms/v3/blacklist" REQUEST_URI_STATISTICS = "/sms/v3/summary" CLIENT_TOKEN = "clientToken" )
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
func CreateMobileBlack ¶ added in v0.9.154
func CreateMobileBlack(cli bce.Client, args *CreateMobileBlackArgs) error
CreateMobileBlack - create an sms MobileBlack
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to create an sms mobileBlack
RETURNS:
- error: the return error if any occurs
func DeleteMobileBlack ¶ added in v0.9.154
func DeleteMobileBlack(cli bce.Client, args *DeleteMobileBlackArgs) error
DeleteMobileBlack - delete sms mobileBlack by phones
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to delete sms mobileBlack
RETURNS:
- error: the return error if any occurs
func DeleteSignature ¶
func DeleteSignature(cli bce.Client, args *DeleteSignatureArgs) error
DeleteSignature - delete an sms signature
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to delete an sms signature
RETURNS:
- error: the return error if any occurs
func DeleteTemplate ¶
func DeleteTemplate(cli bce.Client, args *DeleteTemplateArgs) error
DeleteTemplate - delete an sms template
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to delete an sms template
RETURNS:
- error: the return error if any occurs
func ModifySignature ¶
func ModifySignature(cli bce.Client, args *ModifySignatureArgs) error
ModifySignature - modify an sms signature
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to modify an sms signature
RETURNS:
- error: the return error if any occurs
func ModifyTemplate ¶
func ModifyTemplate(cli bce.Client, args *ModifyTemplateArgs) error
ModifyTemplate - modify an sms template
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to modify an sms template
RETURNS:
- error: the return error if any occurs
func UpdateQuotaRate ¶
func UpdateQuotaRate(cli bce.Client, args *UpdateQuotaRateArgs) error
UpdateQuotaRate - update the quota and rate limit detail of an user
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to update the quota and rate limit
RETURNS:
- *ListBucketsResult: the result bucket list structure
- error: nil if ok otherwise the specific error
Types ¶
type CreateMobileBlackArgs ¶ added in v0.9.154
type CreateMobileBlackArgs struct { Type string `json:"type"` SmsType string `json:"smsType"` SignatureIdStr string `json:"signatureIdStr"` Phone string `json:"phone"` CountryType string `json:"countryType"` }
CreateMobileBlackArgs defines the data structure for creating a mobileBlack
type CreateSignatureArgs ¶
type CreateSignatureArgs struct { Content string `json:"content"` ContentType string `json:"contentType"` Description string `json:"description,omitempty"` CountryType string `json:"countryType"` SignatureFileBase64 string `json:"signatureFileBase64,omitempty"` SignatureFileFormat string `json:"signatureFileFormat,omitempty"` }
CreateSignatureArgs defines the data structure for creating a signature
type CreateSignatureResult ¶
type CreateSignatureResult struct { SignatureId string `json:"signatureId"` Status string `json:"status"` }
CreateSignatureResult defines the data structure of the result of creating a signature
func CreateSignature ¶
func CreateSignature(cli bce.Client, args *CreateSignatureArgs) (*CreateSignatureResult, error)
CreateSignature - create an sms signature
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to create an sms signature
RETURNS:
- *api.CreateSignatureResult: the result of creating an sms signature
- error: the return error if any occurs
type CreateTemplateArgs ¶
type CreateTemplateArgs struct { Name string `json:"name"` Content string `json:"content"` SmsType string `json:"smsType"` CountryType string `json:"countryType"` Description string `json:"description,omitempty"` }
CreateTemplateArgs defines the data structure for creating a template
type CreateTemplateResult ¶
type CreateTemplateResult struct { TemplateId string `json:"templateId"` Status string `json:"status"` }
CreateTemplateResult defines the data structure of the result of creating a template
func CreateTemplate ¶
func CreateTemplate(cli bce.Client, args *CreateTemplateArgs) (*CreateTemplateResult, error)
CreateTemplate - create an sms template
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to create an sms template
RETURNS:
- *api.CreateTemplateResult: the result of creating an sms template
- error: the return error if any occurs
type DeleteMobileBlackArgs ¶ added in v0.9.154
type DeleteMobileBlackArgs struct {
Phones string `json:"phones"`
}
DeleteMobileBlackArgs defines the data structure for deleting mobileBlack by phones
type DeleteSignatureArgs ¶
type DeleteSignatureArgs struct {
SignatureId string `json:"signatureId"`
}
DeleteSignatureArgs defines the input data structure for deleting a signature
type DeleteTemplateArgs ¶
type DeleteTemplateArgs struct {
TemplateId string `json:"templateId"`
}
DeleteTemplateArgs defines the data structure for deleting a template
type GetMobileBlackArgs ¶ added in v0.9.154
type GetMobileBlackArgs struct { Phone string CountryType string SmsType string SignatureIdStr string StartTime string EndTime string PageNo string PageSize string }
GetMobileBlackArgs defines the data structure for get mobileBlackList startTime、endTime format is yyyy-MM-dd
type GetMobileBlackResult ¶ added in v0.9.154
type GetMobileBlackResult struct { TotalCount int `json:"totalCount"` PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` BlackLists []MobileBlackDetail `json:"blacklists"` }
GetMobileBlackResult defines the data structure for get mobileBlackList
func GetMobileBlack ¶ added in v0.9.154
func GetMobileBlack(cli bce.Client, args *GetMobileBlackArgs) (*GetMobileBlackResult, error)
GetMobileBlack - get sms mobileBlackList
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to get sms mobileBlackList
RETURNS:
- error: the return error if any occurs
- *api.GetMobileBlackResult: the result of get sms MobileBlackList
type GetSignatureArgs ¶
type GetSignatureArgs struct {
SignatureId string `json:"signatureId"`
}
GetSignatureArgs defines the input data structure for Getting a signature
type GetSignatureResult ¶
type GetSignatureResult struct { SignatureId string `json:"signatureId"` UserId string `json:"userId"` Content string `json:"content"` ContentType string `json:"contentType"` Status string `json:"status"` CountryType string `json:"countryType"` Review string `json:"review"` }
GetSignatureResult defines the data structure of the result of getting a signature
func GetSignature ¶
func GetSignature(cli bce.Client, args *GetSignatureArgs) (*GetSignatureResult, error)
GetSignature - get the detail of an sms signature
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to get the detail of an sms signature
RETURNS:
- *api.GetSignatureResult: the detail of an sms signature
- error: the return error if any occurs
type GetTemplateArgs ¶
type GetTemplateArgs struct {
TemplateId string `json:"templateId"`
}
GetTemplateArgs defines the data structure for getting a template
type GetTemplateResult ¶
type GetTemplateResult struct { TemplateId string `json:"templateId"` UserId string `json:"userId"` Name string `json:"name"` Content string `json:"content"` CountryType string `json:"countryType"` SmsType string `json:"smsType"` Status string `json:"status"` Description string `json:"description"` Review string `json:"review"` }
GetTemplateResult defines the data structure of the result of getting a template
func GetTemplate ¶
func GetTemplate(cli bce.Client, args *GetTemplateArgs) (*GetTemplateResult, error)
GetTemplate - modify an sms template
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to modify an sms template
RETURNS:
- error: the return error if any occurs
type ListStatisticsArgs ¶ added in v0.9.159
type ListStatisticsArgs struct { SmsType string `json:"smsType"` SignatureId string `json:"signatureId"` TemplateCode string `json:"TemplateCode"` CountryType string `json:"countryType"` // available values: "domestic", "international" StartTime string `json:"startTime"` // format: "yyyy-MM-dd" EndTime string `json:"endTime"` // format: "yyyy-MM-dd" }
ListStatisticsArgs defines the request data structure of ListStatistics
type ListStatisticsResponse ¶ added in v0.9.159
type ListStatisticsResponse struct {
StatisticsResults []StatisticsResult `json:"statisticsResults"`
}
ListStatisticsResponse defines the response data structure of ListStatistics
func ListStatistics ¶ added in v0.9.159
func ListStatistics(cli bce.Client, args *ListStatisticsArgs) (*ListStatisticsResponse, error)
ListStatistics - get sms statistics data
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to get sms statistics data
RETURNS:
- error: the return error if any occurs
- *api.ListStatisticsResponse: the result of get sms MobileBlackList
type MobileBlackDetail ¶ added in v0.9.154
type MobileBlackDetail struct { Phone string `json:"phone"` CountryType string `json:"countryType"` Type string `json:"type"` SmsType string `json:"smsType"` SignatureIdStr string `json:"signatureIdStr"` UpdateDate string `json:"updateDate"` }
MobileBlackDetail defines the data structure for mobileBlackList detail
type ModifySignatureArgs ¶
type ModifySignatureArgs struct { SignatureId string `json:"signatureId"` Content string `json:"content"` ContentType string `json:"contentType"` Description string `json:"description,omitempty"` CountryType string `json:"countryType"` SignatureFileBase64 string `json:"signatureFileBase64,omitempty"` SignatureFileFormat string `json:"signatureFileFormat,omitempty"` }
ModifySignatureArgs defines the input data structure for modifying parameters of a signature
type ModifyTemplateArgs ¶
type ModifyTemplateArgs struct { TemplateId string `json:"templateId"` Name string `json:"name"` Content string `json:"content"` SmsType string `json:"smsType"` CountryType string `json:"countryType"` Description string `json:"description,omitempty"` }
ModifyTemplateArgs defines the data structure for modifying a template
type QueryQuotaRateResult ¶
type QueryQuotaRateResult struct { QuotaPerDay int `json:"quotaPerDay"` QuotaRemainToday int `json:"quotaRemainToday"` QuotaPerMonth int `json:"quotaPerMonth"` QuotaRemainThisMonth int `json:"quotaRemainThisMonth"` ApplyQuotaPerDay int `json:"applyQuotaPerDay"` ApplyQuotaPerMonth int `json:"applyQuotaPerMonth"` ApplyCheckStatus string `json:"applyCheckStatus"` ApplyCheckReply string `json:"checkReply"` RateLimitPerDay int `json:"rateLimitPerMobilePerSignByDay"` RateLimitPerHour int `json:"rateLimitPerMobilePerSignByHour"` RateLimitPerMinute int `json:"rateLimitPerMobilePerSignByMinute"` RateLimitWhitelist bool `json:"rateLimitWhitelist"` }
QueryQuotaRateResult defines the data structure of querying the user's quota and rate limit
func QueryQuotaRate ¶
func QueryQuotaRate(cli bce.Client) (*QueryQuotaRateResult, error)
QueryQuotaRate - query the quota and rate limit detail of an user
RETURNS:
- *QueryQuotaRateResult: the result of the query
- error: the return error if any occurs
type SendMessageItem ¶
type SendSmsArgs ¶
type SendSmsArgs struct { Mobile string `json:"mobile"` Template string `json:"template"` SignatureId string `json:"signatureId"` ContentVar map[string]interface{} `json:"contentVar"` Custom string `json:"custom,omitempty"` UserExtId string `json:"userExtId,omitempty"` CallbackUrlId string `json:"merchantUrlId,omitempty"` ClientToken string `json:"clientToken,omitempty"` }
SendSmsArgs defines the data structure for sending a SMS request
type SendSmsResult ¶
type SendSmsResult struct { Code string `json:"code"` RequestId string `json:"requestId"` Message string `json:"message"` Data []SendMessageItem `json:"data"` }
SendSmsResult defines the data structure of the result of sending a SMS request
func SendSms ¶
func SendSms(cli bce.Client, args *SendSmsArgs) (*SendSmsResult, error)
SendSms - send an sms message
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to send an sms message
RETURNS:
- *api.SendSmsResult: the result of sending an sms message
- error: the return error if any occurs
type StatisticsResult ¶ added in v0.9.159
type StatisticsResult struct { Datetime string `json:"datetime"` CountryAlpha2Code string `json:"countryAlpha2Code"` SubmitCount string `json:"submitCount"` SubmitLongCount string `json:"submitLongCount"` ResponseSuccessCount string `json:"responseSuccessCount"` ResponseSuccessProportion string `json:"responseSuccessProportion"` DeliverSuccessCount string `json:"deliverSuccessCount"` DeliverSuccessLongCount string `json:"deliverSuccessLongCount"` DeliverSuccessProportion string `json:"deliverSuccessProportion"` DeliverFailureCount string `json:"deliverFailureCount"` DeliverFailureProportion string `json:"deliverFailureProportion"` ReceiptProportion string `json:"receiptProportion"` UnknownCount string `json:"unknownCount"` UnknownProportion string `json:"unknownProportion"` ResponseTimeoutCount string `json:"responseTimeoutCount"` UnknownErrorCount string `json:"unknownErrorCount"` NotExistCount string `json:"notExistCount"` SignatureOrTemplateCount string `json:"signatureOrTemplateCount"` AbnormalCount string `json:"abnormalCount"` OverclockingCount string `json:"overclockingCount"` OtherErrorCount string `json:"otherErrorCount"` BlacklistCount string `json:"blacklistCount"` RouteErrorCount string `json:"routeErrorCount"` IssueFailureCount string `json:"issueFailureCount"` ParameterErrorCount string `json:"parameterErrorCount"` IllegalWordCount string `json:"illegalWordCount"` AnomalyCount string `json:"anomalyCount"` }
StatisticsResult defines the detail of ListStatisticsResponse
type UpdateQuotaRateArgs ¶
type UpdateQuotaRateArgs struct { QuotaPerDay int `json:"quotaPerDay"` QuotaPerMonth int `json:"quotaPerMonth"` RateLimitPerDay int `json:"rateLimitPerMobilePerSignByDay"` RateLimitPerHour int `json:"rateLimitPerMobilePerSignByHour"` RateLimitPerMinute int `json:"rateLimitPerMobilePerSignByMinute"` }
UpdateQuotaRateArgs defines the data structure for updating quota and rate limit