# coding: utf-8
"""
Fortanix DSM REST API
This is a set of REST APIs for accessing the Fortanix Data Security Manager. This includes APIs for managing accounts, and for performing cryptographic and key management operations.
OpenAPI spec version: 1.0.0-20200608
Contact: support@fortanix.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
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.
"""
from pprint import pformat
from six import iteritems
import re
# NOTE: This class is auto generated by the swagger code generator program.
# Do not edit the class manually.
[docs]class FpeConstraints(object):
"""
Attributes:
swagger_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.
"""
swagger_types = {
'luhn_check': 'bool',
'num_gt': 'int',
'num_lt': 'int',
'num_ne': 'list[int]',
'date': 'object',
'applies_to': 'object'
}
attribute_map = {
'luhn_check': 'luhn_check',
'num_gt': 'num_gt',
'num_lt': 'num_lt',
'num_ne': 'num_ne',
'date': 'date',
'applies_to': 'applies_to'
}
[docs] def __init__(self, luhn_check=None, num_gt=None, num_lt=None, num_ne=None, date=None, applies_to=None):
"""
FpeConstraints - a model defined in Swagger
"""
self._luhn_check = None
self._num_gt = None
self._num_lt = None
self._num_ne = None
self._date = None
self._applies_to = None
if luhn_check is not None:
self.luhn_check = luhn_check
if num_gt is not None:
self.num_gt = num_gt
if num_lt is not None:
self.num_lt = num_lt
if num_ne is not None:
self.num_ne = num_ne
if date is not None:
self.date = date
if applies_to is not None:
self.applies_to = applies_to
@property
def luhn_check(self):
"""
Gets the luhn_check of this FpeConstraints.
Whether the token should satisfy the Luhn checksum. It is an error to apply this constraint to non-numeric parts, or for an encrypted part to be under more than one Luhn check constraint. Also, if an encrypted part has a Luhn check constraint applied to it and may contain at least one digit that is not preserved, it must not specify any other constraints.
Type: `bool`
:setter: Sets the luhn_check of this FpeConstraints.
"""
return self._luhn_check
@luhn_check.setter
def luhn_check(self, luhn_check):
"""
Sets the luhn_check of this FpeConstraints.
Whether the token should satisfy the Luhn checksum. It is an error to apply this constraint to non-numeric parts, or for an encrypted part to be under more than one Luhn check constraint. Also, if an encrypted part has a Luhn check constraint applied to it and may contain at least one digit that is not preserved, it must not specify any other constraints.
"""
self._luhn_check = luhn_check
@property
def num_gt(self):
"""
Gets the num_gt of this FpeConstraints.
Number that the token part should be greater than. This constraint can only be specified on (non-compound) numeric encrypted parts that are guaranteed to preserve either everything or nothing at all.
Type: `int`
:setter: Sets the num_gt of this FpeConstraints.
"""
return self._num_gt
@num_gt.setter
def num_gt(self, num_gt):
"""
Sets the num_gt of this FpeConstraints.
Number that the token part should be greater than. This constraint can only be specified on (non-compound) numeric encrypted parts that are guaranteed to preserve either everything or nothing at all.
"""
self._num_gt = num_gt
@property
def num_lt(self):
"""
Gets the num_lt of this FpeConstraints.
Number that the token part should be smaller than. This constraint can only be specified on (non-compound) numeric encrypted parts that are guaranteed to preserve either everything or nothing at all.
Type: `int`
:setter: Sets the num_lt of this FpeConstraints.
"""
return self._num_lt
@num_lt.setter
def num_lt(self, num_lt):
"""
Sets the num_lt of this FpeConstraints.
Number that the token part should be smaller than. This constraint can only be specified on (non-compound) numeric encrypted parts that are guaranteed to preserve either everything or nothing at all.
"""
self._num_lt = num_lt
@property
def num_ne(self):
"""
Gets the num_ne of this FpeConstraints.
Numbers that the token part should not be equal to. It is an error to apply this constraint to non-numeric parts.
Type: list[`int`]
:setter: Sets the num_ne of this FpeConstraints.
"""
return self._num_ne
@num_ne.setter
def num_ne(self, num_ne):
"""
Sets the num_ne of this FpeConstraints.
Numbers that the token part should not be equal to. It is an error to apply this constraint to non-numeric parts.
"""
self._num_ne = num_ne
@property
def date(self):
"""
Gets the date of this FpeConstraints.
Specifies that this portion is supposed to represent a date, or part of one. If used, no other constraints can be specified on this part. This field should either be an `FpeDate` object or an `FpeDatePart` value.
Type: `object`
:setter: Sets the date of this FpeConstraints.
"""
return self._date
@date.setter
def date(self, date):
"""
Sets the date of this FpeConstraints.
Specifies that this portion is supposed to represent a date, or part of one. If used, no other constraints can be specified on this part. This field should either be an `FpeDate` object or an `FpeDatePart` value.
"""
self._date = date
@property
def applies_to(self):
"""
Gets the applies_to of this FpeConstraints.
The subparts to apply the constraints to. If not specified, the constraints will be applied to all subparts (recursively). (This can also be explictly indicated by specifying the string \"all\"). If only certain subparts are to be specified, then they should be specified as an `FpeConstraintsApplicabilitySubparts` object.
Type: `object`
:setter: Sets the applies_to of this FpeConstraints.
"""
return self._applies_to
@applies_to.setter
def applies_to(self, applies_to):
"""
Sets the applies_to of this FpeConstraints.
The subparts to apply the constraints to. If not specified, the constraints will be applied to all subparts (recursively). (This can also be explictly indicated by specifying the string \"all\"). If only certain subparts are to be specified, then they should be specified as an `FpeConstraintsApplicabilitySubparts` object.
"""
self._applies_to = applies_to
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_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:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FpeConstraints):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other