add: demo server and client
This commit is contained in:
12
demo_server/openapi_server/models/__init__.py
Normal file
12
demo_server/openapi_server/models/__init__.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# flake8: noqa
|
||||
# import models into model package
|
||||
from openapi_server.models.claim_ice_candidates_response import ClaimIceCandidatesResponse
|
||||
from openapi_server.models.google_protobuf_any import GoogleProtobufAny
|
||||
from openapi_server.models.ice_candidate import IceCandidate
|
||||
from openapi_server.models.ice_session_description import IceSessionDescription
|
||||
from openapi_server.models.knock import Knock
|
||||
from openapi_server.models.list_knocks_response import ListKnocksResponse
|
||||
from openapi_server.models.room import Room
|
||||
from openapi_server.models.server import Server
|
||||
from openapi_server.models.service import Service
|
||||
from openapi_server.models.status import Status
|
||||
68
demo_server/openapi_server/models/base_model.py
Normal file
68
demo_server/openapi_server/models/base_model.py
Normal file
@@ -0,0 +1,68 @@
|
||||
import pprint
|
||||
|
||||
import typing
|
||||
|
||||
from openapi_server import util
|
||||
|
||||
T = typing.TypeVar('T')
|
||||
|
||||
|
||||
class Model:
|
||||
# openapiTypes: The key is attribute name and the
|
||||
# value is attribute type.
|
||||
openapi_types: typing.Dict[str, type] = {}
|
||||
|
||||
# attributeMap: The key is attribute name and the
|
||||
# value is json key in definition.
|
||||
attribute_map: typing.Dict[str, str] = {}
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: typing.Type[T], dikt) -> T:
|
||||
"""Returns the dict as a model"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the model properties as a dict
|
||||
|
||||
:rtype: dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr in self.openapi_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
|
||||
|
||||
:rtype: str
|
||||
"""
|
||||
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"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
return not self == other
|
||||
@@ -0,0 +1,63 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.ice_candidate import IceCandidate
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.ice_candidate import IceCandidate # noqa: E501
|
||||
|
||||
class ClaimIceCandidatesResponse(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, ice_candidates=None): # noqa: E501
|
||||
"""ClaimIceCandidatesResponse - a model defined in OpenAPI
|
||||
|
||||
:param ice_candidates: The ice_candidates of this ClaimIceCandidatesResponse. # noqa: E501
|
||||
:type ice_candidates: List[IceCandidate]
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'ice_candidates': List[IceCandidate]
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'ice_candidates': 'iceCandidates'
|
||||
}
|
||||
|
||||
self._ice_candidates = ice_candidates
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'ClaimIceCandidatesResponse':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The ClaimIceCandidatesResponse of this ClaimIceCandidatesResponse. # noqa: E501
|
||||
:rtype: ClaimIceCandidatesResponse
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def ice_candidates(self) -> List[IceCandidate]:
|
||||
"""Gets the ice_candidates of this ClaimIceCandidatesResponse.
|
||||
|
||||
|
||||
:return: The ice_candidates of this ClaimIceCandidatesResponse.
|
||||
:rtype: List[IceCandidate]
|
||||
"""
|
||||
return self._ice_candidates
|
||||
|
||||
@ice_candidates.setter
|
||||
def ice_candidates(self, ice_candidates: List[IceCandidate]):
|
||||
"""Sets the ice_candidates of this ClaimIceCandidatesResponse.
|
||||
|
||||
|
||||
:param ice_candidates: The ice_candidates of this ClaimIceCandidatesResponse.
|
||||
:type ice_candidates: List[IceCandidate]
|
||||
"""
|
||||
|
||||
self._ice_candidates = ice_candidates
|
||||
63
demo_server/openapi_server/models/google_protobuf_any.py
Normal file
63
demo_server/openapi_server/models/google_protobuf_any.py
Normal file
@@ -0,0 +1,63 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class GoogleProtobufAny(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, type=None): # noqa: E501
|
||||
"""GoogleProtobufAny - a model defined in OpenAPI
|
||||
|
||||
:param type: The type of this GoogleProtobufAny. # noqa: E501
|
||||
:type type: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'type': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'type': '@type'
|
||||
}
|
||||
|
||||
self._type = type
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'GoogleProtobufAny':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The GoogleProtobufAny of this GoogleProtobufAny. # noqa: E501
|
||||
:rtype: GoogleProtobufAny
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def type(self) -> str:
|
||||
"""Gets the type of this GoogleProtobufAny.
|
||||
|
||||
The type of the serialized message. # noqa: E501
|
||||
|
||||
:return: The type of this GoogleProtobufAny.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._type
|
||||
|
||||
@type.setter
|
||||
def type(self, type: str):
|
||||
"""Sets the type of this GoogleProtobufAny.
|
||||
|
||||
The type of the serialized message. # noqa: E501
|
||||
|
||||
:param type: The type of this GoogleProtobufAny.
|
||||
:type type: str
|
||||
"""
|
||||
|
||||
self._type = type
|
||||
165
demo_server/openapi_server/models/ice_candidate.py
Normal file
165
demo_server/openapi_server/models/ice_candidate.py
Normal file
@@ -0,0 +1,165 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class IceCandidate(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, candidate=None, sdp_mid=None, sdp_line_index=None, username_fragment=None): # noqa: E501
|
||||
"""IceCandidate - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this IceCandidate. # noqa: E501
|
||||
:type name: str
|
||||
:param candidate: The candidate of this IceCandidate. # noqa: E501
|
||||
:type candidate: str
|
||||
:param sdp_mid: The sdp_mid of this IceCandidate. # noqa: E501
|
||||
:type sdp_mid: str
|
||||
:param sdp_line_index: The sdp_line_index of this IceCandidate. # noqa: E501
|
||||
:type sdp_line_index: int
|
||||
:param username_fragment: The username_fragment of this IceCandidate. # noqa: E501
|
||||
:type username_fragment: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'candidate': str,
|
||||
'sdp_mid': str,
|
||||
'sdp_line_index': int,
|
||||
'username_fragment': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'candidate': 'candidate',
|
||||
'sdp_mid': 'sdpMid',
|
||||
'sdp_line_index': 'sdpLineIndex',
|
||||
'username_fragment': 'usernameFragment'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._candidate = candidate
|
||||
self._sdp_mid = sdp_mid
|
||||
self._sdp_line_index = sdp_line_index
|
||||
self._username_fragment = username_fragment
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'IceCandidate':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The IceCandidate of this IceCandidate. # noqa: E501
|
||||
:rtype: IceCandidate
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this IceCandidate.
|
||||
|
||||
|
||||
:return: The name of this IceCandidate.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this IceCandidate.
|
||||
|
||||
|
||||
:param name: The name of this IceCandidate.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def candidate(self) -> str:
|
||||
"""Gets the candidate of this IceCandidate.
|
||||
|
||||
|
||||
:return: The candidate of this IceCandidate.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._candidate
|
||||
|
||||
@candidate.setter
|
||||
def candidate(self, candidate: str):
|
||||
"""Sets the candidate of this IceCandidate.
|
||||
|
||||
|
||||
:param candidate: The candidate of this IceCandidate.
|
||||
:type candidate: str
|
||||
"""
|
||||
|
||||
self._candidate = candidate
|
||||
|
||||
@property
|
||||
def sdp_mid(self) -> str:
|
||||
"""Gets the sdp_mid of this IceCandidate.
|
||||
|
||||
|
||||
:return: The sdp_mid of this IceCandidate.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._sdp_mid
|
||||
|
||||
@sdp_mid.setter
|
||||
def sdp_mid(self, sdp_mid: str):
|
||||
"""Sets the sdp_mid of this IceCandidate.
|
||||
|
||||
|
||||
:param sdp_mid: The sdp_mid of this IceCandidate.
|
||||
:type sdp_mid: str
|
||||
"""
|
||||
|
||||
self._sdp_mid = sdp_mid
|
||||
|
||||
@property
|
||||
def sdp_line_index(self) -> int:
|
||||
"""Gets the sdp_line_index of this IceCandidate.
|
||||
|
||||
|
||||
:return: The sdp_line_index of this IceCandidate.
|
||||
:rtype: int
|
||||
"""
|
||||
return self._sdp_line_index
|
||||
|
||||
@sdp_line_index.setter
|
||||
def sdp_line_index(self, sdp_line_index: int):
|
||||
"""Sets the sdp_line_index of this IceCandidate.
|
||||
|
||||
|
||||
:param sdp_line_index: The sdp_line_index of this IceCandidate.
|
||||
:type sdp_line_index: int
|
||||
"""
|
||||
|
||||
self._sdp_line_index = sdp_line_index
|
||||
|
||||
@property
|
||||
def username_fragment(self) -> str:
|
||||
"""Gets the username_fragment of this IceCandidate.
|
||||
|
||||
|
||||
:return: The username_fragment of this IceCandidate.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._username_fragment
|
||||
|
||||
@username_fragment.setter
|
||||
def username_fragment(self, username_fragment: str):
|
||||
"""Sets the username_fragment of this IceCandidate.
|
||||
|
||||
|
||||
:param username_fragment: The username_fragment of this IceCandidate.
|
||||
:type username_fragment: str
|
||||
"""
|
||||
|
||||
self._username_fragment = username_fragment
|
||||
117
demo_server/openapi_server/models/ice_session_description.py
Normal file
117
demo_server/openapi_server/models/ice_session_description.py
Normal file
@@ -0,0 +1,117 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class IceSessionDescription(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, sdp_type=None, sdp=None): # noqa: E501
|
||||
"""IceSessionDescription - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this IceSessionDescription. # noqa: E501
|
||||
:type name: str
|
||||
:param sdp_type: The sdp_type of this IceSessionDescription. # noqa: E501
|
||||
:type sdp_type: str
|
||||
:param sdp: The sdp of this IceSessionDescription. # noqa: E501
|
||||
:type sdp: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'sdp_type': str,
|
||||
'sdp': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'sdp_type': 'sdpType',
|
||||
'sdp': 'sdp'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._sdp_type = sdp_type
|
||||
self._sdp = sdp
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'IceSessionDescription':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The IceSessionDescription of this IceSessionDescription. # noqa: E501
|
||||
:rtype: IceSessionDescription
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this IceSessionDescription.
|
||||
|
||||
A unique identifier which can be used to send ICE candidates Maps to the session name # noqa: E501
|
||||
|
||||
:return: The name of this IceSessionDescription.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this IceSessionDescription.
|
||||
|
||||
A unique identifier which can be used to send ICE candidates Maps to the session name # noqa: E501
|
||||
|
||||
:param name: The name of this IceSessionDescription.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def sdp_type(self) -> str:
|
||||
"""Gets the sdp_type of this IceSessionDescription.
|
||||
|
||||
Used to construct the remote description in WebRTC # noqa: E501
|
||||
|
||||
:return: The sdp_type of this IceSessionDescription.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._sdp_type
|
||||
|
||||
@sdp_type.setter
|
||||
def sdp_type(self, sdp_type: str):
|
||||
"""Sets the sdp_type of this IceSessionDescription.
|
||||
|
||||
Used to construct the remote description in WebRTC # noqa: E501
|
||||
|
||||
:param sdp_type: The sdp_type of this IceSessionDescription.
|
||||
:type sdp_type: str
|
||||
"""
|
||||
|
||||
self._sdp_type = sdp_type
|
||||
|
||||
@property
|
||||
def sdp(self) -> str:
|
||||
"""Gets the sdp of this IceSessionDescription.
|
||||
|
||||
|
||||
:return: The sdp of this IceSessionDescription.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._sdp
|
||||
|
||||
@sdp.setter
|
||||
def sdp(self, sdp: str):
|
||||
"""Sets the sdp of this IceSessionDescription.
|
||||
|
||||
|
||||
:param sdp: The sdp of this IceSessionDescription.
|
||||
:type sdp: str
|
||||
"""
|
||||
|
||||
self._sdp = sdp
|
||||
117
demo_server/openapi_server/models/knock.py
Normal file
117
demo_server/openapi_server/models/knock.py
Normal file
@@ -0,0 +1,117 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.ice_session_description import IceSessionDescription
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.ice_session_description import IceSessionDescription # noqa: E501
|
||||
|
||||
class Knock(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, offer=None, answer=None): # noqa: E501
|
||||
"""Knock - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this Knock. # noqa: E501
|
||||
:type name: str
|
||||
:param offer: The offer of this Knock. # noqa: E501
|
||||
:type offer: IceSessionDescription
|
||||
:param answer: The answer of this Knock. # noqa: E501
|
||||
:type answer: IceSessionDescription
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'offer': IceSessionDescription,
|
||||
'answer': IceSessionDescription
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'offer': 'offer',
|
||||
'answer': 'answer'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._offer = offer
|
||||
self._answer = answer
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'Knock':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The Knock of this Knock. # noqa: E501
|
||||
:rtype: Knock
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Knock.
|
||||
|
||||
|
||||
:return: The name of this Knock.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Knock.
|
||||
|
||||
|
||||
:param name: The name of this Knock.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def offer(self) -> IceSessionDescription:
|
||||
"""Gets the offer of this Knock.
|
||||
|
||||
The service being connected too # noqa: E501
|
||||
|
||||
:return: The offer of this Knock.
|
||||
:rtype: IceSessionDescription
|
||||
"""
|
||||
return self._offer
|
||||
|
||||
@offer.setter
|
||||
def offer(self, offer: IceSessionDescription):
|
||||
"""Sets the offer of this Knock.
|
||||
|
||||
The service being connected too # noqa: E501
|
||||
|
||||
:param offer: The offer of this Knock.
|
||||
:type offer: IceSessionDescription
|
||||
"""
|
||||
|
||||
self._offer = offer
|
||||
|
||||
@property
|
||||
def answer(self) -> IceSessionDescription:
|
||||
"""Gets the answer of this Knock.
|
||||
|
||||
|
||||
:return: The answer of this Knock.
|
||||
:rtype: IceSessionDescription
|
||||
"""
|
||||
return self._answer
|
||||
|
||||
@answer.setter
|
||||
def answer(self, answer: IceSessionDescription):
|
||||
"""Sets the answer of this Knock.
|
||||
|
||||
|
||||
:param answer: The answer of this Knock.
|
||||
:type answer: IceSessionDescription
|
||||
"""
|
||||
|
||||
self._answer = answer
|
||||
63
demo_server/openapi_server/models/list_knocks_response.py
Normal file
63
demo_server/openapi_server/models/list_knocks_response.py
Normal file
@@ -0,0 +1,63 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.knock import Knock
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.knock import Knock # noqa: E501
|
||||
|
||||
class ListKnocksResponse(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, knocks=None): # noqa: E501
|
||||
"""ListKnocksResponse - a model defined in OpenAPI
|
||||
|
||||
:param knocks: The knocks of this ListKnocksResponse. # noqa: E501
|
||||
:type knocks: List[Knock]
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'knocks': List[Knock]
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'knocks': 'knocks'
|
||||
}
|
||||
|
||||
self._knocks = knocks
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'ListKnocksResponse':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The ListKnocksResponse of this ListKnocksResponse. # noqa: E501
|
||||
:rtype: ListKnocksResponse
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def knocks(self) -> List[Knock]:
|
||||
"""Gets the knocks of this ListKnocksResponse.
|
||||
|
||||
|
||||
:return: The knocks of this ListKnocksResponse.
|
||||
:rtype: List[Knock]
|
||||
"""
|
||||
return self._knocks
|
||||
|
||||
@knocks.setter
|
||||
def knocks(self, knocks: List[Knock]):
|
||||
"""Sets the knocks of this ListKnocksResponse.
|
||||
|
||||
|
||||
:param knocks: The knocks of this ListKnocksResponse.
|
||||
:type knocks: List[Knock]
|
||||
"""
|
||||
|
||||
self._knocks = knocks
|
||||
115
demo_server/openapi_server/models/room.py
Normal file
115
demo_server/openapi_server/models/room.py
Normal file
@@ -0,0 +1,115 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.server import Server
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.server import Server # noqa: E501
|
||||
|
||||
class Room(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, display_name=None, servers=None): # noqa: E501
|
||||
"""Room - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this Room. # noqa: E501
|
||||
:type name: str
|
||||
:param display_name: The display_name of this Room. # noqa: E501
|
||||
:type display_name: str
|
||||
:param servers: The servers of this Room. # noqa: E501
|
||||
:type servers: List[Server]
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'display_name': str,
|
||||
'servers': List[Server]
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'display_name': 'displayName',
|
||||
'servers': 'servers'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._display_name = display_name
|
||||
self._servers = servers
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'Room':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The Room of this Room. # noqa: E501
|
||||
:rtype: Room
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Room.
|
||||
|
||||
|
||||
:return: The name of this Room.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Room.
|
||||
|
||||
|
||||
:param name: The name of this Room.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def display_name(self) -> str:
|
||||
"""Gets the display_name of this Room.
|
||||
|
||||
|
||||
:return: The display_name of this Room.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._display_name
|
||||
|
||||
@display_name.setter
|
||||
def display_name(self, display_name: str):
|
||||
"""Sets the display_name of this Room.
|
||||
|
||||
|
||||
:param display_name: The display_name of this Room.
|
||||
:type display_name: str
|
||||
"""
|
||||
|
||||
self._display_name = display_name
|
||||
|
||||
@property
|
||||
def servers(self) -> List[Server]:
|
||||
"""Gets the servers of this Room.
|
||||
|
||||
|
||||
:return: The servers of this Room.
|
||||
:rtype: List[Server]
|
||||
"""
|
||||
return self._servers
|
||||
|
||||
@servers.setter
|
||||
def servers(self, servers: List[Server]):
|
||||
"""Sets the servers of this Room.
|
||||
|
||||
|
||||
:param servers: The servers of this Room.
|
||||
:type servers: List[Server]
|
||||
"""
|
||||
|
||||
self._servers = servers
|
||||
171
demo_server/openapi_server/models/server.py
Normal file
171
demo_server/openapi_server/models/server.py
Normal file
@@ -0,0 +1,171 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.service import Service
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.service import Service # noqa: E501
|
||||
|
||||
class Server(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, rooms=None, auth_token=None, display_name=None, services=None): # noqa: E501
|
||||
"""Server - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this Server. # noqa: E501
|
||||
:type name: str
|
||||
:param rooms: The rooms of this Server. # noqa: E501
|
||||
:type rooms: List[str]
|
||||
:param auth_token: The auth_token of this Server. # noqa: E501
|
||||
:type auth_token: str
|
||||
:param display_name: The display_name of this Server. # noqa: E501
|
||||
:type display_name: str
|
||||
:param services: The services of this Server. # noqa: E501
|
||||
:type services: List[Service]
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'rooms': List[str],
|
||||
'auth_token': str,
|
||||
'display_name': str,
|
||||
'services': List[Service]
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'rooms': 'rooms',
|
||||
'auth_token': 'authToken',
|
||||
'display_name': 'displayName',
|
||||
'services': 'services'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._rooms = rooms
|
||||
self._auth_token = auth_token
|
||||
self._display_name = display_name
|
||||
self._services = services
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'Server':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The Server of this Server. # noqa: E501
|
||||
:rtype: Server
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Server.
|
||||
|
||||
|
||||
:return: The name of this Server.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Server.
|
||||
|
||||
|
||||
:param name: The name of this Server.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def rooms(self) -> List[str]:
|
||||
"""Gets the rooms of this Server.
|
||||
|
||||
Tracks which rooms the server should be listed in; this will not be set when a room is listed to preserve privacy of servers. # noqa: E501
|
||||
|
||||
:return: The rooms of this Server.
|
||||
:rtype: List[str]
|
||||
"""
|
||||
return self._rooms
|
||||
|
||||
@rooms.setter
|
||||
def rooms(self, rooms: List[str]):
|
||||
"""Sets the rooms of this Server.
|
||||
|
||||
Tracks which rooms the server should be listed in; this will not be set when a room is listed to preserve privacy of servers. # noqa: E501
|
||||
|
||||
:param rooms: The rooms of this Server.
|
||||
:type rooms: List[str]
|
||||
"""
|
||||
|
||||
self._rooms = rooms
|
||||
|
||||
@property
|
||||
def auth_token(self) -> str:
|
||||
"""Gets the auth_token of this Server.
|
||||
|
||||
Used to authenticate requests which access knocks for this server or attempt to update, delete or create services. In future calls, add a header with the format: Authorization: Bearer <auth_token> # noqa: E501
|
||||
|
||||
:return: The auth_token of this Server.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._auth_token
|
||||
|
||||
@auth_token.setter
|
||||
def auth_token(self, auth_token: str):
|
||||
"""Sets the auth_token of this Server.
|
||||
|
||||
Used to authenticate requests which access knocks for this server or attempt to update, delete or create services. In future calls, add a header with the format: Authorization: Bearer <auth_token> # noqa: E501
|
||||
|
||||
:param auth_token: The auth_token of this Server.
|
||||
:type auth_token: str
|
||||
"""
|
||||
|
||||
self._auth_token = auth_token
|
||||
|
||||
@property
|
||||
def display_name(self) -> str:
|
||||
"""Gets the display_name of this Server.
|
||||
|
||||
|
||||
:return: The display_name of this Server.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._display_name
|
||||
|
||||
@display_name.setter
|
||||
def display_name(self, display_name: str):
|
||||
"""Sets the display_name of this Server.
|
||||
|
||||
|
||||
:param display_name: The display_name of this Server.
|
||||
:type display_name: str
|
||||
"""
|
||||
|
||||
self._display_name = display_name
|
||||
|
||||
@property
|
||||
def services(self) -> List[Service]:
|
||||
"""Gets the services of this Server.
|
||||
|
||||
|
||||
:return: The services of this Server.
|
||||
:rtype: List[Service]
|
||||
"""
|
||||
return self._services
|
||||
|
||||
@services.setter
|
||||
def services(self, services: List[Service]):
|
||||
"""Sets the services of this Server.
|
||||
|
||||
|
||||
:param services: The services of this Server.
|
||||
:type services: List[Service]
|
||||
"""
|
||||
|
||||
self._services = services
|
||||
113
demo_server/openapi_server/models/service.py
Normal file
113
demo_server/openapi_server/models/service.py
Normal file
@@ -0,0 +1,113 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class Service(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, protocol=None, version=None): # noqa: E501
|
||||
"""Service - a model defined in OpenAPI
|
||||
|
||||
:param name: The name of this Service. # noqa: E501
|
||||
:type name: str
|
||||
:param protocol: The protocol of this Service. # noqa: E501
|
||||
:type protocol: str
|
||||
:param version: The version of this Service. # noqa: E501
|
||||
:type version: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'name': str,
|
||||
'protocol': str,
|
||||
'version': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'protocol': 'protocol',
|
||||
'version': 'version'
|
||||
}
|
||||
|
||||
self._name = name
|
||||
self._protocol = protocol
|
||||
self._version = version
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'Service':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The Service of this Service. # noqa: E501
|
||||
:rtype: Service
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Service.
|
||||
|
||||
|
||||
:return: The name of this Service.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Service.
|
||||
|
||||
|
||||
:param name: The name of this Service.
|
||||
:type name: str
|
||||
"""
|
||||
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def protocol(self) -> str:
|
||||
"""Gets the protocol of this Service.
|
||||
|
||||
|
||||
:return: The protocol of this Service.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._protocol
|
||||
|
||||
@protocol.setter
|
||||
def protocol(self, protocol: str):
|
||||
"""Sets the protocol of this Service.
|
||||
|
||||
|
||||
:param protocol: The protocol of this Service.
|
||||
:type protocol: str
|
||||
"""
|
||||
|
||||
self._protocol = protocol
|
||||
|
||||
@property
|
||||
def version(self) -> str:
|
||||
"""Gets the version of this Service.
|
||||
|
||||
|
||||
:return: The version of this Service.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._version
|
||||
|
||||
@version.setter
|
||||
def version(self, version: str):
|
||||
"""Sets the version of this Service.
|
||||
|
||||
|
||||
:param version: The version of this Service.
|
||||
:type version: str
|
||||
"""
|
||||
|
||||
self._version = version
|
||||
121
demo_server/openapi_server/models/status.py
Normal file
121
demo_server/openapi_server/models/status.py
Normal file
@@ -0,0 +1,121 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server.models.google_protobuf_any import GoogleProtobufAny
|
||||
from openapi_server import util
|
||||
|
||||
from openapi_server.models.google_protobuf_any import GoogleProtobufAny # noqa: E501
|
||||
|
||||
class Status(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, code=None, message=None, details=None): # noqa: E501
|
||||
"""Status - a model defined in OpenAPI
|
||||
|
||||
:param code: The code of this Status. # noqa: E501
|
||||
:type code: int
|
||||
:param message: The message of this Status. # noqa: E501
|
||||
:type message: str
|
||||
:param details: The details of this Status. # noqa: E501
|
||||
:type details: List[GoogleProtobufAny]
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'code': int,
|
||||
'message': str,
|
||||
'details': List[GoogleProtobufAny]
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'code': 'code',
|
||||
'message': 'message',
|
||||
'details': 'details'
|
||||
}
|
||||
|
||||
self._code = code
|
||||
self._message = message
|
||||
self._details = details
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'Status':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The Status of this Status. # noqa: E501
|
||||
:rtype: Status
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def code(self) -> int:
|
||||
"""Gets the code of this Status.
|
||||
|
||||
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. # noqa: E501
|
||||
|
||||
:return: The code of this Status.
|
||||
:rtype: int
|
||||
"""
|
||||
return self._code
|
||||
|
||||
@code.setter
|
||||
def code(self, code: int):
|
||||
"""Sets the code of this Status.
|
||||
|
||||
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. # noqa: E501
|
||||
|
||||
:param code: The code of this Status.
|
||||
:type code: int
|
||||
"""
|
||||
|
||||
self._code = code
|
||||
|
||||
@property
|
||||
def message(self) -> str:
|
||||
"""Gets the message of this Status.
|
||||
|
||||
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. # noqa: E501
|
||||
|
||||
:return: The message of this Status.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._message
|
||||
|
||||
@message.setter
|
||||
def message(self, message: str):
|
||||
"""Sets the message of this Status.
|
||||
|
||||
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. # noqa: E501
|
||||
|
||||
:param message: The message of this Status.
|
||||
:type message: str
|
||||
"""
|
||||
|
||||
self._message = message
|
||||
|
||||
@property
|
||||
def details(self) -> List[GoogleProtobufAny]:
|
||||
"""Gets the details of this Status.
|
||||
|
||||
A list of messages that carry the error details. There is a common set of message types for APIs to use. # noqa: E501
|
||||
|
||||
:return: The details of this Status.
|
||||
:rtype: List[GoogleProtobufAny]
|
||||
"""
|
||||
return self._details
|
||||
|
||||
@details.setter
|
||||
def details(self, details: List[GoogleProtobufAny]):
|
||||
"""Sets the details of this Status.
|
||||
|
||||
A list of messages that carry the error details. There is a common set of message types for APIs to use. # noqa: E501
|
||||
|
||||
:param details: The details of this Status.
|
||||
:type details: List[GoogleProtobufAny]
|
||||
"""
|
||||
|
||||
self._details = details
|
||||
Reference in New Issue
Block a user