Browse Source

DYSMSAPI SDK Auto Released By zuochao,Version:1.56.12

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 6 years ago
parent
commit
25233c783f

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2019-04-18 Version: 1.56.12
+1, New service
+
 2019-04-18 Version: 1.56.11
 1, CreateCacheAnalysisTask prop modify
 

+ 81 - 0
services/dysmsapi/client.go

@@ -0,0 +1,81 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 114 - 0
services/dysmsapi/query_send_details.go

@@ -0,0 +1,114 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// QuerySendDetails invokes the dysmsapi.QuerySendDetails API synchronously
+// api document: https://help.aliyun.com/api/dysmsapi/querysenddetails.html
+func (client *Client) QuerySendDetails(request *QuerySendDetailsRequest) (response *QuerySendDetailsResponse, err error) {
+	response = CreateQuerySendDetailsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// QuerySendDetailsWithChan invokes the dysmsapi.QuerySendDetails API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/querysenddetails.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QuerySendDetailsWithChan(request *QuerySendDetailsRequest) (<-chan *QuerySendDetailsResponse, <-chan error) {
+	responseChan := make(chan *QuerySendDetailsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.QuerySendDetails(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// QuerySendDetailsWithCallback invokes the dysmsapi.QuerySendDetails API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/querysenddetails.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QuerySendDetailsWithCallback(request *QuerySendDetailsRequest, callback func(response *QuerySendDetailsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *QuerySendDetailsResponse
+		var err error
+		defer close(result)
+		response, err = client.QuerySendDetails(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// QuerySendDetailsRequest is the request struct for api QuerySendDetails
+type QuerySendDetailsRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	SendDate             string           `position:"Query" name:"SendDate"`
+	PhoneNumber          string           `position:"Query" name:"PhoneNumber"`
+	BizId                string           `position:"Query" name:"BizId"`
+	PageSize             requests.Integer `position:"Query" name:"PageSize"`
+	CurrentPage          requests.Integer `position:"Query" name:"CurrentPage"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// QuerySendDetailsResponse is the response struct for api QuerySendDetails
+type QuerySendDetailsResponse struct {
+	*responses.BaseResponse
+	RequestId         string            `json:"RequestId" xml:"RequestId"`
+	Code              string            `json:"Code" xml:"Code"`
+	Message           string            `json:"Message" xml:"Message"`
+	TotalCount        string            `json:"TotalCount" xml:"TotalCount"`
+	SmsSendDetailDTOs SmsSendDetailDTOs `json:"SmsSendDetailDTOs" xml:"SmsSendDetailDTOs"`
+}
+
+// CreateQuerySendDetailsRequest creates a request to invoke QuerySendDetails API
+func CreateQuerySendDetailsRequest() (request *QuerySendDetailsRequest) {
+	request = &QuerySendDetailsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Dysmsapi", "2017-05-25", "QuerySendDetails", "dysmsapi", "openAPI")
+	return
+}
+
+// CreateQuerySendDetailsResponse creates a response to parse from QuerySendDetails response
+func CreateQuerySendDetailsResponse() (response *QuerySendDetailsResponse) {
+	response = &QuerySendDetailsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 113 - 0
services/dysmsapi/send_batch_sms.go

@@ -0,0 +1,113 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// SendBatchSms invokes the dysmsapi.SendBatchSms API synchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendbatchsms.html
+func (client *Client) SendBatchSms(request *SendBatchSmsRequest) (response *SendBatchSmsResponse, err error) {
+	response = CreateSendBatchSmsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// SendBatchSmsWithChan invokes the dysmsapi.SendBatchSms API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendbatchsms.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SendBatchSmsWithChan(request *SendBatchSmsRequest) (<-chan *SendBatchSmsResponse, <-chan error) {
+	responseChan := make(chan *SendBatchSmsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.SendBatchSms(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// SendBatchSmsWithCallback invokes the dysmsapi.SendBatchSms API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendbatchsms.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SendBatchSmsWithCallback(request *SendBatchSmsRequest, callback func(response *SendBatchSmsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *SendBatchSmsResponse
+		var err error
+		defer close(result)
+		response, err = client.SendBatchSms(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// SendBatchSmsRequest is the request struct for api SendBatchSms
+type SendBatchSmsRequest struct {
+	*requests.RpcRequest
+	TemplateParamJson    string           `position:"Query" name:"TemplateParamJson"`
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	SmsUpExtendCodeJson  string           `position:"Query" name:"SmsUpExtendCodeJson"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	SignNameJson         string           `position:"Query" name:"SignNameJson"`
+	TemplateCode         string           `position:"Query" name:"TemplateCode"`
+	PhoneNumberJson      string           `position:"Query" name:"PhoneNumberJson"`
+}
+
+// SendBatchSmsResponse is the response struct for api SendBatchSms
+type SendBatchSmsResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizId     string `json:"BizId" xml:"BizId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+}
+
+// CreateSendBatchSmsRequest creates a request to invoke SendBatchSms API
+func CreateSendBatchSmsRequest() (request *SendBatchSmsRequest) {
+	request = &SendBatchSmsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Dysmsapi", "2017-05-25", "SendBatchSms", "dysmsapi", "openAPI")
+	return
+}
+
+// CreateSendBatchSmsResponse creates a response to parse from SendBatchSms response
+func CreateSendBatchSmsResponse() (response *SendBatchSmsResponse) {
+	response = &SendBatchSmsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 114 - 0
services/dysmsapi/send_sms.go

@@ -0,0 +1,114 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// SendSms invokes the dysmsapi.SendSms API synchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendsms.html
+func (client *Client) SendSms(request *SendSmsRequest) (response *SendSmsResponse, err error) {
+	response = CreateSendSmsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// SendSmsWithChan invokes the dysmsapi.SendSms API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendsms.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SendSmsWithChan(request *SendSmsRequest) (<-chan *SendSmsResponse, <-chan error) {
+	responseChan := make(chan *SendSmsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.SendSms(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// SendSmsWithCallback invokes the dysmsapi.SendSms API asynchronously
+// api document: https://help.aliyun.com/api/dysmsapi/sendsms.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SendSmsWithCallback(request *SendSmsRequest, callback func(response *SendSmsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *SendSmsResponse
+		var err error
+		defer close(result)
+		response, err = client.SendSms(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// SendSmsRequest is the request struct for api SendSms
+type SendSmsRequest struct {
+	*requests.RpcRequest
+	SmsUpExtendCode      string           `position:"Query" name:"SmsUpExtendCode"`
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SignName             string           `position:"Query" name:"SignName"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	PhoneNumbers         string           `position:"Query" name:"PhoneNumbers"`
+	OutId                string           `position:"Query" name:"OutId"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+	TemplateCode         string           `position:"Query" name:"TemplateCode"`
+	TemplateParam        string           `position:"Query" name:"TemplateParam"`
+}
+
+// SendSmsResponse is the response struct for api SendSms
+type SendSmsResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizId     string `json:"BizId" xml:"BizId"`
+	Code      string `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+}
+
+// CreateSendSmsRequest creates a request to invoke SendSms API
+func CreateSendSmsRequest() (request *SendSmsRequest) {
+	request = &SendSmsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Dysmsapi", "2017-05-25", "SendSms", "dysmsapi", "openAPI")
+	return
+}
+
+// CreateSendSmsResponse creates a response to parse from SendSms response
+func CreateSendSmsResponse() (response *SendSmsResponse) {
+	response = &SendSmsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 21 - 0
services/dysmsapi/struct_sms_send_detail_dt_os.go

@@ -0,0 +1,21 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// SmsSendDetailDTOs is a nested struct in dysmsapi response
+type SmsSendDetailDTOs struct {
+	SmsSendDetailDTO []SmsSendDetailDTO `json:"SmsSendDetailDTO" xml:"SmsSendDetailDTO"`
+}

+ 28 - 0
services/dysmsapi/struct_sms_send_detail_dto.go

@@ -0,0 +1,28 @@
+package dysmsapi
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// SmsSendDetailDTO is a nested struct in dysmsapi response
+type SmsSendDetailDTO struct {
+	PhoneNum     string `json:"PhoneNum" xml:"PhoneNum"`
+	SendStatus   int    `json:"SendStatus" xml:"SendStatus"`
+	ErrCode      string `json:"ErrCode" xml:"ErrCode"`
+	TemplateCode string `json:"TemplateCode" xml:"TemplateCode"`
+	Content      string `json:"Content" xml:"Content"`
+	SendDate     string `json:"SendDate" xml:"SendDate"`
+	ReceiveDate  string `json:"ReceiveDate" xml:"ReceiveDate"`
+	OutId        string `json:"OutId" xml:"OutId"`
+}