api

package
v0.9.113 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

View Source
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"
	CLIENT_TOKEN          = "clientToken"
)

Variables

This section is empty.

Functions

func CheckError

func CheckError(condition bool, errMessage string) error

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 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 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 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 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"`
	QuotaWhitelist       bool `json:"quotaWhitelist"`
	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 SendMessageItem struct {
	Code      string `json:"code"`
	Mobile    string `json:"mobile"`
	MessageId string `json:"messageId"`
	Message   string `json:"message"`
}

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 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

Jump to

Keyboard shortcuts

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