# 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 AuthResponse(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 = {
'token_type': 'str',
'expires_in': 'int',
'access_token': 'str',
'entity_id': 'str',
'challenge': 'U2fMfaChallengeResponse'
}
attribute_map = {
'token_type': 'token_type',
'expires_in': 'expires_in',
'access_token': 'access_token',
'entity_id': 'entity_id',
'challenge': 'challenge'
}
[docs] def __init__(self, token_type=None, expires_in=None, access_token=None, entity_id=None, challenge=None):
"""
AuthResponse - a model defined in Swagger
"""
self._token_type = None
self._expires_in = None
self._access_token = None
self._entity_id = None
self._challenge = None
self.token_type = token_type
self.expires_in = expires_in
self.access_token = access_token
self.entity_id = entity_id
if challenge is not None:
self.challenge = challenge
@property
def token_type(self):
"""
Gets the token_type of this AuthResponse.
Type: `str`
:setter: Sets the token_type of this AuthResponse.
"""
return self._token_type
@token_type.setter
def token_type(self, token_type):
"""
Sets the token_type of this AuthResponse.
"""
self._token_type = token_type
@property
def expires_in(self):
"""
Gets the expires_in of this AuthResponse.
Number of seconds from token issuance that the token will expire.
Type: `int`
:setter: Sets the expires_in of this AuthResponse.
"""
return self._expires_in
@expires_in.setter
def expires_in(self, expires_in):
"""
Sets the expires_in of this AuthResponse.
Number of seconds from token issuance that the token will expire.
"""
self._expires_in = expires_in
@property
def access_token(self):
"""
Gets the access_token of this AuthResponse.
Bearer token to be used to authenticate to other APIs.
Type: `str`
:setter: Sets the access_token of this AuthResponse.
"""
return self._access_token
@access_token.setter
def access_token(self, access_token):
"""
Sets the access_token of this AuthResponse.
Bearer token to be used to authenticate to other APIs.
"""
self._access_token = access_token
@property
def entity_id(self):
"""
Gets the entity_id of this AuthResponse.
The UUID of the entity that was authorized. For users, this will be the user's UUID. For applications, this will be the application's UUID.
Type: `str`
:setter: Sets the entity_id of this AuthResponse.
"""
return self._entity_id
@entity_id.setter
def entity_id(self, entity_id):
"""
Sets the entity_id of this AuthResponse.
The UUID of the entity that was authorized. For users, this will be the user's UUID. For applications, this will be the application's UUID.
"""
self._entity_id = entity_id
@property
def challenge(self):
"""
Gets the challenge of this AuthResponse.
Type: `U2fMfaChallengeResponse`
:setter: Sets the challenge of this AuthResponse.
"""
return self._challenge
@challenge.setter
def challenge(self, challenge):
"""
Sets the challenge of this AuthResponse.
"""
self._challenge = challenge
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, AuthResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other