Exemple #1
0
        public void CreatePolicyGroupTest()
        {
            var entity   = new CreatePolicyGroupRequest(Config.region);
            var response = ulb.CreatePolicyGroup(entity);

            Assert.AreEqual(response.RetCode, 0);
        }
Exemple #2
0
        /// <summary>
        /// 创建内容转发策略组
        /// </summary>
        /// <param name="requestParams">请求参数.</param>
        /// <returns>返回对象<see cref="UCloudSDK.Models.CreatePolicyGroupResponse"/></returns>
        public CreatePolicyGroupResponse CreatePolicyGroup(CreatePolicyGroupRequest requestParams)
        {
            var request = new RestRequest(Method.GET);

            request.AddUObject(requestParams);
            return(Execute <CreatePolicyGroupResponse>(request));
        }
        /// <summary>
        /// CreatePolicyGroup接口的同步版本,增加策略组
        /// </summary>
        /// <param name="req">参考<see cref="CreatePolicyGroupRequest"/></param>
        /// <returns>参考<see cref="CreatePolicyGroupResponse"/>实例</returns>
        public CreatePolicyGroupResponse CreatePolicyGroupSync(CreatePolicyGroupRequest req)
        {
            JsonResponseModel <CreatePolicyGroupResponse> rsp = null;

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