Skip to content

Commit

Permalink
Merge pull request #216 from Limmen/dev
Browse files Browse the repository at this point in the history
emulation_port_observation_state.py
  • Loading branch information
Limmen authored Aug 17, 2023
2 parents 2e28a83 + aa220d4 commit fecdfd3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["port"] = self.port
d["open"] = self.open
d["service"] = self.service
Expand All @@ -53,7 +53,7 @@ def to_dict(self) -> Dict[str, Any]:
return d

@staticmethod
def from_dict(d: Union[Dict[str, Any], None]) -> "EmulationPortObservationState":
def from_dict(d: Union[Dict[str, Any], None]) -> Union[None, "EmulationPortObservationState"]:
"""
Converts a dict representation of the object to an instance
Expand Down Expand Up @@ -93,7 +93,7 @@ def to_network_service(self) -> NetworkService:
return service

@staticmethod
def from_network_service(network_service: NetworkService, service_lookup: dict) -> "EmulationPortObservationState":
def from_network_service(network_service: NetworkService, service_lookup: Dict[str, str]) -> "EmulationPortObservationState":
"""
Converts a network service into a port observation state
Expand Down Expand Up @@ -145,5 +145,5 @@ def schema() -> "EmulationPortObservationState":
"""
:return: get the schema of the DTO
"""
return EmulationPortObservationState(port=-1, open=True, service=-1, protocol=TransportProtocol.TCP,
return EmulationPortObservationState(port=-1, open=True, service="", protocol=TransportProtocol.TCP,
http_enum="", http_grep="", vulscan="", version="", fingerprint="")

0 comments on commit fecdfd3

Please sign in to comment.