Exemplo n.º 1
0
        public HttpResponseMessage CancelCampaign(int campaignId)
        {
            CancelCampaignRequest request = new CancelCampaignRequest(campaignId)
            {
                RequestedBy = this.UserId,
                AccountId   = this.AccountId,
                RoleId      = this.RoleId
            };
            CancelCampaignResponse response = campaignService.CancelCampaign(request);

            return(Request.BuildResponse(response));
        }
        /// <summary>
        /// 取消短信推送活动
        /// </summary>
        /// <param name="req"><see cref="CancelCampaignRequest"/></param>
        /// <returns><see cref="CancelCampaignResponse"/></returns>
        public CancelCampaignResponse CancelCampaignSync(CancelCampaignRequest req)
        {
            JsonResponseModel <CancelCampaignResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "CancelCampaign");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <CancelCampaignResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }