text: # -*- coding: utf8 -*-
  # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
  #
  # 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.
  
  import json
  
  from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
  from tencentcloud.common.abstract_client import AbstractClient
  from tencentcloud.redis.v20180412 import models
  
  
  class RedisClient(AbstractClient):
      _apiVersion = '2018-04-12'
      _endpoint = 'redis.tencentcloudapi.com'
  
  
      def CleanUpInstance(self, request):
          """回收站实例立即下线
  
          :param request: 调用CleanUpInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.CleanUpInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.CleanUpInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CleanUpInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CleanUpInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ClearInstance(self, request):
          """清空Redis实例的实例数据。
  
          :param request: 调用ClearInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ClearInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ClearInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ClearInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ClearInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateInstances(self, request):
          """创建redis实例
  
          :param request: 调用CreateInstances所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.CreateInstancesRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.CreateInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeAutoBackupConfig(self, request):
          """获取备份配置
  
          :param request: 调用DescribeAutoBackupConfig所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeAutoBackupConfigRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeAutoBackupConfigResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeAutoBackupConfig", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeAutoBackupConfigResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeBackupUrl(self, request):
          """查询备份Rdb下载地址
  
          :param request: 调用DescribeBackupUrl所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeBackupUrlRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeBackupUrlResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeBackupUrl", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeBackupUrlResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceBackups(self, request):
          """查询 CRS 实例备份列表
  
          :param request: 调用DescribeInstanceBackups所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceBackupsRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceBackupsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceBackups", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceBackupsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceDealDetail(self, request):
          """查询订单信息
  
          :param request: 调用DescribeInstanceDealDetail所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceDealDetailRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceDealDetailResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceDealDetail", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceDealDetailResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceParamRecords(self, request):
          """查询参数修改历史列表
  
          :param request: 调用DescribeInstanceParamRecords所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceParamRecordsRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceParamRecordsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceParamRecords", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceParamRecordsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceParams(self, request):
          """查询实例参数列表
  
          :param request: 调用DescribeInstanceParams所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceParamsRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceParamsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceParams", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceParamsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceSecurityGroup(self, request):
          """查询实例安全组信息
  
          :param request: 调用DescribeInstanceSecurityGroup所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceSecurityGroupRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceSecurityGroupResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceSecurityGroup", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceSecurityGroupResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstanceShards(self, request):
          """获取集群版实例分片信息
  
          :param request: 调用DescribeInstanceShards所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceShardsRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstanceShardsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstanceShards", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstanceShardsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeInstances(self, request):
          """查询Redis实例列表
  
          :param request: 调用DescribeInstances所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeInstancesRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeProductInfo(self, request):
          """本接口查询指定可用区和实例类型下 Redis 的售卖规格， 如果用户不在购买白名单中，将不能查询该可用区或该类型的售卖规格详情。申请购买某地域白名单可以提交工单
  
          :param request: 调用DescribeProductInfo所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeProductInfoRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeProductInfoResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeProductInfo", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeProductInfoResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeProjectSecurityGroup(self, request):
          """查询项目安全组信息
  
          :param request: 调用DescribeProjectSecurityGroup所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeProjectSecurityGroupRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeProjectSecurityGroupResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeProjectSecurityGroup", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeProjectSecurityGroupResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeTaskInfo(self, request):
          """用于查询任务结果
  
          :param request: 调用DescribeTaskInfo所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DescribeTaskInfoRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DescribeTaskInfoResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeTaskInfo", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeTaskInfoResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DestroyPostpaidInstance(self, request):
          """按量计费实例销毁
  
          :param request: 调用DestroyPostpaidInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DestroyPostpaidInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DestroyPostpaidInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DestroyPostpaidInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DestroyPostpaidInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DestroyPrepaidInstance(self, request):
          """包年包月实例退还
  
          :param request: 调用DestroyPrepaidInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DestroyPrepaidInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DestroyPrepaidInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DestroyPrepaidInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DestroyPrepaidInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DisableReplicaReadonly(self, request):
          """禁用读写分离
  
          :param request: 调用DisableReplicaReadonly所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.DisableReplicaReadonlyRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.DisableReplicaReadonlyResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DisableReplicaReadonly", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DisableReplicaReadonlyResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def EnableReplicaReadonly(self, request):
          """启用读写分离
  
          :param request: 调用EnableReplicaReadonly所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.EnableReplicaReadonlyRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.EnableReplicaReadonlyResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("EnableReplicaReadonly", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.EnableReplicaReadonlyResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ManualBackupInstance(self, request):
          """手动备份Redis实例
  
          :param request: 调用ManualBackupInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ManualBackupInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ManualBackupInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ManualBackupInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ManualBackupInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModfiyInstancePassword(self, request):
          """修改redis密码
  
          :param request: 调用ModfiyInstancePassword所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ModfiyInstancePasswordRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ModfiyInstancePasswordResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModfiyInstancePassword", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModfiyInstancePasswordResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyAutoBackupConfig(self, request):
          """设置自动备份时间
  
          :param request: 调用ModifyAutoBackupConfig所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ModifyAutoBackupConfigRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ModifyAutoBackupConfigResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyAutoBackupConfig", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyAutoBackupConfigResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyInstance(self, request):
          """修改实例相关信息（目前支持：实例重命名）
  
          :param request: 调用ModifyInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ModifyInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ModifyInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyInstanceParams(self, request):
          """修改实例参数
  
          :param request: 调用ModifyInstanceParams所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ModifyInstanceParamsRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ModifyInstanceParamsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyInstanceParams", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyInstanceParamsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyNetworkConfig(self, request):
          """修改实例网络配置
  
          :param request: 调用ModifyNetworkConfig所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ModifyNetworkConfigRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ModifyNetworkConfigResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyNetworkConfig", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyNetworkConfigResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def RenewInstance(self, request):
          """续费实例
  
          :param request: 调用RenewInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.RenewInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.RenewInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("RenewInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.RenewInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ResetPassword(self, request):
          """重置密码
  
          :param request: 调用ResetPassword所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.ResetPasswordRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.ResetPasswordResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ResetPassword", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ResetPasswordResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def RestoreInstance(self, request):
          """恢复 CRS 实例
  
          :param request: 调用RestoreInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.RestoreInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.RestoreInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("RestoreInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.RestoreInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def UpgradeInstance(self, request):
          """升级实例
  
          :param request: 调用UpgradeInstance所需参数的结构体。
          :type request: :class:`tencentcloud.redis.v20180412.models.UpgradeInstanceRequest`
          :rtype: :class:`tencentcloud.redis.v20180412.models.UpgradeInstanceResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("UpgradeInstance", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.UpgradeInstanceResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)