# 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 AppRequest(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',
'add_groups': 'dict(str, list[AppPermissions])',
'del_groups': 'list[str]',
'mod_groups': 'dict(str, list[AppPermissions])',
'default_group': 'str',
'enabled': 'bool',
'app_oauth_config': 'AppOauthConfig',
'interface': 'str',
'app_type': 'str',
'credential': 'AppCredential',
'secret_size': 'int'
}
attribute_map = {
'name': 'name',
'description': 'description',
'add_groups': 'add_groups',
'del_groups': 'del_groups',
'mod_groups': 'mod_groups',
'default_group': 'default_group',
'enabled': 'enabled',
'app_oauth_config': 'AppOauthConfig',
'interface': 'interface',
'app_type': 'app_type',
'credential': 'credential',
'secret_size': 'secret_size'
}
[docs] def __init__(self, name=None, description=None, add_groups=None, del_groups=None, mod_groups=None, default_group=None, enabled=None, app_oauth_config=None, interface=None, app_type=None, credential=None, secret_size=None):
"""
AppRequest - a model defined in Swagger
"""
self._name = None
self._description = None
self._add_groups = None
self._del_groups = None
self._mod_groups = None
self._default_group = None
self._enabled = None
self._app_oauth_config = None
self._interface = None
self._app_type = None
self._credential = None
self._secret_size = None
self.name = name
if description is not None:
self.description = description
self.add_groups = add_groups
if del_groups is not None:
self.del_groups = del_groups
if mod_groups is not None:
self.mod_groups = mod_groups
self.default_group = default_group
if enabled is not None:
self.enabled = enabled
if app_oauth_config is not None:
self.app_oauth_config = app_oauth_config
if interface is not None:
self.interface = interface
if app_type is not None:
self.app_type = app_type
if credential is not None:
self.credential = credential
if secret_size is not None:
self.secret_size = secret_size
@property
def name(self):
"""
Gets the name of this AppRequest.
Name of this application. Application names must be unique within an account.
Type: `str`
:setter: Sets the name of this AppRequest.
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this AppRequest.
Name of this application. Application names must be unique within an account.
"""
self._name = name
@property
def description(self):
"""
Gets the description of this AppRequest.
Description of this application.
Type: `str`
:setter: Sets the description of this AppRequest.
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this AppRequest.
Description of this application.
"""
self._description = description
@property
def add_groups(self):
"""
Gets the add_groups of this AppRequest.
Map from UUIDs to group permissions
Type: map[`list[AppPermissions]`]
:setter: Sets the add_groups of this AppRequest.
"""
return self._add_groups
@add_groups.setter
def add_groups(self, add_groups):
"""
Sets the add_groups of this AppRequest.
Map from UUIDs to group permissions
"""
self._add_groups = add_groups
@property
def del_groups(self):
"""
Gets the del_groups of this AppRequest.
Array of UUID of group
Type: list[`str`]
:setter: Sets the del_groups of this AppRequest.
"""
return self._del_groups
@del_groups.setter
def del_groups(self, del_groups):
"""
Sets the del_groups of this AppRequest.
Array of UUID of group
"""
self._del_groups = del_groups
@property
def mod_groups(self):
"""
Gets the mod_groups of this AppRequest.
Map from UUIDs to group permissions
Type: map[`list[AppPermissions]`]
:setter: Sets the mod_groups of this AppRequest.
"""
return self._mod_groups
@mod_groups.setter
def mod_groups(self, mod_groups):
"""
Sets the mod_groups of this AppRequest.
Map from UUIDs to group permissions
"""
self._mod_groups = mod_groups
@property
def default_group(self):
"""
Gets the default_group of this AppRequest.
The default group of this application. This is the group where security objects will be created by default by this application.
Type: `str`
:setter: Sets the default_group of this AppRequest.
"""
return self._default_group
@default_group.setter
def default_group(self, default_group):
"""
Sets the default_group of this AppRequest.
The default group of this application. This is the group where security objects will be created by default by this application.
"""
self._default_group = default_group
@property
def enabled(self):
"""
Gets the enabled of this AppRequest.
Whether this application is enabled
Type: `bool`
:setter: Sets the enabled of this AppRequest.
"""
return self._enabled
@enabled.setter
def enabled(self, enabled):
"""
Sets the enabled of this AppRequest.
Whether this application is enabled
"""
self._enabled = enabled
@property
def app_oauth_config(self):
"""
Gets the app_oauth_config of this AppRequest.
Type: `AppOauthConfig`
:setter: Sets the app_oauth_config of this AppRequest.
"""
return self._app_oauth_config
@app_oauth_config.setter
def app_oauth_config(self, app_oauth_config):
"""
Sets the app_oauth_config of this AppRequest.
"""
self._app_oauth_config = app_oauth_config
@property
def interface(self):
"""
Gets the interface of this AppRequest.
Interface used with this application (PKCS11, CNG, JCE, KMIP, etc.).
Type: `str`
:setter: Sets the interface of this AppRequest.
"""
return self._interface
@interface.setter
def interface(self, interface):
"""
Sets the interface of this AppRequest.
Interface used with this application (PKCS11, CNG, JCE, KMIP, etc.).
"""
self._interface = interface
@property
def app_type(self):
"""
Gets the app_type of this AppRequest.
The user-defined type of this application.
Type: `str`
:setter: Sets the app_type of this AppRequest.
"""
return self._app_type
@app_type.setter
def app_type(self, app_type):
"""
Sets the app_type of this AppRequest.
The user-defined type of this application.
"""
self._app_type = app_type
@property
def credential(self):
"""
Gets the credential of this AppRequest.
Type: `AppCredential`
:setter: Sets the credential of this AppRequest.
"""
return self._credential
@credential.setter
def credential(self, credential):
"""
Sets the credential of this AppRequest.
"""
self._credential = credential
@property
def secret_size(self):
"""
Gets the secret_size of this AppRequest.
Size in bytes of app's secret.
Type: `int`
:setter: Sets the secret_size of this AppRequest.
"""
return self._secret_size
@secret_size.setter
def secret_size(self, secret_size):
"""
Sets the secret_size of this AppRequest.
Size in bytes of app's secret.
"""
self._secret_size = secret_size
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, AppRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other