# 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 AccountRequest(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',
'organization': 'str',
'country': 'str',
'phone': 'str',
'notification_pref': 'NotificationPref',
'auth_config': 'AuthConfig',
'add_logging_configs': 'list[LoggingConfigRequest]',
'mod_logging_configs': 'dict(str, LoggingConfigRequest)',
'del_logging_configs': 'list[str]',
'pending_subscription_change_request': 'SubscriptionChangeRequest',
'enabled': 'bool',
'subscription': 'SubscriptionType',
'custom_metadata': 'dict(str, str)',
'key_undo_policy': 'KeyUndoPolicy'
}
attribute_map = {
'name': 'name',
'description': 'description',
'organization': 'organization',
'country': 'country',
'phone': 'phone',
'notification_pref': 'notification_pref',
'auth_config': 'auth_config',
'add_logging_configs': 'add_logging_configs',
'mod_logging_configs': 'mod_logging_configs',
'del_logging_configs': 'del_logging_configs',
'pending_subscription_change_request': 'pending_subscription_change_request',
'enabled': 'enabled',
'subscription': 'subscription',
'custom_metadata': 'custom_metadata',
'key_undo_policy': 'key_undo_policy'
}
[docs] def __init__(self, name=None, description=None, organization=None, country=None, phone=None, notification_pref=None, auth_config=None, add_logging_configs=None, mod_logging_configs=None, del_logging_configs=None, pending_subscription_change_request=None, enabled=None, subscription=None, custom_metadata=None, key_undo_policy=None):
"""
AccountRequest - a model defined in Swagger
"""
self._name = None
self._description = None
self._organization = None
self._country = None
self._phone = None
self._notification_pref = None
self._auth_config = None
self._add_logging_configs = None
self._mod_logging_configs = None
self._del_logging_configs = None
self._pending_subscription_change_request = None
self._enabled = None
self._subscription = None
self._custom_metadata = None
self._key_undo_policy = None
if name is not None:
self.name = name
if description is not None:
self.description = description
if organization is not None:
self.organization = organization
if country is not None:
self.country = country
if phone is not None:
self.phone = phone
if notification_pref is not None:
self.notification_pref = notification_pref
if auth_config is not None:
self.auth_config = auth_config
if add_logging_configs is not None:
self.add_logging_configs = add_logging_configs
if mod_logging_configs is not None:
self.mod_logging_configs = mod_logging_configs
if del_logging_configs is not None:
self.del_logging_configs = del_logging_configs
if pending_subscription_change_request is not None:
self.pending_subscription_change_request = pending_subscription_change_request
if enabled is not None:
self.enabled = enabled
if subscription is not None:
self.subscription = subscription
if custom_metadata is not None:
self.custom_metadata = custom_metadata
if key_undo_policy is not None:
self.key_undo_policy = key_undo_policy
@property
def name(self):
"""
Gets the name of this AccountRequest.
Name of the account. Accounts must be unique within an DSM instance.
Type: `str`
:setter: Sets the name of this AccountRequest.
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this AccountRequest.
Name of the account. Accounts must be unique within an DSM instance.
"""
self._name = name
@property
def description(self):
"""
Gets the description of this AccountRequest.
Account ID uniquely identifying this account.
Type: `str`
:setter: Sets the description of this AccountRequest.
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this AccountRequest.
Account ID uniquely identifying this account.
"""
self._description = description
@property
def organization(self):
"""
Gets the organization of this AccountRequest.
Organization (e.g. company name) that owns this account
Type: `str`
:setter: Sets the organization of this AccountRequest.
"""
return self._organization
@organization.setter
def organization(self, organization):
"""
Sets the organization of this AccountRequest.
Organization (e.g. company name) that owns this account
"""
self._organization = organization
@property
def country(self):
"""
Gets the country of this AccountRequest.
Main country associated with this account
Type: `str`
:setter: Sets the country of this AccountRequest.
"""
return self._country
@country.setter
def country(self, country):
"""
Sets the country of this AccountRequest.
Main country associated with this account
"""
self._country = country
@property
def phone(self):
"""
Gets the phone of this AccountRequest.
Contact phone number associated with this account
Type: `str`
:setter: Sets the phone of this AccountRequest.
"""
return self._phone
@phone.setter
def phone(self, phone):
"""
Sets the phone of this AccountRequest.
Contact phone number associated with this account
"""
self._phone = phone
@property
def notification_pref(self):
"""
Gets the notification_pref of this AccountRequest.
Type: `NotificationPref`
:setter: Sets the notification_pref of this AccountRequest.
"""
return self._notification_pref
@notification_pref.setter
def notification_pref(self, notification_pref):
"""
Sets the notification_pref of this AccountRequest.
"""
self._notification_pref = notification_pref
@property
def auth_config(self):
"""
Gets the auth_config of this AccountRequest.
Type: `AuthConfig`
:setter: Sets the auth_config of this AccountRequest.
"""
return self._auth_config
@auth_config.setter
def auth_config(self, auth_config):
"""
Sets the auth_config of this AccountRequest.
"""
self._auth_config = auth_config
@property
def add_logging_configs(self):
"""
Gets the add_logging_configs of this AccountRequest.
Type: list[`LoggingConfigRequest`]
:setter: Sets the add_logging_configs of this AccountRequest.
"""
return self._add_logging_configs
@add_logging_configs.setter
def add_logging_configs(self, add_logging_configs):
"""
Sets the add_logging_configs of this AccountRequest.
"""
self._add_logging_configs = add_logging_configs
@property
def mod_logging_configs(self):
"""
Gets the mod_logging_configs of this AccountRequest.
Map from UUIDs to LoggingConfigRequest objects
Type: map[`LoggingConfigRequest`]
:setter: Sets the mod_logging_configs of this AccountRequest.
"""
return self._mod_logging_configs
@mod_logging_configs.setter
def mod_logging_configs(self, mod_logging_configs):
"""
Sets the mod_logging_configs of this AccountRequest.
Map from UUIDs to LoggingConfigRequest objects
"""
self._mod_logging_configs = mod_logging_configs
@property
def del_logging_configs(self):
"""
Gets the del_logging_configs of this AccountRequest.
Type: list[`str`]
:setter: Sets the del_logging_configs of this AccountRequest.
"""
return self._del_logging_configs
@del_logging_configs.setter
def del_logging_configs(self, del_logging_configs):
"""
Sets the del_logging_configs of this AccountRequest.
"""
self._del_logging_configs = del_logging_configs
@property
def pending_subscription_change_request(self):
"""
Gets the pending_subscription_change_request of this AccountRequest.
Type: `SubscriptionChangeRequest`
:setter: Sets the pending_subscription_change_request of this AccountRequest.
"""
return self._pending_subscription_change_request
@pending_subscription_change_request.setter
def pending_subscription_change_request(self, pending_subscription_change_request):
"""
Sets the pending_subscription_change_request of this AccountRequest.
"""
self._pending_subscription_change_request = pending_subscription_change_request
@property
def enabled(self):
"""
Gets the enabled of this AccountRequest.
Whether this account is enabled. This may only be changed by sysadmins.
Type: `bool`
:setter: Sets the enabled of this AccountRequest.
"""
return self._enabled
@enabled.setter
def enabled(self, enabled):
"""
Sets the enabled of this AccountRequest.
Whether this account is enabled. This may only be changed by sysadmins.
"""
self._enabled = enabled
@property
def subscription(self):
"""
Gets the subscription of this AccountRequest.
Type: `SubscriptionType`
:setter: Sets the subscription of this AccountRequest.
"""
return self._subscription
@subscription.setter
def subscription(self, subscription):
"""
Sets the subscription of this AccountRequest.
"""
self._subscription = subscription
@property
def custom_metadata(self):
"""
Gets the custom_metadata of this AccountRequest.
Sysadmin-defined metadata for this account. Stored as key-value pairs. This field may only be used by sysadmin users.
Type: map[`str`]
:setter: Sets the custom_metadata of this AccountRequest.
"""
return self._custom_metadata
@custom_metadata.setter
def custom_metadata(self, custom_metadata):
"""
Sets the custom_metadata of this AccountRequest.
Sysadmin-defined metadata for this account. Stored as key-value pairs. This field may only be used by sysadmin users.
"""
self._custom_metadata = custom_metadata
@property
def key_undo_policy(self):
"""
Gets the key_undo_policy of this AccountRequest.
Type: `KeyUndoPolicy`
:setter: Sets the key_undo_policy of this AccountRequest.
"""
return self._key_undo_policy
@key_undo_policy.setter
def key_undo_policy(self, key_undo_policy):
"""
Sets the key_undo_policy of this AccountRequest.
"""
self._key_undo_policy = key_undo_policy
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, AccountRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other