gitlab-to-gitea/gitea/models/organization_permissions.py

227 lines
6.4 KiB
Python

# coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.17.0+rc1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from gitea.configuration import Configuration
class OrganizationPermissions(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
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 = {
'can_create_repository': 'bool',
'can_read': 'bool',
'can_write': 'bool',
'is_admin': 'bool',
'is_owner': 'bool'
}
attribute_map = {
'can_create_repository': 'can_create_repository',
'can_read': 'can_read',
'can_write': 'can_write',
'is_admin': 'is_admin',
'is_owner': 'is_owner'
}
def __init__(self, can_create_repository=None, can_read=None, can_write=None, is_admin=None, is_owner=None, _configuration=None): # noqa: E501
"""OrganizationPermissions - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._can_create_repository = None
self._can_read = None
self._can_write = None
self._is_admin = None
self._is_owner = None
self.discriminator = None
if can_create_repository is not None:
self.can_create_repository = can_create_repository
if can_read is not None:
self.can_read = can_read
if can_write is not None:
self.can_write = can_write
if is_admin is not None:
self.is_admin = is_admin
if is_owner is not None:
self.is_owner = is_owner
@property
def can_create_repository(self):
"""Gets the can_create_repository of this OrganizationPermissions. # noqa: E501
:return: The can_create_repository of this OrganizationPermissions. # noqa: E501
:rtype: bool
"""
return self._can_create_repository
@can_create_repository.setter
def can_create_repository(self, can_create_repository):
"""Sets the can_create_repository of this OrganizationPermissions.
:param can_create_repository: The can_create_repository of this OrganizationPermissions. # noqa: E501
:type: bool
"""
self._can_create_repository = can_create_repository
@property
def can_read(self):
"""Gets the can_read of this OrganizationPermissions. # noqa: E501
:return: The can_read of this OrganizationPermissions. # noqa: E501
:rtype: bool
"""
return self._can_read
@can_read.setter
def can_read(self, can_read):
"""Sets the can_read of this OrganizationPermissions.
:param can_read: The can_read of this OrganizationPermissions. # noqa: E501
:type: bool
"""
self._can_read = can_read
@property
def can_write(self):
"""Gets the can_write of this OrganizationPermissions. # noqa: E501
:return: The can_write of this OrganizationPermissions. # noqa: E501
:rtype: bool
"""
return self._can_write
@can_write.setter
def can_write(self, can_write):
"""Sets the can_write of this OrganizationPermissions.
:param can_write: The can_write of this OrganizationPermissions. # noqa: E501
:type: bool
"""
self._can_write = can_write
@property
def is_admin(self):
"""Gets the is_admin of this OrganizationPermissions. # noqa: E501
:return: The is_admin of this OrganizationPermissions. # noqa: E501
:rtype: bool
"""
return self._is_admin
@is_admin.setter
def is_admin(self, is_admin):
"""Sets the is_admin of this OrganizationPermissions.
:param is_admin: The is_admin of this OrganizationPermissions. # noqa: E501
:type: bool
"""
self._is_admin = is_admin
@property
def is_owner(self):
"""Gets the is_owner of this OrganizationPermissions. # noqa: E501
:return: The is_owner of this OrganizationPermissions. # noqa: E501
:rtype: bool
"""
return self._is_owner
@is_owner.setter
def is_owner(self, is_owner):
"""Sets the is_owner of this OrganizationPermissions.
:param is_owner: The is_owner of this OrganizationPermissions. # noqa: E501
:type: bool
"""
self._is_owner = is_owner
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.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
if issubclass(OrganizationPermissions, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.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, OrganizationPermissions):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, OrganizationPermissions):
return True
return self.to_dict() != other.to_dict()