# 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 ApprovalRequest(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 = {
'request_id': 'str',
'requester': 'Entity',
'created_at': 'str',
'acct_id': 'str',
'operation': 'str',
'method': 'str',
'body': 'object',
'approvers': 'list[Entity]',
'denier': 'Entity',
'status': 'ApprovalStatus',
'reviewers': 'list[Entity]',
'subjects': 'list[ApprovalSubject]',
'description': 'str',
'expiry': 'str'
}
attribute_map = {
'request_id': 'request_id',
'requester': 'requester',
'created_at': 'created_at',
'acct_id': 'acct_id',
'operation': 'operation',
'method': 'method',
'body': 'body',
'approvers': 'approvers',
'denier': 'denier',
'status': 'status',
'reviewers': 'reviewers',
'subjects': 'subjects',
'description': 'description',
'expiry': 'expiry'
}
[docs] def __init__(self, request_id=None, requester=None, created_at=None, acct_id=None, operation=None, method=None, body=None, approvers=None, denier=None, status=None, reviewers=None, subjects=None, description=None, expiry=None):
"""
ApprovalRequest - a model defined in Swagger
"""
self._request_id = None
self._requester = None
self._created_at = None
self._acct_id = None
self._operation = None
self._method = None
self._body = None
self._approvers = None
self._denier = None
self._status = None
self._reviewers = None
self._subjects = None
self._description = None
self._expiry = None
self.request_id = request_id
self.requester = requester
self.created_at = created_at
self.acct_id = acct_id
self.operation = operation
self.method = method
self.body = body
self.approvers = approvers
self.denier = denier
self.status = status
self.reviewers = reviewers
self.subjects = subjects
if description is not None:
self.description = description
self.expiry = expiry
@property
def request_id(self):
"""
Gets the request_id of this ApprovalRequest.
UUID uniquely identifying this approval request.
Type: `str`
:setter: Sets the request_id of this ApprovalRequest.
"""
return self._request_id
@request_id.setter
def request_id(self, request_id):
"""
Sets the request_id of this ApprovalRequest.
UUID uniquely identifying this approval request.
"""
self._request_id = request_id
@property
def requester(self):
"""
Gets the requester of this ApprovalRequest.
Type: `Entity`
:setter: Sets the requester of this ApprovalRequest.
"""
return self._requester
@requester.setter
def requester(self, requester):
"""
Sets the requester of this ApprovalRequest.
"""
self._requester = requester
@property
def created_at(self):
"""
Gets the created_at of this ApprovalRequest.
When this approval request was created.
Type: `str`
:setter: Sets the created_at of this ApprovalRequest.
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this ApprovalRequest.
When this approval request was created.
"""
self._created_at = created_at
@property
def acct_id(self):
"""
Gets the acct_id of this ApprovalRequest.
The account ID of the account that this approval request belongs to.
Type: `str`
:setter: Sets the acct_id of this ApprovalRequest.
"""
return self._acct_id
@acct_id.setter
def acct_id(self, acct_id):
"""
Sets the acct_id of this ApprovalRequest.
The account ID of the account that this approval request belongs to.
"""
self._acct_id = acct_id
@property
def operation(self):
"""
Gets the operation of this ApprovalRequest.
Operation URL path, e.g. `/crypto/v1/keys`, `/crypto/v1/groups/<id>`.
Type: `str`
:setter: Sets the operation of this ApprovalRequest.
"""
return self._operation
@operation.setter
def operation(self, operation):
"""
Sets the operation of this ApprovalRequest.
Operation URL path, e.g. `/crypto/v1/keys`, `/crypto/v1/groups/<id>`.
"""
self._operation = operation
@property
def method(self):
"""
Gets the method of this ApprovalRequest.
Method for the operation: POST, PATCH, PUT, DELETE, or GET. Default is POST.
Type: `str`
:setter: Sets the method of this ApprovalRequest.
"""
return self._method
@method.setter
def method(self, method):
"""
Sets the method of this ApprovalRequest.
Method for the operation: POST, PATCH, PUT, DELETE, or GET. Default is POST.
"""
self._method = method
@property
def body(self):
"""
Gets the body of this ApprovalRequest.
Type: `object`
:setter: Sets the body of this ApprovalRequest.
"""
return self._body
@body.setter
def body(self, body):
"""
Sets the body of this ApprovalRequest.
"""
self._body = body
@property
def approvers(self):
"""
Gets the approvers of this ApprovalRequest.
Type: list[`Entity`]
:setter: Sets the approvers of this ApprovalRequest.
"""
return self._approvers
@approvers.setter
def approvers(self, approvers):
"""
Sets the approvers of this ApprovalRequest.
"""
self._approvers = approvers
@property
def denier(self):
"""
Gets the denier of this ApprovalRequest.
Type: `Entity`
:setter: Sets the denier of this ApprovalRequest.
"""
return self._denier
@denier.setter
def denier(self, denier):
"""
Sets the denier of this ApprovalRequest.
"""
self._denier = denier
@property
def status(self):
"""
Gets the status of this ApprovalRequest.
Type: `ApprovalStatus`
:setter: Sets the status of this ApprovalRequest.
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this ApprovalRequest.
"""
self._status = status
@property
def reviewers(self):
"""
Gets the reviewers of this ApprovalRequest.
Type: list[`Entity`]
:setter: Sets the reviewers of this ApprovalRequest.
"""
return self._reviewers
@reviewers.setter
def reviewers(self, reviewers):
"""
Sets the reviewers of this ApprovalRequest.
"""
self._reviewers = reviewers
@property
def subjects(self):
"""
Gets the subjects of this ApprovalRequest.
Type: list[`ApprovalSubject`]
:setter: Sets the subjects of this ApprovalRequest.
"""
return self._subjects
@subjects.setter
def subjects(self, subjects):
"""
Sets the subjects of this ApprovalRequest.
"""
self._subjects = subjects
@property
def description(self):
"""
Gets the description of this ApprovalRequest.
Optional comment about the approval request for the reviewer.
Type: `str`
:setter: Sets the description of this ApprovalRequest.
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this ApprovalRequest.
Optional comment about the approval request for the reviewer.
"""
self._description = description
@property
def expiry(self):
"""
Gets the expiry of this ApprovalRequest.
When this approval request expires.
Type: `str`
:setter: Sets the expiry of this ApprovalRequest.
"""
return self._expiry
@expiry.setter
def expiry(self, expiry):
"""
Sets the expiry of this ApprovalRequest.
When this approval request expires.
"""
self._expiry = expiry
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, ApprovalRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other