# 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 Account(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',
'acct_id': 'str',
'description': 'str',
'organization': 'str',
'country': 'str',
'phone': 'str',
'notification_pref': 'NotificationPref',
'auth_config': 'AuthConfig',
'subscription': 'SubscriptionType',
'state': 'AccountState',
'auth_type': 'AuthType',
'logging_configs': 'dict(str, LoggingConfig)',
'enabled': 'bool',
'created_at': 'str',
'initial_purchase_at': 'str',
'pending_subscription_change_request': 'SubscriptionChangeRequest',
'custom_metadata': 'dict(str, str)',
'key_undo_policy': 'KeyUndoPolicy'
}
attribute_map = {
'name': 'name',
'acct_id': 'acct_id',
'description': 'description',
'organization': 'organization',
'country': 'country',
'phone': 'phone',
'notification_pref': 'notification_pref',
'auth_config': 'auth_config',
'subscription': 'subscription',
'state': 'state',
'auth_type': 'auth_type',
'logging_configs': 'logging_configs',
'enabled': 'enabled',
'created_at': 'created_at',
'initial_purchase_at': 'initial_purchase_at',
'pending_subscription_change_request': 'pending_subscription_change_request',
'custom_metadata': 'custom_metadata',
'key_undo_policy': 'key_undo_policy'
}
[docs] def __init__(self, name=None, acct_id=None, description=None, organization=None, country=None, phone=None, notification_pref=None, auth_config=None, subscription=None, state=None, auth_type=None, logging_configs=None, enabled=None, created_at=None, initial_purchase_at=None, pending_subscription_change_request=None, custom_metadata=None, key_undo_policy=None):
"""
Account - a model defined in Swagger
"""
self._name = None
self._acct_id = None
self._description = None
self._organization = None
self._country = None
self._phone = None
self._notification_pref = None
self._auth_config = None
self._subscription = None
self._state = None
self._auth_type = None
self._logging_configs = None
self._enabled = None
self._created_at = None
self._initial_purchase_at = None
self._pending_subscription_change_request = None
self._custom_metadata = None
self._key_undo_policy = None
self.name = name
self.acct_id = acct_id
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
self.subscription = subscription
self.state = state
if auth_type is not None:
self.auth_type = auth_type
if logging_configs is not None:
self.logging_configs = logging_configs
self.enabled = enabled
if created_at is not None:
self.created_at = created_at
if initial_purchase_at is not None:
self.initial_purchase_at = initial_purchase_at
if pending_subscription_change_request is not None:
self.pending_subscription_change_request = pending_subscription_change_request
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 Account.
Name of the account. Account names must be unique within an DSM instance.
Type: `str`
:setter: Sets the name of this Account.
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this Account.
Name of the account. Account names must be unique within an DSM instance.
"""
self._name = name
@property
def acct_id(self):
"""
Gets the acct_id of this Account.
Account ID uniquely identifying this account.
Type: `str`
:setter: Sets the acct_id of this Account.
"""
return self._acct_id
@acct_id.setter
def acct_id(self, acct_id):
"""
Sets the acct_id of this Account.
Account ID uniquely identifying this account.
"""
self._acct_id = acct_id
@property
def description(self):
"""
Gets the description of this Account.
Description of this account.
Type: `str`
:setter: Sets the description of this Account.
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this Account.
Description of this account.
"""
self._description = description
@property
def organization(self):
"""
Gets the organization of this Account.
Organization (e.g. company name) that owns this account
Type: `str`
:setter: Sets the organization of this Account.
"""
return self._organization
@organization.setter
def organization(self, organization):
"""
Sets the organization of this Account.
Organization (e.g. company name) that owns this account
"""
self._organization = organization
@property
def country(self):
"""
Gets the country of this Account.
Main country associated with this account
Type: `str`
:setter: Sets the country of this Account.
"""
return self._country
@country.setter
def country(self, country):
"""
Sets the country of this Account.
Main country associated with this account
"""
self._country = country
@property
def phone(self):
"""
Gets the phone of this Account.
Contact phone number associated with this account
Type: `str`
:setter: Sets the phone of this Account.
"""
return self._phone
@phone.setter
def phone(self, phone):
"""
Sets the phone of this Account.
Contact phone number associated with this account
"""
self._phone = phone
@property
def notification_pref(self):
"""
Gets the notification_pref of this Account.
Type: `NotificationPref`
:setter: Sets the notification_pref of this Account.
"""
return self._notification_pref
@notification_pref.setter
def notification_pref(self, notification_pref):
"""
Sets the notification_pref of this Account.
"""
self._notification_pref = notification_pref
@property
def auth_config(self):
"""
Gets the auth_config of this Account.
Type: `AuthConfig`
:setter: Sets the auth_config of this Account.
"""
return self._auth_config
@auth_config.setter
def auth_config(self, auth_config):
"""
Sets the auth_config of this Account.
"""
self._auth_config = auth_config
@property
def subscription(self):
"""
Gets the subscription of this Account.
Type: `SubscriptionType`
:setter: Sets the subscription of this Account.
"""
return self._subscription
@subscription.setter
def subscription(self, subscription):
"""
Sets the subscription of this Account.
"""
self._subscription = subscription
@property
def state(self):
"""
Gets the state of this Account.
Type: `AccountState`
:setter: Sets the state of this Account.
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this Account.
"""
self._state = state
@property
def auth_type(self):
"""
Gets the auth_type of this Account.
Type: `AuthType`
:setter: Sets the auth_type of this Account.
"""
return self._auth_type
@auth_type.setter
def auth_type(self, auth_type):
"""
Sets the auth_type of this Account.
"""
self._auth_type = auth_type
@property
def logging_configs(self):
"""
Gets the logging_configs of this Account.
Map from UUIDs to LoggingConfig objects
Type: map[`LoggingConfig`]
:setter: Sets the logging_configs of this Account.
"""
return self._logging_configs
@logging_configs.setter
def logging_configs(self, logging_configs):
"""
Sets the logging_configs of this Account.
Map from UUIDs to LoggingConfig objects
"""
self._logging_configs = logging_configs
@property
def enabled(self):
"""
Gets the enabled of this Account.
Whether this account is enabled. This may only be changed by sysadmins.
Type: `bool`
:setter: Sets the enabled of this Account.
"""
return self._enabled
@enabled.setter
def enabled(self, enabled):
"""
Sets the enabled of this Account.
Whether this account is enabled. This may only be changed by sysadmins.
"""
self._enabled = enabled
@property
def created_at(self):
"""
Gets the created_at of this Account.
When this account was created.
Type: `str`
:setter: Sets the created_at of this Account.
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this Account.
When this account was created.
"""
self._created_at = created_at
@property
def initial_purchase_at(self):
"""
Gets the initial_purchase_at of this Account.
When this accout was upgraded a paid subscription.
Type: `str`
:setter: Sets the initial_purchase_at of this Account.
"""
return self._initial_purchase_at
@initial_purchase_at.setter
def initial_purchase_at(self, initial_purchase_at):
"""
Sets the initial_purchase_at of this Account.
When this accout was upgraded a paid subscription.
"""
self._initial_purchase_at = initial_purchase_at
@property
def pending_subscription_change_request(self):
"""
Gets the pending_subscription_change_request of this Account.
Type: `SubscriptionChangeRequest`
:setter: Sets the pending_subscription_change_request of this Account.
"""
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 Account.
"""
self._pending_subscription_change_request = pending_subscription_change_request
@property
def custom_metadata(self):
"""
Gets the custom_metadata of this Account.
Sysadmin-defined metadata for this account. Stored as key-value pairs. This field is only visible to sysadmin users.
Type: map[`str`]
:setter: Sets the custom_metadata of this Account.
"""
return self._custom_metadata
@custom_metadata.setter
def custom_metadata(self, custom_metadata):
"""
Sets the custom_metadata of this Account.
Sysadmin-defined metadata for this account. Stored as key-value pairs. This field is only visible to sysadmin users.
"""
self._custom_metadata = custom_metadata
@property
def key_undo_policy(self):
"""
Gets the key_undo_policy of this Account.
Type: `KeyUndoPolicy`
:setter: Sets the key_undo_policy of this Account.
"""
return self._key_undo_policy
@key_undo_policy.setter
def key_undo_policy(self, key_undo_policy):
"""
Sets the key_undo_policy of this Account.
"""
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, Account):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other