huaweicloud-sdk-python-v3/huaweicloud-sdk-rms/huaweicloudsdkrms/v1/model/update_policy_assignment_re...

457 lines
14 KiB
Python
Raw Normal View History

# coding: utf-8
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
2021-07-26 11:24:08 +00:00
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UpdatePolicyAssignmentResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
sensitive_list = []
openapi_types = {
2022-11-30 08:59:35 +00:00
'policy_assignment_type': 'str',
'id': 'str',
'name': 'str',
'description': 'str',
'policy_filter': 'PolicyFilterDefinition',
2022-09-08 11:22:27 +00:00
'period': 'str',
'state': 'str',
'created': 'str',
'updated': 'str',
'policy_definition_id': 'str',
2022-11-30 08:59:35 +00:00
'custom_policy': 'CustomPolicy',
2023-05-25 08:51:28 +00:00
'parameters': 'dict(str, PolicyParameterValue)',
'created_by': 'str'
}
attribute_map = {
2022-11-30 08:59:35 +00:00
'policy_assignment_type': 'policy_assignment_type',
'id': 'id',
'name': 'name',
'description': 'description',
'policy_filter': 'policy_filter',
2022-09-08 11:22:27 +00:00
'period': 'period',
'state': 'state',
'created': 'created',
'updated': 'updated',
'policy_definition_id': 'policy_definition_id',
2022-11-30 08:59:35 +00:00
'custom_policy': 'custom_policy',
2023-05-25 08:51:28 +00:00
'parameters': 'parameters',
'created_by': 'created_by'
}
2023-05-25 08:51:28 +00:00
def __init__(self, policy_assignment_type=None, id=None, name=None, description=None, policy_filter=None, period=None, state=None, created=None, updated=None, policy_definition_id=None, custom_policy=None, parameters=None, created_by=None):
2022-04-21 12:03:46 +00:00
"""UpdatePolicyAssignmentResponse
The model defined in huaweicloud sdk
2022-11-30 08:59:35 +00:00
:param policy_assignment_type: 规则类型包括预定义合规规则(builtin)和用户自定义合规规则(custom)
:type policy_assignment_type: str
2022-04-21 12:03:46 +00:00
:param id: 规则ID
:type id: str
:param name: 规则名字
:type name: str
:param description: 规则描述
:type description: str
:param policy_filter:
:type policy_filter: :class:`huaweicloudsdkrms.v1.PolicyFilterDefinition`
2022-09-08 11:22:27 +00:00
:param period: 触发周期值可选值One_Hour, Three_Hours, Six_Hours, Twelve_Hours, TwentyFour_Hours
:type period: str
2022-04-21 12:03:46 +00:00
:param state: 规则状态
:type state: str
:param created: 规则创建时间
:type created: str
:param updated: 规则更新时间
:type updated: str
:param policy_definition_id: 规则的策略ID
:type policy_definition_id: str
2022-11-30 08:59:35 +00:00
:param custom_policy:
:type custom_policy: :class:`huaweicloudsdkrms.v1.CustomPolicy`
2022-04-21 12:03:46 +00:00
:param parameters: 规则参数
:type parameters: dict(str, PolicyParameterValue)
2023-05-25 08:51:28 +00:00
:param created_by: 规则的创建者
:type created_by: str
2022-04-21 12:03:46 +00:00
"""
super(UpdatePolicyAssignmentResponse, self).__init__()
2022-11-30 08:59:35 +00:00
self._policy_assignment_type = None
self._id = None
self._name = None
self._description = None
self._policy_filter = None
2022-09-08 11:22:27 +00:00
self._period = None
self._state = None
self._created = None
self._updated = None
self._policy_definition_id = None
2022-11-30 08:59:35 +00:00
self._custom_policy = None
self._parameters = None
2023-05-25 08:51:28 +00:00
self._created_by = None
self.discriminator = None
2022-11-30 08:59:35 +00:00
if policy_assignment_type is not None:
self.policy_assignment_type = policy_assignment_type
if id is not None:
self.id = id
if name is not None:
self.name = name
if description is not None:
self.description = description
if policy_filter is not None:
self.policy_filter = policy_filter
2022-09-08 11:22:27 +00:00
if period is not None:
self.period = period
if state is not None:
self.state = state
if created is not None:
self.created = created
if updated is not None:
self.updated = updated
if policy_definition_id is not None:
self.policy_definition_id = policy_definition_id
2022-11-30 08:59:35 +00:00
if custom_policy is not None:
self.custom_policy = custom_policy
if parameters is not None:
self.parameters = parameters
2023-05-25 08:51:28 +00:00
if created_by is not None:
self.created_by = created_by
2022-11-30 08:59:35 +00:00
@property
def policy_assignment_type(self):
"""Gets the policy_assignment_type of this UpdatePolicyAssignmentResponse.
规则类型包括预定义合规规则(builtin)和用户自定义合规规则(custom)
:return: The policy_assignment_type of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._policy_assignment_type
@policy_assignment_type.setter
def policy_assignment_type(self, policy_assignment_type):
"""Sets the policy_assignment_type of this UpdatePolicyAssignmentResponse.
规则类型包括预定义合规规则(builtin)和用户自定义合规规则(custom)
:param policy_assignment_type: The policy_assignment_type of this UpdatePolicyAssignmentResponse.
:type policy_assignment_type: str
"""
self._policy_assignment_type = policy_assignment_type
@property
def id(self):
"""Gets the id of this UpdatePolicyAssignmentResponse.
规则ID
:return: The id of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this UpdatePolicyAssignmentResponse.
规则ID
:param id: The id of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type id: str
"""
self._id = id
@property
def name(self):
"""Gets the name of this UpdatePolicyAssignmentResponse.
规则名字
:return: The name of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this UpdatePolicyAssignmentResponse.
规则名字
:param name: The name of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type name: str
"""
self._name = name
@property
def description(self):
"""Gets the description of this UpdatePolicyAssignmentResponse.
规则描述
:return: The description of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this UpdatePolicyAssignmentResponse.
规则描述
:param description: The description of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type description: str
"""
self._description = description
@property
def policy_filter(self):
"""Gets the policy_filter of this UpdatePolicyAssignmentResponse.
:return: The policy_filter of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:rtype: :class:`huaweicloudsdkrms.v1.PolicyFilterDefinition`
"""
return self._policy_filter
@policy_filter.setter
def policy_filter(self, policy_filter):
"""Sets the policy_filter of this UpdatePolicyAssignmentResponse.
:param policy_filter: The policy_filter of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type policy_filter: :class:`huaweicloudsdkrms.v1.PolicyFilterDefinition`
"""
self._policy_filter = policy_filter
2022-09-08 11:22:27 +00:00
@property
def period(self):
"""Gets the period of this UpdatePolicyAssignmentResponse.
触发周期值可选值One_Hour, Three_Hours, Six_Hours, Twelve_Hours, TwentyFour_Hours
:return: The period of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._period
@period.setter
def period(self, period):
"""Sets the period of this UpdatePolicyAssignmentResponse.
触发周期值可选值One_Hour, Three_Hours, Six_Hours, Twelve_Hours, TwentyFour_Hours
:param period: The period of this UpdatePolicyAssignmentResponse.
:type period: str
"""
self._period = period
@property
def state(self):
"""Gets the state of this UpdatePolicyAssignmentResponse.
规则状态
:return: The state of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this UpdatePolicyAssignmentResponse.
规则状态
:param state: The state of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type state: str
"""
self._state = state
@property
def created(self):
"""Gets the created of this UpdatePolicyAssignmentResponse.
规则创建时间
:return: The created of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._created
@created.setter
def created(self, created):
"""Sets the created of this UpdatePolicyAssignmentResponse.
规则创建时间
:param created: The created of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type created: str
"""
self._created = created
@property
def updated(self):
"""Gets the updated of this UpdatePolicyAssignmentResponse.
规则更新时间
:return: The updated of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._updated
@updated.setter
def updated(self, updated):
"""Sets the updated of this UpdatePolicyAssignmentResponse.
规则更新时间
:param updated: The updated of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type updated: str
"""
self._updated = updated
@property
def policy_definition_id(self):
"""Gets the policy_definition_id of this UpdatePolicyAssignmentResponse.
规则的策略ID
:return: The policy_definition_id of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._policy_definition_id
@policy_definition_id.setter
def policy_definition_id(self, policy_definition_id):
"""Sets the policy_definition_id of this UpdatePolicyAssignmentResponse.
规则的策略ID
:param policy_definition_id: The policy_definition_id of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type policy_definition_id: str
"""
self._policy_definition_id = policy_definition_id
2022-11-30 08:59:35 +00:00
@property
def custom_policy(self):
"""Gets the custom_policy of this UpdatePolicyAssignmentResponse.
:return: The custom_policy of this UpdatePolicyAssignmentResponse.
:rtype: :class:`huaweicloudsdkrms.v1.CustomPolicy`
"""
return self._custom_policy
@custom_policy.setter
def custom_policy(self, custom_policy):
"""Sets the custom_policy of this UpdatePolicyAssignmentResponse.
:param custom_policy: The custom_policy of this UpdatePolicyAssignmentResponse.
:type custom_policy: :class:`huaweicloudsdkrms.v1.CustomPolicy`
"""
self._custom_policy = custom_policy
@property
def parameters(self):
"""Gets the parameters of this UpdatePolicyAssignmentResponse.
规则参数
:return: The parameters of this UpdatePolicyAssignmentResponse.
:rtype: dict(str, PolicyParameterValue)
"""
return self._parameters
@parameters.setter
def parameters(self, parameters):
"""Sets the parameters of this UpdatePolicyAssignmentResponse.
规则参数
:param parameters: The parameters of this UpdatePolicyAssignmentResponse.
2022-04-21 12:03:46 +00:00
:type parameters: dict(str, PolicyParameterValue)
"""
self._parameters = parameters
2023-05-25 08:51:28 +00:00
@property
def created_by(self):
"""Gets the created_by of this UpdatePolicyAssignmentResponse.
规则的创建者
:return: The created_by of this UpdatePolicyAssignmentResponse.
:rtype: str
"""
return self._created_by
@created_by.setter
def created_by(self, created_by):
"""Sets the created_by of this UpdatePolicyAssignmentResponse.
规则的创建者
:param created_by: The created_by of this UpdatePolicyAssignmentResponse.
:type created_by: str
"""
self._created_by = created_by
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
if attr in self.sensitive_list:
result[attr] = "****"
else:
result[attr] = value
return result
def to_str(self):
2021-08-10 12:26:18 +00:00
"""Returns the string representation of the model"""
2021-07-09 10:57:08 +00:00
import simplejson as json
2021-08-10 12:26:18 +00:00
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
2021-08-10 12:26:18 +00:00
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, UpdatePolicyAssignmentResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other