Skip to content

Commit

Permalink
emulation_port_observation_state.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nforsg committed Aug 17, 2023
1 parent b568282 commit aa220d4
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 aa220d4

Please sign in to comment.