# 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 FpeEncryptedPart(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 = {
'min_length': 'int',
'max_length': 'int',
'char_set': 'list[list[str]]',
'constraints': 'FpeConstraints',
'preserve': 'list[int]',
'mask': 'object'
}
attribute_map = {
'min_length': 'min_length',
'max_length': 'max_length',
'char_set': 'char_set',
'constraints': 'constraints',
'preserve': 'preserve',
'mask': 'mask'
}
[docs] def __init__(self, min_length=None, max_length=None, char_set=None, constraints=None, preserve=None, mask=None):
"""
FpeEncryptedPart - a model defined in Swagger
"""
self._min_length = None
self._max_length = None
self._char_set = None
self._constraints = None
self._preserve = None
self._mask = None
self.min_length = min_length
self.max_length = max_length
self.char_set = char_set
if constraints is not None:
self.constraints = constraints
if preserve is not None:
self.preserve = preserve
if mask is not None:
self.mask = mask
@property
def min_length(self):
"""
Gets the min_length of this FpeEncryptedPart.
The minimum allowed length for this part (in chars).
Type: `int`
:setter: Sets the min_length of this FpeEncryptedPart.
"""
return self._min_length
@min_length.setter
def min_length(self, min_length):
"""
Sets the min_length of this FpeEncryptedPart.
The minimum allowed length for this part (in chars).
"""
self._min_length = min_length
@property
def max_length(self):
"""
Gets the max_length of this FpeEncryptedPart.
The maximum allowed length for this part (in chars).
Type: `int`
:setter: Sets the max_length of this FpeEncryptedPart.
"""
return self._max_length
@max_length.setter
def max_length(self, max_length):
"""
Sets the max_length of this FpeEncryptedPart.
The maximum allowed length for this part (in chars).
"""
self._max_length = max_length
@property
def char_set(self):
"""
Gets the char_set of this FpeEncryptedPart.
The character set to use for this part. Characters should be specified as a list of pairs, where each pair [a, b] (example: ['0', '9']) represents the range of Unicode codepoints from a to b, with both bounds being inclusive. A single character can be represented as [c, c] (example: ['/', '/']). Ranges should not overlap with each other, and should not contain surrogate codepoints. *Implementation note: normally, each character is assigned a numeric value for FF1, going in the order specified in the array. For instance, in the character set [['a', 'z'], ['0', '9']], the digits from 0 to 9 DO NOT have their usual numeric values; instead, they correspond to the numerals from 26 to 35 (since they come after the 'a' to 'z' range). Note that for practical purposes, this is largely irrelevant, except when specifying a \"numeric\" character set, which MUST contain exactly the digits from 0 to 9, in order. **(When trying to use numeric constraints, it is best to use [[\"0\", \"9\"]] as the character set.)***
Type: list[`list[str]`]
:setter: Sets the char_set of this FpeEncryptedPart.
"""
return self._char_set
@char_set.setter
def char_set(self, char_set):
"""
Sets the char_set of this FpeEncryptedPart.
The character set to use for this part. Characters should be specified as a list of pairs, where each pair [a, b] (example: ['0', '9']) represents the range of Unicode codepoints from a to b, with both bounds being inclusive. A single character can be represented as [c, c] (example: ['/', '/']). Ranges should not overlap with each other, and should not contain surrogate codepoints. *Implementation note: normally, each character is assigned a numeric value for FF1, going in the order specified in the array. For instance, in the character set [['a', 'z'], ['0', '9']], the digits from 0 to 9 DO NOT have their usual numeric values; instead, they correspond to the numerals from 26 to 35 (since they come after the 'a' to 'z' range). Note that for practical purposes, this is largely irrelevant, except when specifying a \"numeric\" character set, which MUST contain exactly the digits from 0 to 9, in order. **(When trying to use numeric constraints, it is best to use [[\"0\", \"9\"]] as the character set.)***
"""
self._char_set = char_set
@property
def constraints(self):
"""
Gets the constraints of this FpeEncryptedPart.
Type: `FpeConstraints`
:setter: Sets the constraints of this FpeEncryptedPart.
"""
return self._constraints
@constraints.setter
def constraints(self, constraints):
"""
Sets the constraints of this FpeEncryptedPart.
"""
self._constraints = constraints
@property
def preserve(self):
"""
Gets the preserve of this FpeEncryptedPart.
The characters to be preserved while encrypting or decrypting. This should either be the string \"all\", or it should be an array of Python-like indices (i.e., where negative indices index from the back of the token portion, with -1 referring to the end of the array). When specifying indices, it is an error to specify indices greater than (min_length - 1) or less than (-min_length).
Type: list[`int`]
:setter: Sets the preserve of this FpeEncryptedPart.
"""
return self._preserve
@preserve.setter
def preserve(self, preserve):
"""
Sets the preserve of this FpeEncryptedPart.
The characters to be preserved while encrypting or decrypting. This should either be the string \"all\", or it should be an array of Python-like indices (i.e., where negative indices index from the back of the token portion, with -1 referring to the end of the array). When specifying indices, it is an error to specify indices greater than (min_length - 1) or less than (-min_length).
"""
self._preserve = preserve
@property
def mask(self):
"""
Gets the mask of this FpeEncryptedPart.
The characters to be masked while performing masked decryption. This should either be the string \"all\", or it should be an array of Python-like indices (i.e., where negative indices index from the back of the token portion, with -1 referring to the end of the array). When specifying indices, it is an error to specify indices greater than (min_length - 1) or less than (-min_length).
Type: `object`
:setter: Sets the mask of this FpeEncryptedPart.
"""
return self._mask
@mask.setter
def mask(self, mask):
"""
Sets the mask of this FpeEncryptedPart.
The characters to be masked while performing masked decryption. This should either be the string \"all\", or it should be an array of Python-like indices (i.e., where negative indices index from the back of the token portion, with -1 referring to the end of the array). When specifying indices, it is an error to specify indices greater than (min_length - 1) or less than (-min_length).
"""
self._mask = mask
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, FpeEncryptedPart):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other