# 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
from .base_enum_object import BaseEnumObject
# NOTE: This class is auto generated by the swagger code generator program.
# Do not edit the class manually.
[docs]class DigestAlgorithm(BaseEnumObject):
"""
Message digest algorithm.
Enumeration values::
DigestAlgorithm.BLAKE2B256 = "Blake2b256"
DigestAlgorithm.BLAKE2B384 = "Blake2b384"
DigestAlgorithm.BLAKE2B512 = "Blake2b512"
DigestAlgorithm.BLAKE2S256 = "Blake2s256"
DigestAlgorithm.RIPEMD160 = "RIPEMD160"
DigestAlgorithm.SHA1 = "SHA1"
DigestAlgorithm.SHA256 = "SHA256"
DigestAlgorithm.SHA384 = "SHA384"
DigestAlgorithm.SHA512 = "SHA512"
DigestAlgorithm.SHA3_224 = "SHA3_224"
DigestAlgorithm.SHA3_256 = "SHA3_256"
DigestAlgorithm.SHA3_384 = "SHA3_384"
DigestAlgorithm.SHA3_512 = "SHA3_512"
DigestAlgorithm.SSL3 = "Ssl3"
DigestAlgorithm.STREEBOG256 = "Streebog256"
DigestAlgorithm.STREEBOG512 = "Streebog512"
This class doesnt use python standard enumeration since they dont support unknown values.
This is an object of type BaseEnumObject and provides similar functionality as a String Enumeration::
Get a standard instance of enum: DigestAlgorithm.FOO or DigestAlgorithm("FOO")
Get non standard instance of enum: DigestAlgorithm("BAR")
Enum instance to String value: DigestAlgorithm.FOO.value , DigestAlgorithm.FOO.name (Gives "FOO")
Equality: DigestAlgorithm.FOO == DigestAlgorithm("FOO") , DigestAlgorithm.FOO != DigestAlgorithm.BAR
Provides str func: str(DigestAlgorithm.FOO) == "DigestAlgorithm.FOO"
Also the class maintains a static dict of values. hence DigestAlgorithm.FOO and DigestAlgorithm("FOO") are really backed by same data.
"""
"""
Inner class that stores the actual value
"""
class __DigestAlgorithm(BaseEnumObject):
def __init__(self, value):
self.__value = value
@property
def value(self):
return self.__value
@property
def name(self):
return self.__value
def __str__(self):
return "DigestAlgorithm." + self.__value
"""
allowed enum values
"""
BLAKE2B256 = __DigestAlgorithm("Blake2b256")
BLAKE2B384 = __DigestAlgorithm("Blake2b384")
BLAKE2B512 = __DigestAlgorithm("Blake2b512")
BLAKE2S256 = __DigestAlgorithm("Blake2s256")
RIPEMD160 = __DigestAlgorithm("RIPEMD160")
SHA1 = __DigestAlgorithm("SHA1")
SHA256 = __DigestAlgorithm("SHA256")
SHA384 = __DigestAlgorithm("SHA384")
SHA512 = __DigestAlgorithm("SHA512")
SHA3_224 = __DigestAlgorithm("SHA3_224")
SHA3_256 = __DigestAlgorithm("SHA3_256")
SHA3_384 = __DigestAlgorithm("SHA3_384")
SHA3_512 = __DigestAlgorithm("SHA3_512")
SSL3 = __DigestAlgorithm("Ssl3")
STREEBOG256 = __DigestAlgorithm("Streebog256")
STREEBOG512 = __DigestAlgorithm("Streebog512")
"""
dictionary that keeps the enum value mapping for static access
"""
__VALUES = dict()
__VALUES["Blake2b256"] = BLAKE2B256
__VALUES["Blake2b384"] = BLAKE2B384
__VALUES["Blake2b512"] = BLAKE2B512
__VALUES["Blake2s256"] = BLAKE2S256
__VALUES["RIPEMD160"] = RIPEMD160
__VALUES["SHA1"] = SHA1
__VALUES["SHA256"] = SHA256
__VALUES["SHA384"] = SHA384
__VALUES["SHA512"] = SHA512
__VALUES["SHA3_224"] = SHA3_224
__VALUES["SHA3_256"] = SHA3_256
__VALUES["SHA3_384"] = SHA3_384
__VALUES["SHA3_512"] = SHA3_512
__VALUES["Ssl3"] = SSL3
__VALUES["Streebog256"] = STREEBOG256
__VALUES["Streebog512"] = STREEBOG512
[docs] def __init__(self, name):
if name in DigestAlgorithm.__VALUES:
self.__instance = DigestAlgorithm.__VALUES[name]
else:
new_value = DigestAlgorithm.__DigestAlgorithm(name)
DigestAlgorithm.__VALUES[name] = new_value
self.__instance = new_value
@property
def value(self):
return self.__instance.value
@property
def name(self):
return self.__instance.name
def __str__(self):
return "DigestAlgorithm." + self.__instance.name
"""
This is to ensure equals work for both static defined values and client defined ones.
"""
def __eq__(self, other):
if (isinstance(self, DigestAlgorithm) or isinstance(self, DigestAlgorithm.__DigestAlgorithm)) and \
(isinstance(other, DigestAlgorithm) or isinstance(other, DigestAlgorithm.__DigestAlgorithm)):
return self.value == other.value
return False
def __ne__(self, other):
if (isinstance(self, DigestAlgorithm) or isinstance(self, DigestAlgorithm.__DigestAlgorithm)) and \
(isinstance(other, DigestAlgorithm) or isinstance(other, DigestAlgorithm.__DigestAlgorithm)):
return self.value != other.value
return True