Files
gitea_python_api/swagger_client/models/combined_status.py
dominoxp 8b9fca043a Init
2026-01-23 00:30:37 +01:00

299 lines
9.3 KiB
Python

# coding: utf-8
"""
Gitea API
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.25.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.configuration import Configuration
class CombinedStatus(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 = {
'commit_url': 'str',
'repository': 'Repository',
'sha': 'str',
'state': 'str',
'statuses': 'list[CommitStatus]',
'total_count': 'int',
'url': 'str'
}
attribute_map = {
'commit_url': 'commit_url',
'repository': 'repository',
'sha': 'sha',
'state': 'state',
'statuses': 'statuses',
'total_count': 'total_count',
'url': 'url'
}
def __init__(self, commit_url=None, repository=None, sha=None, state=None, statuses=None, total_count=None, url=None, _configuration=None): # noqa: E501
"""CombinedStatus - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._commit_url = None
self._repository = None
self._sha = None
self._state = None
self._statuses = None
self._total_count = None
self._url = None
self.discriminator = None
if commit_url is not None:
self.commit_url = commit_url
if repository is not None:
self.repository = repository
if sha is not None:
self.sha = sha
if state is not None:
self.state = state
if statuses is not None:
self.statuses = statuses
if total_count is not None:
self.total_count = total_count
if url is not None:
self.url = url
@property
def commit_url(self):
"""Gets the commit_url of this CombinedStatus. # noqa: E501
CommitURL is the API URL for the commit # noqa: E501
:return: The commit_url of this CombinedStatus. # noqa: E501
:rtype: str
"""
return self._commit_url
@commit_url.setter
def commit_url(self, commit_url):
"""Sets the commit_url of this CombinedStatus.
CommitURL is the API URL for the commit # noqa: E501
:param commit_url: The commit_url of this CombinedStatus. # noqa: E501
:type: str
"""
self._commit_url = commit_url
@property
def repository(self):
"""Gets the repository of this CombinedStatus. # noqa: E501
:return: The repository of this CombinedStatus. # noqa: E501
:rtype: Repository
"""
return self._repository
@repository.setter
def repository(self, repository):
"""Sets the repository of this CombinedStatus.
:param repository: The repository of this CombinedStatus. # noqa: E501
:type: Repository
"""
self._repository = repository
@property
def sha(self):
"""Gets the sha of this CombinedStatus. # noqa: E501
SHA is the commit SHA this status applies to # noqa: E501
:return: The sha of this CombinedStatus. # noqa: E501
:rtype: str
"""
return self._sha
@sha.setter
def sha(self, sha):
"""Sets the sha of this CombinedStatus.
SHA is the commit SHA this status applies to # noqa: E501
:param sha: The sha of this CombinedStatus. # noqa: E501
:type: str
"""
self._sha = sha
@property
def state(self):
"""Gets the state of this CombinedStatus. # noqa: E501
State is the overall combined status state pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending success CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success error CommitStatusError CommitStatusError is for when the CommitStatus is Error failure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure warning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning skipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped # noqa: E501
:return: The state of this CombinedStatus. # noqa: E501
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this CombinedStatus.
State is the overall combined status state pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending success CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success error CommitStatusError CommitStatusError is for when the CommitStatus is Error failure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure warning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning skipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped # noqa: E501
:param state: The state of this CombinedStatus. # noqa: E501
:type: str
"""
allowed_values = ["pending", "success", "error", "failure", "warning", "skipped"] # noqa: E501
if (self._configuration.client_side_validation and
state not in allowed_values):
raise ValueError(
"Invalid value for `state` ({0}), must be one of {1}" # noqa: E501
.format(state, allowed_values)
)
self._state = state
@property
def statuses(self):
"""Gets the statuses of this CombinedStatus. # noqa: E501
Statuses contains all individual commit statuses # noqa: E501
:return: The statuses of this CombinedStatus. # noqa: E501
:rtype: list[CommitStatus]
"""
return self._statuses
@statuses.setter
def statuses(self, statuses):
"""Sets the statuses of this CombinedStatus.
Statuses contains all individual commit statuses # noqa: E501
:param statuses: The statuses of this CombinedStatus. # noqa: E501
:type: list[CommitStatus]
"""
self._statuses = statuses
@property
def total_count(self):
"""Gets the total_count of this CombinedStatus. # noqa: E501
TotalCount is the total number of statuses # noqa: E501
:return: The total_count of this CombinedStatus. # noqa: E501
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""Sets the total_count of this CombinedStatus.
TotalCount is the total number of statuses # noqa: E501
:param total_count: The total_count of this CombinedStatus. # noqa: E501
:type: int
"""
self._total_count = total_count
@property
def url(self):
"""Gets the url of this CombinedStatus. # noqa: E501
URL is the API URL for this combined status # noqa: E501
:return: The url of this CombinedStatus. # noqa: E501
:rtype: str
"""
return self._url
@url.setter
def url(self, url):
"""Sets the url of this CombinedStatus.
URL is the API URL for this combined status # noqa: E501
:param url: The url of this CombinedStatus. # noqa: E501
:type: str
"""
self._url = url
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(CombinedStatus, 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, CombinedStatus):
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, CombinedStatus):
return True
return self.to_dict() != other.to_dict()