2020-07-15 09:30:15 +00:00
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
2021-07-26 11:24:08 +00:00
|
|
|
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
class Compliance:
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
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 = {
|
2023-05-11 09:07:48 +00:00
|
|
|
'compliance_state': 'str',
|
|
|
|
'resource_details': 'PolicyComplianceSummaryUnit'
|
2020-07-15 09:30:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
attribute_map = {
|
2023-05-11 09:07:48 +00:00
|
|
|
'compliance_state': 'compliance_state',
|
|
|
|
'resource_details': 'resource_details'
|
2020-07-15 09:30:15 +00:00
|
|
|
}
|
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
def __init__(self, compliance_state=None, resource_details=None):
|
|
|
|
"""Compliance
|
2022-04-21 12:03:46 +00:00
|
|
|
|
|
|
|
The model defined in huaweicloud sdk
|
|
|
|
|
2023-05-25 08:51:28 +00:00
|
|
|
:param compliance_state: 合规结果。
|
2023-05-11 09:07:48 +00:00
|
|
|
:type compliance_state: str
|
|
|
|
:param resource_details:
|
|
|
|
:type resource_details: :class:`huaweicloudsdkrms.v1.PolicyComplianceSummaryUnit`
|
2022-04-21 12:03:46 +00:00
|
|
|
"""
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
self._compliance_state = None
|
|
|
|
self._resource_details = None
|
2020-07-15 09:30:15 +00:00
|
|
|
self.discriminator = None
|
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
if compliance_state is not None:
|
|
|
|
self.compliance_state = compliance_state
|
|
|
|
if resource_details is not None:
|
|
|
|
self.resource_details = resource_details
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
@property
|
2023-05-11 09:07:48 +00:00
|
|
|
def compliance_state(self):
|
|
|
|
"""Gets the compliance_state of this Compliance.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-25 08:51:28 +00:00
|
|
|
合规结果。
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
:return: The compliance_state of this Compliance.
|
2020-07-15 09:30:15 +00:00
|
|
|
:rtype: str
|
|
|
|
"""
|
2023-05-11 09:07:48 +00:00
|
|
|
return self._compliance_state
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
@compliance_state.setter
|
|
|
|
def compliance_state(self, compliance_state):
|
|
|
|
"""Sets the compliance_state of this Compliance.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-25 08:51:28 +00:00
|
|
|
合规结果。
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
:param compliance_state: The compliance_state of this Compliance.
|
|
|
|
:type compliance_state: str
|
2020-07-15 09:30:15 +00:00
|
|
|
"""
|
2023-05-11 09:07:48 +00:00
|
|
|
self._compliance_state = compliance_state
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
@property
|
2023-05-11 09:07:48 +00:00
|
|
|
def resource_details(self):
|
|
|
|
"""Gets the resource_details of this Compliance.
|
2020-07-15 09:30:15 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
:return: The resource_details of this Compliance.
|
|
|
|
:rtype: :class:`huaweicloudsdkrms.v1.PolicyComplianceSummaryUnit`
|
2020-07-15 09:30:15 +00:00
|
|
|
"""
|
2023-05-11 09:07:48 +00:00
|
|
|
return self._resource_details
|
2020-10-31 09:07:36 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
@resource_details.setter
|
|
|
|
def resource_details(self, resource_details):
|
|
|
|
"""Sets the resource_details of this Compliance.
|
2020-10-31 09:07:36 +00:00
|
|
|
|
2023-05-11 09:07:48 +00:00
|
|
|
:param resource_details: The resource_details of this Compliance.
|
|
|
|
:type resource_details: :class:`huaweicloudsdkrms.v1.PolicyComplianceSummaryUnit`
|
2020-10-31 09:07:36 +00:00
|
|
|
"""
|
2023-05-11 09:07:48 +00:00
|
|
|
self._resource_details = resource_details
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
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)
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
def __repr__(self):
|
2021-08-10 12:26:18 +00:00
|
|
|
"""For `print`"""
|
2020-07-15 09:30:15 +00:00
|
|
|
return self.to_str()
|
|
|
|
|
|
|
|
def __eq__(self, other):
|
|
|
|
"""Returns true if both objects are equal"""
|
2023-05-11 09:07:48 +00:00
|
|
|
if not isinstance(other, Compliance):
|
2020-07-15 09:30:15 +00:00
|
|
|
return False
|
|
|
|
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
|
|
|
|
def __ne__(self, other):
|
|
|
|
"""Returns true if both objects are not equal"""
|
|
|
|
return not self == other
|