| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- package push
- //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"
- )
- func (client *Client) Push(request *PushRequest) (response *PushResponse, err error) {
- response = CreatePushResponse()
- err = client.DoAction(request, response)
- return
- }
- func (client *Client) PushWithChan(request *PushRequest) (<-chan *PushResponse, <-chan error) {
- responseChan := make(chan *PushResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.Push(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
- }
- func (client *Client) PushWithCallback(request *PushRequest, callback func(response *PushResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *PushResponse
- var err error
- defer close(result)
- response, err = client.Push(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
- }
- type PushRequest struct {
- *requests.RpcRequest
- AndroidNotificationBarType requests.Integer `position:"Query" name:"AndroidNotificationBarType"`
- SmsSendPolicy requests.Integer `position:"Query" name:"SmsSendPolicy"`
- AndroidExtParameters string `position:"Query" name:"AndroidExtParameters"`
- IOSBadge requests.Integer `position:"Query" name:"iOSBadge"`
- IOSBadgeAutoIncrement requests.Boolean `position:"Query" name:"iOSBadgeAutoIncrement"`
- AndroidOpenType string `position:"Query" name:"AndroidOpenType"`
- Title string `position:"Query" name:"Title"`
- Body string `position:"Query" name:"Body"`
- DeviceType string `position:"Query" name:"DeviceType"`
- PushTime string `position:"Query" name:"PushTime"`
- SmsDelaySecs requests.Integer `position:"Query" name:"SmsDelaySecs"`
- SendSpeed requests.Integer `position:"Query" name:"SendSpeed"`
- AndroidPopupActivity string `position:"Query" name:"AndroidPopupActivity"`
- IOSRemindBody string `position:"Query" name:"iOSRemindBody"`
- BatchNumber string `position:"Query" name:"BatchNumber"`
- IOSExtParameters string `position:"Query" name:"iOSExtParameters"`
- AndroidNotifyType string `position:"Query" name:"AndroidNotifyType"`
- AndroidPopupTitle string `position:"Query" name:"AndroidPopupTitle"`
- IOSMusic string `position:"Query" name:"iOSMusic"`
- IOSApnsEnv string `position:"Query" name:"iOSApnsEnv"`
- IOSMutableContent requests.Boolean `position:"Query" name:"iOSMutableContent"`
- AndroidNotificationBarPriority requests.Integer `position:"Query" name:"AndroidNotificationBarPriority"`
- ExpireTime string `position:"Query" name:"ExpireTime"`
- SmsTemplateName string `position:"Query" name:"SmsTemplateName"`
- AndroidPopupBody string `position:"Query" name:"AndroidPopupBody"`
- IOSNotificationCategory string `position:"Query" name:"iOSNotificationCategory"`
- StoreOffline requests.Boolean `position:"Query" name:"StoreOffline"`
- IOSSilentNotification requests.Boolean `position:"Query" name:"iOSSilentNotification"`
- SmsParams string `position:"Query" name:"SmsParams"`
- JobKey string `position:"Query" name:"JobKey"`
- Target string `position:"Query" name:"Target"`
- AndroidOpenUrl string `position:"Query" name:"AndroidOpenUrl"`
- AndroidNotificationChannel string `position:"Query" name:"AndroidNotificationChannel"`
- AndroidRemind requests.Boolean `position:"Query" name:"AndroidRemind"`
- AndroidActivity string `position:"Query" name:"AndroidActivity"`
- AndroidXiaoMiNotifyBody string `position:"Query" name:"AndroidXiaoMiNotifyBody"`
- IOSSubtitle string `position:"Query" name:"iOSSubtitle"`
- SmsSignName string `position:"Query" name:"SmsSignName"`
- IOSRemind requests.Boolean `position:"Query" name:"iOSRemind"`
- AppKey requests.Integer `position:"Query" name:"AppKey"`
- TargetValue string `position:"Query" name:"TargetValue"`
- AndroidMusic string `position:"Query" name:"AndroidMusic"`
- AndroidXiaoMiActivity string `position:"Query" name:"AndroidXiaoMiActivity"`
- AndroidXiaoMiNotifyTitle string `position:"Query" name:"AndroidXiaoMiNotifyTitle"`
- PushType string `position:"Query" name:"PushType"`
- }
- type PushResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- MessageId string `json:"MessageId" xml:"MessageId"`
- }
- func CreatePushRequest() (request *PushRequest) {
- request = &PushRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Push", "2016-08-01", "Push", "", "")
- return
- }
- func CreatePushResponse() (response *PushResponse) {
- response = &PushResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
- }
|