Source code for sdkms.v1.models.sobject_request

# 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 SobjectRequest(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 = { 'name': 'str', 'description': 'str', 'key_size': 'int', 'pub_exponent': 'int', 'elliptic_curve': 'EllipticCurve', 'rsa': 'RsaOptions', 'dsa': 'DsaOptions', 'fpe': 'FpeOptions', 'group_id': 'str', 'rotation_policy': 'RotationPolicy', 'obj_type': 'ObjectType', 'key_ops': 'list[KeyOperations]', 'custom_metadata': 'dict(str, str)', 'value': 'bytearray', 'enabled': 'bool', 'transient': 'bool', 'deterministic_signatures': 'bool', 'state': 'KeyObjectState', 'activation_date': 'str', 'bls': 'BlsOptions', 'deactivation_date': 'str' } attribute_map = { 'name': 'name', 'description': 'description', 'key_size': 'key_size', 'pub_exponent': 'pub_exponent', 'elliptic_curve': 'elliptic_curve', 'rsa': 'rsa', 'dsa': 'dsa', 'fpe': 'fpe', 'group_id': 'group_id', 'rotation_policy': 'rotation_policy', 'obj_type': 'obj_type', 'key_ops': 'key_ops', 'custom_metadata': 'custom_metadata', 'value': 'value', 'enabled': 'enabled', 'transient': 'transient', 'deterministic_signatures': 'deterministic_signatures', 'state': 'state', 'activation_date': 'activation_date', 'bls': 'bls', 'deactivation_date': 'deactivation_date' }
[docs] def __init__(self, name=None, description=None, key_size=None, pub_exponent=None, elliptic_curve=None, rsa=None, dsa=None, fpe=None, group_id=None, rotation_policy=None, obj_type=None, key_ops=None, custom_metadata=None, value=None, enabled=None, transient=None, deterministic_signatures=None, state=None, activation_date=None, bls=None, deactivation_date=None): """ SobjectRequest - a model defined in Swagger """ self._name = None self._description = None self._key_size = None self._pub_exponent = None self._elliptic_curve = None self._rsa = None self._dsa = None self._fpe = None self._group_id = None self._rotation_policy = None self._obj_type = None self._key_ops = None self._custom_metadata = None self._value = None self._enabled = None self._transient = None self._deterministic_signatures = None self._state = None self._activation_date = None self._bls = None self._deactivation_date = None self.name = name if description is not None: self.description = description if key_size is not None: self.key_size = key_size if pub_exponent is not None: self.pub_exponent = pub_exponent if elliptic_curve is not None: self.elliptic_curve = elliptic_curve if rsa is not None: self.rsa = rsa if dsa is not None: self.dsa = dsa if fpe is not None: self.fpe = fpe if group_id is not None: self.group_id = group_id if rotation_policy is not None: self.rotation_policy = rotation_policy self.obj_type = obj_type if key_ops is not None: self.key_ops = key_ops if custom_metadata is not None: self.custom_metadata = custom_metadata if value is not None: self.value = value if enabled is not None: self.enabled = enabled if transient is not None: self.transient = transient if deterministic_signatures is not None: self.deterministic_signatures = deterministic_signatures if state is not None: self.state = state if activation_date is not None: self.activation_date = activation_date if bls is not None: self.bls = bls if deactivation_date is not None: self.deactivation_date = deactivation_date
@property def name(self): """ Gets the name of this SobjectRequest. Name of the security object to create or import. Security object names must be unique within an account. Type: `str` :setter: Sets the name of this SobjectRequest. """ return self._name @name.setter def name(self, name): """ Sets the name of this SobjectRequest. Name of the security object to create or import. Security object names must be unique within an account. """ self._name = name @property def description(self): """ Gets the description of this SobjectRequest. Description of the security object to create or import. Type: `str` :setter: Sets the description of this SobjectRequest. """ return self._description @description.setter def description(self, description): """ Sets the description of this SobjectRequest. Description of the security object to create or import. """ self._description = description @property def key_size(self): """ Gets the key_size of this SobjectRequest. Size in bits (not bytes) of the security object to create or import. Required for symmetric keys. For DSA keys, it represents the size of `p`; allowed values are 2048 or 3072. Deprecated for RSA keys, specify it in `RsaOptions` instead. Type: `int` :setter: Sets the key_size of this SobjectRequest. """ return self._key_size @key_size.setter def key_size(self, key_size): """ Sets the key_size of this SobjectRequest. Size in bits (not bytes) of the security object to create or import. Required for symmetric keys. For DSA keys, it represents the size of `p`; allowed values are 2048 or 3072. Deprecated for RSA keys, specify it in `RsaOptions` instead. """ self._key_size = key_size @property def pub_exponent(self): """ Gets the pub_exponent of this SobjectRequest. For RSA keys only. Deprecated. Specify in `RsaOptions` instead. Public exponent to use when generating an RSA key. Type: `int` :setter: Sets the pub_exponent of this SobjectRequest. """ return self._pub_exponent @pub_exponent.setter def pub_exponent(self, pub_exponent): """ Sets the pub_exponent of this SobjectRequest. For RSA keys only. Deprecated. Specify in `RsaOptions` instead. Public exponent to use when generating an RSA key. """ self._pub_exponent = pub_exponent @property def elliptic_curve(self): """ Gets the elliptic_curve of this SobjectRequest. Type: `EllipticCurve` :setter: Sets the elliptic_curve of this SobjectRequest. """ return self._elliptic_curve @elliptic_curve.setter def elliptic_curve(self, elliptic_curve): """ Sets the elliptic_curve of this SobjectRequest. """ self._elliptic_curve = elliptic_curve @property def rsa(self): """ Gets the rsa of this SobjectRequest. Type: `RsaOptions` :setter: Sets the rsa of this SobjectRequest. """ return self._rsa @rsa.setter def rsa(self, rsa): """ Sets the rsa of this SobjectRequest. """ self._rsa = rsa @property def dsa(self): """ Gets the dsa of this SobjectRequest. Type: `DsaOptions` :setter: Sets the dsa of this SobjectRequest. """ return self._dsa @dsa.setter def dsa(self, dsa): """ Sets the dsa of this SobjectRequest. """ self._dsa = dsa @property def fpe(self): """ Gets the fpe of this SobjectRequest. Type: `FpeOptions` :setter: Sets the fpe of this SobjectRequest. """ return self._fpe @fpe.setter def fpe(self, fpe): """ Sets the fpe of this SobjectRequest. """ self._fpe = fpe @property def group_id(self): """ Gets the group_id of this SobjectRequest. Group ID (not name) of the security group that this security object should belong to. The user or application creating this security object must be a member of this group. If no group is specified, the default group for the user or application will be used. Type: `str` :setter: Sets the group_id of this SobjectRequest. """ return self._group_id @group_id.setter def group_id(self, group_id): """ Sets the group_id of this SobjectRequest. Group ID (not name) of the security group that this security object should belong to. The user or application creating this security object must be a member of this group. If no group is specified, the default group for the user or application will be used. """ self._group_id = group_id @property def rotation_policy(self): """ Gets the rotation_policy of this SobjectRequest. Type: `RotationPolicy` :setter: Sets the rotation_policy of this SobjectRequest. """ return self._rotation_policy @rotation_policy.setter def rotation_policy(self, rotation_policy): """ Sets the rotation_policy of this SobjectRequest. """ self._rotation_policy = rotation_policy @property def obj_type(self): """ Gets the obj_type of this SobjectRequest. Type: `ObjectType` :setter: Sets the obj_type of this SobjectRequest. """ return self._obj_type @obj_type.setter def obj_type(self, obj_type): """ Sets the obj_type of this SobjectRequest. """ self._obj_type = obj_type @property def key_ops(self): """ Gets the key_ops of this SobjectRequest. Optional array of key operations to be enabled for this security object. If this property is not provided, the DSM server will provide a default set of key operations. Note that if you provide an empty array, all key operations will be disabled. Type: list[`KeyOperations`] :setter: Sets the key_ops of this SobjectRequest. """ return self._key_ops @key_ops.setter def key_ops(self, key_ops): """ Sets the key_ops of this SobjectRequest. Optional array of key operations to be enabled for this security object. If this property is not provided, the DSM server will provide a default set of key operations. Note that if you provide an empty array, all key operations will be disabled. """ self._key_ops = key_ops @property def custom_metadata(self): """ Gets the custom_metadata of this SobjectRequest. User-defined metadata for this key. Stored as key-value pairs. Type: map[`str`] :setter: Sets the custom_metadata of this SobjectRequest. """ return self._custom_metadata @custom_metadata.setter def custom_metadata(self, custom_metadata): """ Sets the custom_metadata of this SobjectRequest. User-defined metadata for this key. Stored as key-value pairs. """ self._custom_metadata = custom_metadata @property def value(self): """ Gets the value of this SobjectRequest. When importing a security object, this field contains the binary contents to import. When creating a security object, this field is unused. The value of an OPAQUE or CERTIFICATE object is always returned. For other objects, the value is returned only with `/crypto/v1/keys/export` API (if the object is exportable). Type: `bytearray` :setter: Sets the value of this SobjectRequest. """ return self._value @value.setter def value(self, value): """ Sets the value of this SobjectRequest. When importing a security object, this field contains the binary contents to import. When creating a security object, this field is unused. The value of an OPAQUE or CERTIFICATE object is always returned. For other objects, the value is returned only with `/crypto/v1/keys/export` API (if the object is exportable). """ if not isinstance(value, bytearray): raise ValueError("Invalid value for `value`, `value` must be a bytearray") self._value = value @property def enabled(self): """ Gets the enabled of this SobjectRequest. Whether the new security object should be enabled. Disabled security objects may not perform cryptographic operations. Type: `bool` :setter: Sets the enabled of this SobjectRequest. """ return self._enabled @enabled.setter def enabled(self, enabled): """ Sets the enabled of this SobjectRequest. Whether the new security object should be enabled. Disabled security objects may not perform cryptographic operations. """ self._enabled = enabled @property def transient(self): """ Gets the transient of this SobjectRequest. If this is true, DSM will create a transient key. Type: `bool` :setter: Sets the transient of this SobjectRequest. """ return self._transient @transient.setter def transient(self, transient): """ Sets the transient of this SobjectRequest. If this is true, DSM will create a transient key. """ self._transient = transient @property def deterministic_signatures(self): """ Gets the deterministic_signatures of this SobjectRequest. Type: `bool` :setter: Sets the deterministic_signatures of this SobjectRequest. """ return self._deterministic_signatures @deterministic_signatures.setter def deterministic_signatures(self, deterministic_signatures): """ Sets the deterministic_signatures of this SobjectRequest. """ self._deterministic_signatures = deterministic_signatures @property def state(self): """ Gets the state of this SobjectRequest. Type: `KeyObjectState` :setter: Sets the state of this SobjectRequest. """ return self._state @state.setter def state(self, state): """ Sets the state of this SobjectRequest. """ self._state = state @property def activation_date(self): """ Gets the activation_date of this SobjectRequest. When this object will be activated. Type: `str` :setter: Sets the activation_date of this SobjectRequest. """ return self._activation_date @activation_date.setter def activation_date(self, activation_date): """ Sets the activation_date of this SobjectRequest. When this object will be activated. """ self._activation_date = activation_date @property def bls(self): """ Gets the bls of this SobjectRequest. Type: `BlsOptions` :setter: Sets the bls of this SobjectRequest. """ return self._bls @bls.setter def bls(self, bls): """ Sets the bls of this SobjectRequest. """ self._bls = bls @property def deactivation_date(self): """ Gets the deactivation_date of this SobjectRequest. When this object will be deactivated. Type: `str` :setter: Sets the deactivation_date of this SobjectRequest. """ return self._deactivation_date @deactivation_date.setter def deactivation_date(self, deactivation_date): """ Sets the deactivation_date of this SobjectRequest. When this object will be deactivated. """ self._deactivation_date = deactivation_date 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, SobjectRequest): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other