id
int64
0
843k
repository_name
stringlengths
7
55
file_path
stringlengths
9
332
class_name
stringlengths
3
290
human_written_code
stringlengths
12
4.36M
class_skeleton
stringlengths
19
2.2M
total_program_units
int64
1
9.57k
total_doc_str
int64
0
4.2k
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
300
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
176
CountClassBase
float64
0
48
CountClassCoupled
float64
0
589
CountClassCoupledModified
float64
0
581
CountClassDerived
float64
0
5.37k
CountDeclInstanceMethod
float64
0
4.2k
CountDeclInstanceVariable
float64
0
299
CountDeclMethod
float64
0
4.2k
CountDeclMethodAll
float64
0
4.2k
CountLine
float64
1
115k
CountLineBlank
float64
0
9.01k
CountLineCode
float64
0
94.4k
CountLineCodeDecl
float64
0
46.1k
CountLineCodeExe
float64
0
91.3k
CountLineComment
float64
0
27k
CountStmt
float64
1
93.2k
CountStmtDecl
float64
0
46.1k
CountStmtExe
float64
0
90.2k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
6k
141,248
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDeviceRadioTable
class TypedDeviceRadioTable(TypedDict): """Device radio table type definition.""" antenna_gain: int builtin_ant_gain: int builtin_antenna: bool channel: int current_antenna_gain: int hard_noise_floor_enabled: bool has_dfs: bool has_fccdfs: bool ht: str is_11ac: bool max_txpower: int min_rssi_enabled: bool min_txpower: int name: str nss: int radio: str radio_caps: int sens_level_enabled: bool tx_power_mode: str wlangroup_id: str
class TypedDeviceRadioTable(TypedDict): '''Device radio table type definition.'''
1
1
0
0
0
0
0
0.05
1
0
0
0
0
0
0
0
23
1
21
1
20
1
21
1
20
0
1
0
0
141,249
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDevicePortTablePortDelta
class TypedDevicePortTablePortDelta(TypedDict): """Device port table port delta type definition.""" rx_bytes: int rx_packets: int time_delta: int time_delta_activity: int tx_bytes: int tx_packets: int
class TypedDevicePortTablePortDelta(TypedDict): '''Device port table port delta type definition.'''
1
1
0
0
0
0
0
0.14
1
0
0
0
0
0
0
0
9
1
7
1
6
1
7
1
6
0
1
0
0
141,250
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDevicePortTableMacTable
class TypedDevicePortTableMacTable(TypedDict): """Device port table mac table type definition.""" age: int mac: str static: bool uptime: int vlan: int
class TypedDevicePortTableMacTable(TypedDict): '''Device port table mac table type definition.'''
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,251
Kane610/aiounifi
aiounifi/models/port_forward.py
aiounifi.models.port_forward.TypedPortForward
class TypedPortForward(TypedDict): """Port forward type definition.""" _id: str dst_port: str enabled: NotRequired[bool] fwd_port: str fwd: str name: str pfwd_interface: str proto: str site_id: str src: str
class TypedPortForward(TypedDict): '''Port forward type definition.'''
1
1
0
0
0
0
0
0.09
1
0
0
0
0
0
0
0
13
1
11
1
10
1
11
1
10
0
1
0
0
141,252
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDevicePortTableLldpTable
class TypedDevicePortTableLldpTable(TypedDict): """Device port table mac table type definition.""" lldp_chassis_id: str lldp_port_id: str lldp_system_name: str
class TypedDevicePortTableLldpTable(TypedDict): '''Device port table mac table type definition.'''
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
141,253
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDeviceUptimeStatsWanMonitor
class TypedDeviceUptimeStatsWanMonitor(TypedDict): """Device uptime stats wan monitor type definition.""" availability: float latency_average: NotRequired[int] target: str type: str
class TypedDeviceUptimeStatsWanMonitor(TypedDict): '''Device uptime stats wan monitor type definition.'''
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
0
7
1
5
1
4
1
5
1
4
0
1
0
0
141,254
Kane610/aiounifi
aiounifi/models/dpi_restriction_app.py
aiounifi.models.dpi_restriction_app.DPIRestrictionApp
class DPIRestrictionApp(ApiItem): """Represents a DPI App configuration.""" raw: TypedDPIRestrictionApp @property def id(self) -> str: """DPI app ID.""" return self.raw["_id"] @property def apps(self) -> list[str]: """List of apps.""" return self.raw["apps"] @property def blocked(self) -> bool: """Is blocked.""" return self.raw["blocked"] @property def cats(self) -> list[str]: """Categories.""" return self.raw["cats"] @property def enabled(self) -> bool: """Is enabled.""" return self.raw["enabled"] @property def log(self) -> bool: """Is logging enabled.""" return self.raw["log"] @property def site_id(self) -> str: """Site ID.""" return self.raw["site_id"]
class DPIRestrictionApp(ApiItem): '''Represents a DPI App configuration.''' @property def id(self) -> str: '''DPI app ID.''' pass @property def apps(self) -> list[str]: '''List of apps.''' pass @property def blocked(self) -> bool: '''Is blocked.''' pass @property def cats(self) -> list[str]: '''Categories.''' pass @property def enabled(self) -> bool: '''Is enabled.''' pass @property def log(self) -> bool: '''Is logging enabled.''' pass @property def site_id(self) -> str: '''Site ID.''' pass
15
8
3
0
2
1
1
0.35
1
3
0
0
7
0
7
28
39
8
23
15
8
8
16
8
8
1
5
0
7
141,255
Kane610/aiounifi
aiounifi/models/device.py
aiounifi.models.device.TypedDeviceWlanOverrides
class TypedDeviceWlanOverrides(TypedDict): """Device wlan overrides type definition.""" name: str radio: str radio_name: str wlan_id: str
class TypedDeviceWlanOverrides(TypedDict): '''Device wlan overrides type definition.'''
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
0
7
1
5
1
4
1
5
1
4
0
1
0
0
141,256
Kane610/aiounifi
aiounifi/models/event.py
aiounifi.models.event.EventKey
class EventKey(enum.Enum): """Key as part of event data object. "data": [{"key": "EVT_LU_Disconnected"}]. """ CONTROLLER_UPDATE_AVAILABLE = "EVT_AD_Update_Available" ACCESS_POINT_ADOPTED = "EVT_AP_Adopted" ACCESS_POINT_AUTO_READOPTED = "EVT_AP_AutoReadopted" ACCESS_POINT_CHANNEL_CHANGED = "EVT_AP_ChannelChanged" ACCESS_POINT_CONFIGURED = "EVT_AP_Configured" ACCESS_POINT_CONNECTED = "EVT_AP_Connected" ACCESS_POINT_DELETED = "EVT_AP_Deleted" ACCESS_POINT_DETECT_ROGUE_AP = "EVT_AP_DetectRogueAP" ACCESS_POINT_DISCOVERED_PENDING = "EVT_AP_DiscoveredPending" ACCESS_POINT_ISOLATED = "EVT_AP_Isolated" ACCESS_POINT_LOST_CONTACT = "EVT_AP_Lost_Contact" ACCESS_POINT_POSSIBLE_INTERFERENCE = "EVT_AP_PossibleInterference" ACCESS_POINT_RADAR_DETECTED = "EVT_AP_RadarDetected" ACCESS_POINT_RESTARTED = "EVT_AP_Restarted" ACCESS_POINT_RESTARTED_UNKNOWN = "EVT_AP_RestartedUnknown" ACCESS_POINT_UPGRADE_SCHEDULED = "EVT_AP_UpgradeScheduled" ACCESS_POINT_UPGRADE_FAILED = "EVT_AP_UpgradeFailed" ACCESS_POINT_UPGRADED = "EVT_AP_Upgraded" DREAM_MACHINE_CONNECTED = "EVT_DM_Connected" DREAM_MACHINE_LOST_CONTACT = "EVT_DM_Lost_Contact" DREAM_MACHINE_UPGRADED = "EVT_DM_Upgraded" GATEWAY_ADOPTED = "EVT_GW_Adopted" GATEWAY_AUTO_READOPTED = "EVT_GW_AutoReadopted" GATEWAY_CONFIGURED = "EVT_GW_Configured" GATEWAY_CONNECTED = "EVT_GW_Connected" GATEWAY_DELETED = "EVT_GW_Deleted" GATEWAY_LOST_CONTACT = "EVT_GW_Lost_Contact" GATEWAY_RESTARTED = "EVT_GW_Restarted" GATEWAY_RESTARTED_UNKNOWN = "EVT_GW_RestartedUnknown" GATEWAY_UPGRADED = "EVT_GW_Upgraded" GATEWAY_WAN_TRANSITION = "EVT_GW_WANTransition" SWITCH_ADOPTED = "EVT_SW_Adopted" SWITCH_AUTO_READOPTED = "EVT_SW_AutoReadopted" SWITCH_CONFIGURED = "EVT_SW_Configured" SWITCH_CONNECTED = "EVT_SW_Connected" SWITCH_DELETED = "EVT_SW_Deleted" SWITCH_DETECT_ROGUE_DHCP = "EVT_SW_DetectRogueDHCP" SWITCH_DISCOVERED_PENDING = "EVT_SW_DiscoveredPending" SWITCH_LOST_CONTACT = "EVT_SW_Lost_Contact" SWITCH_OVERHEAT = "EVT_SW_Overheat" SWITCH_POE_OVERLOAD = "EVT_SW_PoeOverload" SWITCH_POE_DISCONNECT = "EVT_SW_PoeDisconnect" SWITCH_RESTARTED = "EVT_SW_Restarted" SWITCH_RESTARTED_UNKNOWN = "EVT_SW_RestartedUnknown" SWITCH_STP_PORT_BLOCKING = "EVT_SW_StpPortBlocking" SWITCH_UPGRADE_SCHEDULED = "EVT_SW_UpgradeScheduled" SWITCH_UPGRADED = "EVT_SW_Upgraded" VOUCHER_CREATED = "EVT_AD_VoucherCreated" VOUCHER_DELETED = "EVT_AD_VoucherDeleted" WIRED_CLIENT_CONNECTED = "EVT_LU_Connected" WIRED_CLIENT_DISCONNECTED = "EVT_LU_Disconnected" WIRED_CLIENT_BLOCKED = "EVT_LC_Blocked" WIRED_CLIENT_UNBLOCKED = "EVT_LC_Unblocked" WIRELESS_CLIENT_CONNECTED = "EVT_WU_Connected" WIRELESS_CLIENT_DISCONNECTED = "EVT_WU_Disconnected" WIRELESS_CLIENT_BLOCKED = "EVT_WC_Blocked" WIRELESS_CLIENT_UNBLOCKED = "EVT_WC_Unblocked" WIRELESS_CLIENT_ROAM = "EVT_WU_Roam" WIRELESS_CLIENT_ROAM_RADIO = "EVT_WU_RoamRadio" WIRED_GUEST_CONNECTED = "EVT_LG_Connected" WIRED_GUEST_DISCONNECTED = "EVT_LG_Disconnected" WIRELESS_GUEST_AUTHENTICATION_ENDED = "EVT_WG_AuthorizationEnded" WIRELESS_GUEST_CONNECTED = "EVT_WG_Connected" WIRELESS_GUEST_DISCONNECTED = "EVT_WG_Disconnected" WIRELESS_GUEST_ROAM = "EVT_WG_Roam" WIRELESS_GUEST_ROAM_RADIO = "EVT_WG_RoamRadio" XG_AUTO_READOPTED = "EVT_XG_AutoReadopted" XG_CONNECTED = "EVT_XG_Connected" XG_LOST_CONTACT = "EVT_XG_Lost_Contact" XG_OUTLET_POWER_CYCLE = "EVT_XG_OutletPowerCycle" IPS_ALERT = "EVT_IPS_IpsAlert" AD_GUEST_UNAUTHORIZED = "EVT_AD_GuestUnauthorized" AD_LOGIN = "EVT_AD_Login" AD_SCHEDULE_UPGRADE_FAILED_NOT_FOUND = "EVT_AD_ScheduleUpgradeFailedNotFound" HOT_SPOT_AUTHED_BY_NO_AUTH = "EVT_HS_AuthedByNoAuth" HOT_SPOT_AUTHED_BY_PASSWORD = "EVT_HS_AuthedByPassword" HOT_SPOT_VOUCHER_USED = "EVT_HS_VoucherUsed" USP_RPS_POWER_DENIED_BY_PSU_OVERLOAD = "EVT_USP_RpsPowerDeniedByPsuOverload" UNKNOWN = "unknown" @classmethod def _missing_(cls, value: object) -> EventKey: """Set default enum member if an unknown value is provided.""" LOGGER.warning("Unsupported event key %s", value) return EventKey.UNKNOWN
class EventKey(enum.Enum): '''Key as part of event data object. "data": [{"key": "EVT_LU_Disconnected"}]. ''' @classmethod def _missing_(cls, value: object) -> EventKey: '''Set default enum member if an unknown value is provided.''' pass
3
2
4
0
3
1
1
0.05
1
1
0
0
0
0
1
50
104
16
84
82
81
4
83
81
81
1
4
0
1
141,257
Kane610/aiounifi
aiounifi/models/port.py
aiounifi.models.port.Port
class Port(ApiItem): """Represents a network port.""" raw: TypedDevicePortTable @property def ifname(self) -> str | None: """Port name used by USG.""" return self.raw.get("ifname") @property def media(self) -> str | None: """Media port is connected to.""" return self.raw.get("media") @property def name(self) -> str: """Port name.""" if (name := self.raw["name"]) == "": # Unifi controller allows to set an empty port name, but it # shows up as "Port N" consistently across UI. We mirror the # behavior, as empty name is rarely visually helpful. return f"Port {self.port_idx}" return name @property def port_idx(self) -> int | None: """Port index.""" return self.raw.get("port_idx") @property def poe_caps(self) -> int | None: """Port PoE capabilities. 0 - no caps 3 - auto (PoE/PoE+) 35 - auto (Poe/PoE+/PoE++) 7 - 24V passive 8 - Passthrough """ return self.raw.get("poe_caps") @property def poe_class(self) -> str | None: """Port PoE class.""" return self.raw.get("poe_class") @property def poe_enable(self) -> bool | None: """Is PoE supported/requested by client.""" return self.raw.get("poe_enable") @property def poe_mode(self) -> str | None: """Is PoE auto, pasv24, passthrough, off or None.""" return self.raw.get("poe_mode") @property def poe_power(self) -> str | None: """Is PoE power usage.""" return self.raw.get("poe_power") @property def poe_voltage(self) -> str | None: """Is PoE voltage usage.""" return self.raw.get("poe_voltage") @property def portconf_id(self) -> str | None: """Port configuration ID.""" return self.raw.get("portconf_id") @property def port_poe(self) -> bool | None: """Is PoE used.""" return self.raw.get("port_poe") @property def rx_bytes(self) -> int: """Bytes received.""" return self.raw.get("rx_bytes", 0) @property def rx_bytes_r(self) -> int: """Bytes recently received.""" return cast(int, self.raw.get("rx_bytes-r", 0)) @property def tx_bytes(self) -> int: """Bytes transferred.""" return self.raw.get("tx_bytes", 0) @property def tx_bytes_r(self) -> int: """Bytes recently transferred.""" return cast(int, self.raw.get("tx_bytes-r", 0)) @property def up(self) -> bool | None: """Is port up.""" return self.raw.get("up") def __repr__(self) -> str: """Return the representation.""" return f"<{self.name}: Poe {self.poe_enable}>"
class Port(ApiItem): '''Represents a network port.''' @property def ifname(self) -> str | None: '''Port name used by USG.''' pass @property def media(self) -> str | None: '''Media port is connected to.''' pass @property def name(self) -> str: '''Port name.''' pass @property def port_idx(self) -> int | None: '''Port index.''' pass @property def poe_caps(self) -> int | None: '''Port PoE capabilities. 0 - no caps 3 - auto (PoE/PoE+) 35 - auto (Poe/PoE+/PoE++) 7 - 24V passive 8 - Passthrough ''' pass @property def poe_class(self) -> str | None: '''Port PoE class.''' pass @property def poe_enable(self) -> bool | None: '''Is PoE supported/requested by client.''' pass @property def poe_mode(self) -> str | None: '''Is PoE auto, pasv24, passthrough, off or None.''' pass @property def poe_power(self) -> str | None: '''Is PoE power usage.''' pass @property def poe_voltage(self) -> str | None: '''Is PoE voltage usage.''' pass @property def portconf_id(self) -> str | None: '''Port configuration ID.''' pass @property def port_poe(self) -> bool | None: '''Is PoE used.''' pass @property def rx_bytes(self) -> int: '''Bytes received.''' pass @property def rx_bytes_r(self) -> int: '''Bytes recently received.''' pass @property def tx_bytes(self) -> int: '''Bytes transferred.''' pass @property def tx_bytes_r(self) -> int: '''Bytes recently transferred.''' pass @property def up(self) -> bool | None: '''Is port up.''' pass def __repr__(self) -> str: '''Return the representation.''' pass
36
19
4
0
2
2
1
0.49
1
3
0
0
18
0
18
39
105
20
57
37
21
28
40
19
21
2
5
1
19
141,258
Kane610/aiounifi
aiounifi/models/outlet.py
aiounifi.models.outlet.Outlet
class Outlet(ApiItem): """Represents an outlet.""" raw: TypedDeviceOutletTable @property def name(self) -> str: """Name of outlet.""" return self.raw["name"] @property def index(self) -> int: """Outlet index.""" return self.raw["index"] @property def has_relay(self) -> bool | None: """Is the outlet controllable. Not reported by USP-PDU-Pro, see caps. """ return self.raw.get("has_relay") @property def relay_state(self) -> bool: """Is outlet power on.""" return self.raw["relay_state"] @property def cycle_enabled(self) -> bool | None: """Modem Power Cycle.""" return self.raw.get("cycle_enabled") # Metering capabilities of outlet @property def has_metering(self) -> bool | None: """Is metering supported. Reported false by UP1 and UP6 which does not have power metering. Not reported by by USP-PDU-Pro, see caps. """ return self.raw.get("has_metering") @property def caps(self) -> int | None: """Outlet capabilities. 1: Outlet supports relay (switching) 3: Outlet supports relay and metering """ return self.raw.get("outlet_caps") @property def voltage(self) -> str | None: """Voltage draw of outlet.""" return self.raw.get("outlet_voltage") @property def current(self) -> str | None: """Usage of outlet.""" return self.raw.get("outlet_current") @property def power(self) -> str | None: """Power consumption of the outlet.""" return self.raw.get("outlet_power") @property def power_factor(self) -> str | None: """Power factor.""" return self.raw.get("outlet_power_factor") def __repr__(self) -> str: """Return the representation.""" return f"<{self.name}: relay state {self.relay_state}>"
class Outlet(ApiItem): '''Represents an outlet.''' @property def name(self) -> str: '''Name of outlet.''' pass @property def index(self) -> int: '''Outlet index.''' pass @property def has_relay(self) -> bool | None: '''Is the outlet controllable. Not reported by USP-PDU-Pro, see caps. ''' pass @property def relay_state(self) -> bool: '''Is outlet power on.''' pass @property def cycle_enabled(self) -> bool | None: '''Modem Power Cycle.''' pass @property def has_metering(self) -> bool | None: '''Is metering supported. Reported false by UP1 and UP6 which does not have power metering. Not reported by by USP-PDU-Pro, see caps. ''' pass @property def caps(self) -> int | None: '''Outlet capabilities. 1: Outlet supports relay (switching) 3: Outlet supports relay and metering ''' pass @property def voltage(self) -> str | None: '''Voltage draw of outlet.''' pass @property def current(self) -> str | None: '''Usage of outlet.''' pass @property def power(self) -> str | None: '''Power consumption of the outlet.''' pass @property def power_factor(self) -> str | None: '''Power factor.''' pass def __repr__(self) -> str: '''Return the representation.''' pass
24
13
4
0
2
2
1
0.59
1
3
0
0
12
0
12
33
76
17
37
24
13
22
26
13
13
1
5
0
12
141,259
Kane610/aiounifi
aiounifi/models/message.py
aiounifi.models.message.Meta
class Meta: """Meta description of UniFi websocket data.""" rc: str message: MessageKey data: dict[str, Any] @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: """Create meta instance from dict.""" return cls( rc=data.get("rc", ""), message=MessageKey(data.get("message", "")), data=data, )
class Meta: '''Meta description of UniFi websocket data.''' @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: '''Create meta instance from dict.''' pass
3
2
7
0
6
1
1
0.18
0
4
1
0
0
0
1
1
15
2
11
3
8
2
6
2
4
1
0
0
1
141,260
Kane610/aiounifi
aiounifi/models/message.py
aiounifi.models.message.MessageKey
class MessageKey(enum.Enum): """Message as part of meta object of event. "meta": {"rc": "ok", "message": "device:sync"}. """ ALERT = "alert" EVENT = "events" CLIENT = "sta:sync" CLIENT_REMOVED = "user:delete" CLIENT_UPDATED = "user:sync" DEVICE = "device:sync" DEVICE_ADD = "device:add" DEVICE_UPDATE = "device:update" DPI_APP_ADDED = "dpiapp:add" DPI_APP_REMOVED = "dpiapp:delete" DPI_APP_UPDATED = "dpiapp:sync" DPI_GROUP_ADDED = "dpigroup:add" DPI_GROUP_REMOVED = "dpigroup:delete" DPI_GROUP_UPDATED = "dpigroup:sync" FIREWALL_GROUP_ADDED = "firewallgroup:add" FIREWALL_RULE_ADDED = "firewallrule:add" FIREWALL_RULE_UPDATED = "firewallrule:sync" NETWORK_CONF_UPDATED = "networkconf:sync" NOTIFICATION_TOAST = "notification-toast" PING_TEST_UPDATE = "ping-test:update" PORT_FORWARD_ADDED = "portforward:add" PORT_FORWARD_UPDATED = "portforward:sync" PORT_FORWARD_DELETED = "portforward:delete" SCHEDULE_TASK_ADDED = "scheduletask:add" SESSION_METADATA = "session-metadata:sync" SETTING_UPDATED = "setting:sync" SETUP_SYNC = "setup:sync" SPEED_TEST_UPDATE = "speed-test:update" UNIFI_DEVICE = "unifi-device:sync" UNIFI_DEVICE_ADD = "unifi-device:add" USER_GROUP_UPDATED = "usergroup:sync" VPN_CONNECT = "vpn:connect" VPN_DISCONNECT = "vpn:disconnect" VPN_CONNECTION_UPDATED = "vpn-connection:sync" WLAN_CONF_ADDED = "wlanconf:add" WLAN_CONF_UPDATED = "wlanconf:sync" WLAN_CONF_DELETED = "wlanconf:delete" UNKNOWN = "unknown" @classmethod def _missing_(cls, value: object) -> MessageKey: """Set default enum member if an unknown value is provided.""" LOGGER.warning("Unsupported message key %s", value) return MessageKey.UNKNOWN
class MessageKey(enum.Enum): '''Message as part of meta object of event. "meta": {"rc": "ok", "message": "device:sync"}. ''' @classmethod def _missing_(cls, value: object) -> MessageKey: '''Set default enum member if an unknown value is provided.''' pass
3
2
4
0
3
1
1
0.09
1
1
0
0
0
0
1
50
52
5
43
41
40
4
42
40
40
1
4
0
1
141,261
Kane610/aiounifi
aiounifi/models/message.py
aiounifi.models.message.Message
class Message: """Websocket package representation.""" meta: Meta data: dict[str, Any] @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: """Create data container instance from dict.""" meta = Meta.from_dict(data["meta"]) if meta.message is MessageKey.UNKNOWN: LOGGER.warning("Unsupported message %s", data) return cls( meta=meta, data=data["data"], )
class Message: '''Websocket package representation.''' @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: '''Create data container instance from dict.''' pass
3
2
9
0
8
1
2
0.17
0
5
2
0
0
0
1
1
16
2
12
4
9
2
8
3
6
2
0
1
2
141,262
Kane610/aiounifi
aiounifi/models/dpi_restriction_app.py
aiounifi.models.dpi_restriction_app.DPIRestrictionAppEnableRequest
class DPIRestrictionAppEnableRequest(ApiRequest): """Request object for enabling DPI Restriction App.""" @classmethod def create(cls, app_id: str, enable: bool) -> Self: """Create enabling DPI Restriction App request.""" return cls( method="put", path=f"/rest/dpiapp/{app_id}", data={"enabled": enable}, )
class DPIRestrictionAppEnableRequest(ApiRequest): '''Request object for enabling DPI Restriction App.''' @classmethod def create(cls, app_id: str, enable: bool) -> Self: '''Create enabling DPI Restriction App request.''' pass
3
2
7
0
6
1
1
0.25
1
2
0
0
0
0
1
3
11
1
8
3
5
2
3
2
1
1
1
0
1
141,263
Kane610/aiounifi
aiounifi/models/event.py
aiounifi.models.event.TypedEvent
class TypedEvent(TypedDict): """Event type definition.""" _id: str ap: str bytes: int channel: int client: str datetime: str duration: int guest: str gw: str hostname: str key: str msg: str network: str radio: str site_id: str ssid: str sw: str sw_name: str subsystem: str time: int user: str version_from: str version_to: str
class TypedEvent(TypedDict): '''Event type definition.'''
1
1
0
0
0
0
0
0.04
1
0
0
0
0
0
0
0
26
1
24
1
23
1
24
1
23
0
1
0
0
141,264
Kane610/aiounifi
aiounifi/models/port_forward.py
aiounifi.models.port_forward.PortForward
class PortForward(ApiItem): """Represents a port forward configuration.""" raw: TypedPortForward @property def id(self) -> str: """Unique ID of port forward.""" return self.raw["_id"] @property def destination_port(self) -> str: """Destination port.""" return self.raw["dst_port"] @property def enabled(self) -> bool: """Is port forward enabled.""" return self.raw.get("enabled", False) @property def forward_port(self) -> str: """Forwarded port.""" return self.raw["fwd_port"] @property def forward_ip(self) -> str: """IP address to forward.""" return self.raw["fwd"] @property def name(self) -> str: """Name of port forward.""" return self.raw["name"] @property def port_forward_interface(self) -> str: """Interface to expose port forward.""" return self.raw["pfwd_interface"] @property def protocol(self) -> str: """Protocol to forward. tcp_udp """ return self.raw["proto"] @property def site_id(self) -> str: """Site id port forward belongs to.""" return self.raw["site_id"] @property def source(self) -> str: """Source.""" return self.raw["src"]
class PortForward(ApiItem): '''Represents a port forward configuration.''' @property def id(self) -> str: '''Unique ID of port forward.''' pass @property def destination_port(self) -> str: '''Destination port.''' pass @property def enabled(self) -> bool: '''Is port forward enabled.''' pass @property def forward_port(self) -> str: '''Forwarded port.''' pass @property def forward_ip(self) -> str: '''IP address to forward.''' pass @property def name(self) -> str: '''Name of port forward.''' pass @property def port_forward_interface(self) -> str: '''Interface to expose port forward.''' pass @property def protocol(self) -> str: '''Protocol to forward. tcp_udp ''' pass @property def site_id(self) -> str: '''Site id port forward belongs to.''' pass @property def source(self) -> str: '''Source.''' pass
21
11
3
0
2
1
1
0.41
1
2
0
0
10
0
10
31
57
12
32
21
11
13
22
11
11
1
5
0
10
141,265
Kane610/aiounifi
aiounifi/models/port_forward.py
aiounifi.models.port_forward.PortForwardEnableRequest
class PortForwardEnableRequest(ApiRequest): """Request object for enabling port forward.""" @classmethod def create(cls, port_forward: "PortForward", enable: bool) -> Self: """Create enable port forward request.""" data = port_forward.raw.copy() data["enabled"] = enable return cls( method="put", path=f"/rest/portforward/{data['_id']}", data=data, )
class PortForwardEnableRequest(ApiRequest): '''Request object for enabling port forward.''' @classmethod def create(cls, port_forward: "PortForward", enable: bool) -> Self: '''Create enable port forward request.''' pass
3
2
9
0
8
1
1
0.2
1
1
0
0
0
0
1
3
13
1
10
4
7
2
5
3
3
1
1
0
1
141,266
Kane610/aiounifi
aiounifi/models/dpi_restriction_group.py
aiounifi.models.dpi_restriction_group.TypedDPIRestrictionGroup
class TypedDPIRestrictionGroup(TypedDict): """DPI restriction group type definition.""" _id: str attr_no_delete: NotRequired[bool] attr_hidden_id: str name: str site_id: str dpiapp_ids: NotRequired[list[str]]
class TypedDPIRestrictionGroup(TypedDict): '''DPI restriction group type definition.'''
1
1
0
0
0
0
0
0.14
1
0
0
0
0
0
0
0
9
1
7
1
6
1
7
1
6
0
1
0
0
141,267
Kane610/aiounifi
aiounifi/models/dpi_restriction_group.py
aiounifi.models.dpi_restriction_group.DpiRestrictionGroupListRequest
class DpiRestrictionGroupListRequest(ApiRequest): """Request object for DPI restriction group list.""" @classmethod def create(cls) -> Self: """Create DPI restriction group list request.""" return cls(method="get", path="/rest/dpigroup")
class DpiRestrictionGroupListRequest(ApiRequest): '''Request object for DPI restriction group list.''' @classmethod def create(cls) -> Self: '''Create DPI restriction group list request.''' pass
3
2
3
0
2
1
1
0.5
1
0
0
0
0
0
1
3
7
1
4
3
1
2
3
2
1
1
1
0
1
141,268
Kane610/aiounifi
aiounifi/models/dpi_restriction_group.py
aiounifi.models.dpi_restriction_group.DPIRestrictionGroup
class DPIRestrictionGroup(ApiItem): """Represents a DPI Group configuration.""" raw: TypedDPIRestrictionGroup @property def id(self) -> str: """DPI group ID.""" return self.raw["_id"] @property def attr_no_delete(self) -> bool | None: """Can be deleted.""" return self.raw.get("attr_no_delete") @property def attr_hidden_id(self) -> str: """Attr hidden ID.""" return self.raw.get("attr_hidden_id", "") @property def name(self) -> str: """DPI group name.""" return self.raw["name"] @property def site_id(self) -> str: """Site ID.""" return self.raw["site_id"] @property def dpiapp_ids(self) -> list[str] | None: """DPI app IDs belonging to group.""" return self.raw.get("dpiapp_ids")
class DPIRestrictionGroup(ApiItem): '''Represents a DPI Group configuration.''' @property def id(self) -> str: '''DPI group ID.''' pass @property def attr_no_delete(self) -> bool | None: '''Can be deleted.''' pass @property def attr_hidden_id(self) -> str: '''Attr hidden ID.''' pass @property def name(self) -> str: '''DPI group name.''' pass @property def site_id(self) -> str: '''Site ID.''' pass @property def dpiapp_ids(self) -> list[str] | None: '''DPI app IDs belonging to group.''' pass
13
7
3
0
2
1
1
0.35
1
3
0
0
6
0
6
27
34
7
20
13
7
7
14
7
7
1
5
0
6
141,269
Kane610/aiounifi
aiounifi/models/dpi_restriction_app.py
aiounifi.models.dpi_restriction_app.TypedDPIRestrictionApp
class TypedDPIRestrictionApp(TypedDict): """DPI restriction app type definition.""" _id: str apps: list[str] blocked: bool cats: list[str] enabled: bool log: bool site_id: str
class TypedDPIRestrictionApp(TypedDict): '''DPI restriction app type definition.'''
1
1
0
0
0
0
0
0.13
1
0
0
0
0
0
0
0
10
1
8
1
7
1
8
1
7
0
1
0
0
141,270
Kane610/aiounifi
aiounifi/models/dpi_restriction_app.py
aiounifi.models.dpi_restriction_app.DpiRestrictionAppListRequest
class DpiRestrictionAppListRequest(ApiRequest): """Request object for DPI restriction app list.""" @classmethod def create(cls) -> Self: """Create DPI restriction app list request.""" return cls(method="get", path="/rest/dpiapp")
class DpiRestrictionAppListRequest(ApiRequest): '''Request object for DPI restriction app list.''' @classmethod def create(cls) -> Self: '''Create DPI restriction app list request.''' pass
3
2
3
0
2
1
1
0.5
1
0
0
0
0
0
1
3
7
1
4
3
1
2
3
2
1
1
1
0
1
141,271
Kane610/aiounifi
aiounifi/models/event.py
aiounifi.models.event.Event
class Event(ApiItem): """UniFi event.""" raw: TypedEvent @property def datetime(self) -> str: """Datetime of event '2020-03-01T15:35:08Z'.""" return self.raw["datetime"] @property def key(self) -> EventKey: """Event key e.g. 'EVT_WU_Disconnected'.""" key = EventKey(self.raw["key"]) if key == EventKey.UNKNOWN: LOGGER.warning("Unsupported event %s", self.raw) return key @property def event(self) -> str: """Event key e.g. 'EVT_WU_Disconnected'. To be removed. """ return self.raw["key"] @property def msg(self) -> str: """Event message.""" return self.raw["msg"] @property def time(self) -> int: """Time of event 1583076908000.""" return self.raw["time"] @property def mac(self) -> str: """MAC of client or device.""" if self.client: return self.client if self.device: return self.device return "" @property def ap(self) -> str: """Access point connected to.""" return self.raw.get("ap", "") @property def bytes(self) -> int: """Bytes of data consumed.""" return self.raw.get("bytes", 0) @property def channel(self) -> int: """Wi-Fi channel.""" return self.raw.get("channel", 0) @property def client(self) -> str: """MAC address of client.""" return ( self.raw.get("user") or self.raw.get("client") or self.raw.get("guest") or "" ) @property def device(self) -> str: """MAC address of device.""" return self.raw.get("ap") or self.raw.get("gw") or self.raw.get("sw") or "" @property def duration(self) -> int: """Duration.""" return self.raw.get("duration", 0) @property def hostname(self) -> str: """Nice name.""" return self.raw.get("hostname", "") @property def radio(self) -> str: """Radio.""" return self.raw.get("radio", "") @property def subsystem(self) -> str: """Subsystem like 'lan' or 'wlan'.""" return self.raw.get("subsystem", "") @property def site_id(self) -> str: """Site ID.""" return self.raw.get("site_id", "") @property def ssid(self) -> str: """SSID.""" return self.raw.get("ssid", "") @property def version_from(self) -> str: """Version from.""" return self.raw.get("version_from", "") @property def version_to(self) -> str: """Version to.""" return self.raw.get("version_to", "")
class Event(ApiItem): '''UniFi event.''' @property def datetime(self) -> str: '''Datetime of event '2020-03-01T15:35:08Z'.''' pass @property def key(self) -> EventKey: '''Event key e.g. 'EVT_WU_Disconnected'.''' pass @property def event(self) -> str: '''Event key e.g. 'EVT_WU_Disconnected'. To be removed. ''' pass @property def msg(self) -> str: '''Event message.''' pass @property def time(self) -> int: '''Time of event 1583076908000.''' pass @property def mac(self) -> str: '''MAC of client or device.''' pass @property def ap(self) -> str: '''Access point connected to.''' pass @property def bytes(self) -> int: '''Bytes of data consumed.''' pass @property def channel(self) -> int: '''Wi-Fi channel.''' pass @property def client(self) -> str: '''MAC address of client.''' pass @property def device(self) -> str: '''MAC address of device.''' pass @property def duration(self) -> int: '''Duration.''' pass @property def hostname(self) -> str: '''Nice name.''' pass @property def radio(self) -> str: '''Radio.''' pass @property def subsystem(self) -> str: '''Subsystem like 'lan' or 'wlan'.''' pass @property def site_id(self) -> str: '''Site ID.''' pass @property def ssid(self) -> str: '''SSID.''' pass @property def version_from(self) -> str: '''Version from.''' pass @property def version_to(self) -> str: '''Version to.''' pass
39
20
4
0
3
1
1
0.31
1
3
1
0
19
0
19
40
114
21
71
40
32
22
47
21
27
3
5
1
22
141,272
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetManualIntensityResponse
class GetManualIntensityResponse(ApiResponse[int]): """Response object for getting manual intensity.""" api_version: str context: str method: str data: int # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetIntensityResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["intensity"], )
class GetManualIntensityResponse(ApiResponse[int]): '''Response object for getting manual intensity.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,273
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetServiceCapabilitiesRequest
class GetServiceCapabilitiesRequest(ApiRequest): """Request object for getting service capabilities.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getServiceCapabilities", } )
class GetServiceCapabilitiesRequest(ApiRequest): '''Request object for getting service capabilities.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.13
1
1
0
0
1
0
1
5
21
3
16
9
13
2
9
8
7
1
1
0
1
141,274
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetManualAngleOfIlluminationResponse
class GetManualAngleOfIlluminationResponse(ApiResponse[int]): """Response object for getting manual angle of illumination.""" api_version: str context: str method: str data: int # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetAngleOfIlluminationResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["angleOfIllumination"], )
class GetManualAngleOfIlluminationResponse(ApiResponse[int]): '''Response object for getting manual angle of illumination.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,275
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetManualAngleOfIlluminationRequest
class GetManualAngleOfIlluminationRequest(ApiRequest): """Request object for getting manual angle of illumination.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getManualAngleOfIllumination", "params": {"lightID": self.light_id}, } )
class GetManualAngleOfIlluminationRequest(ApiRequest): '''Request object for getting manual angle of illumination.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,276
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetServiceCapabilitiesResponse
class GetServiceCapabilitiesResponse(ApiResponse[ServiceCapabilities]): """Response object for getting service capabilities.""" api_version: str context: str method: str data: ServiceCapabilities # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetServiceCapabilitiesResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=ServiceCapabilities.from_dict(data["data"]), )
class GetServiceCapabilitiesResponse(ApiResponse[ServiceCapabilities]): '''Response object for getting service capabilities.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
3
2
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,277
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetManualIntensityRequest
class GetManualIntensityRequest(ApiRequest): """Request object for getting manual intensity.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getManualIntensity", "params": {"lightID": self.light_id}, } )
class GetManualIntensityRequest(ApiRequest): '''Request object for getting manual intensity.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,278
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetServiceCapabilitiesResponseT
class GetServiceCapabilitiesResponseT(TypedDict): """Represent get service capability response.""" apiVersion: str context: str method: str data: ServiceCapabilitiesT error: NotRequired[ErrorDataT]
class GetServiceCapabilitiesResponseT(TypedDict): '''Represent get service capability response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,279
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetValidRangesResponseT
class GetValidRangesResponseT(TypedDict): """Represent valid intensity response.""" apiVersion: str context: str method: str data: ValidRangesT error: NotRequired[ErrorDataT]
class GetValidRangesResponseT(TypedDict): '''Represent valid intensity response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,280
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetValidAngleOfIlluminationRequest
class GetValidAngleOfIlluminationRequest(ApiRequest): """Request object for getting valid angle of illumination range.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getValidAngleOfIllumination", "params": {"lightID": self.light_id}, } )
class GetValidAngleOfIlluminationRequest(ApiRequest): '''Request object for getting valid angle of illumination range.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,281
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetValidAngleOfIlluminationResponse
class GetValidAngleOfIlluminationResponse(ApiResponse[list[Range]]): """Response object for getting valid angle of illumination range.""" api_version: str context: str method: str data: list[Range] # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetValidRangesResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=Range.from_list(data["data"]["ranges"]), )
class GetValidAngleOfIlluminationResponse(ApiResponse[list[Range]]): '''Response object for getting valid angle of illumination range.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
3
2
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,282
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetValidIntensityRequest
class GetValidIntensityRequest(ApiRequest): """Request object for getting valid intensity range of light.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getValidIntensity", "params": {"lightID": self.light_id}, } )
class GetValidIntensityRequest(ApiRequest): '''Request object for getting valid intensity range of light.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,283
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetValidIntensityResponse
class GetValidIntensityResponse(ApiResponse[Range]): """Response object for getting valid intensity range of light.""" api_version: str context: str method: str data: Range # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetValidRangesResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=Range.from_dict(data["data"]["ranges"][0]), )
class GetValidIntensityResponse(ApiResponse[Range]): '''Response object for getting valid intensity range of light.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
3
2
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,284
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightSynchronizeDayNightModeResponse
class GetLightSynchronizeDayNightModeResponse(ApiResponse[bool]): """Response object for getting day night mode synchronization setting.""" api_version: str context: str method: str data: bool # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetLightSynchronizationDayNightModeResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["synchronize"], )
class GetLightSynchronizeDayNightModeResponse(ApiResponse[bool]): '''Response object for getting day night mode synchronization setting.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,285
Kane610/axis
axis/models/light_control.py
axis.models.light_control.IntensityT
class IntensityT(TypedDict): """Light intensity.""" intensity: int
class IntensityT(TypedDict): '''Light intensity.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,286
Kane610/axis
axis/models/light_control.py
axis.models.light_control.LightInformation
class LightInformation(ApiItem): """Light information item.""" enabled: bool light_state: bool light_type: str number_of_leds: int automatic_intensity_mode: bool automatic_angle_of_illumination_mode: bool synchronize_day_night_mode: bool error: bool error_info: str @classmethod def decode(cls, data: LightInformationT) -> Self: """Create light information object from dict.""" return cls( id=data["lightID"], enabled=data["enabled"], light_state=data["lightState"], light_type=data["lightType"], number_of_leds=data["nrOfLEDs"], automatic_intensity_mode=data["automaticIntensityMode"], automatic_angle_of_illumination_mode=data[ "automaticAngleOfIlluminationMode" ], synchronize_day_night_mode=data["synchronizeDayNightMode"], error=data["error"], error_info=data["errorInfo"], )
class LightInformation(ApiItem): '''Light information item.''' @classmethod def decode(cls, data: LightInformationT) -> Self: '''Create light information object from dict.''' pass
3
2
16
0
15
1
1
0.08
1
1
1
0
0
0
1
24
30
2
26
3
23
2
12
2
10
1
5
0
1
141,287
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetSupportedVersionsRequest
class GetSupportedVersionsRequest(ApiRequest): """Request object for listing supported API versions.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "context": self.context, "method": "getSupportedVersions", } )
class GetSupportedVersionsRequest(ApiRequest): '''Request object for listing supported API versions.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
8
0
7
1
1
0.14
1
1
0
0
1
0
1
5
19
3
14
8
11
2
8
7
6
1
1
0
1
141,288
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightSynchronizeDayNightModeRequest
class GetLightSynchronizeDayNightModeRequest(ApiRequest): """Request object for getting day night mode synchronization setting.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getLightSynchronizationDayNightMode", "params": {"lightID": self.light_id}, } )
class GetLightSynchronizeDayNightModeRequest(ApiRequest): '''Request object for getting day night mode synchronization setting.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,289
Kane610/axis
axis/models/light_control.py
axis.models.light_control.DisableLightRequest
class DisableLightRequest(ActivateLightRequest): """Request object for disabling light.""" @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "disableLight", "params": {"lightID": self.light_id}, } )
class DisableLightRequest(ActivateLightRequest): '''Request object for disabling light.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.18
1
1
0
0
1
0
1
6
14
1
11
3
8
2
3
2
1
1
2
0
1
141,290
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightStatusResponseT
class GetLightStatusResponseT(TypedDict): """Represent get light status response.""" apiVersion: str context: str method: str data: LightStatusT error: NotRequired[ErrorDataT]
class GetLightStatusResponseT(TypedDict): '''Represent get light status response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,291
Kane610/axis
axis/models/light_control.py
axis.models.light_control.AngleOfIlluminationT
class AngleOfIlluminationT(TypedDict): """Light intensity.""" angleOfIllumination: int
class AngleOfIlluminationT(TypedDict): '''Light intensity.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,292
Kane610/axis
axis/models/light_control.py
axis.models.light_control.LightInformationItemsT
class LightInformationItemsT(TypedDict): """Represent list of light information objects.""" items: list[LightInformationT]
class LightInformationItemsT(TypedDict): '''Represent list of light information objects.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,293
Kane610/axis
axis/models/light_control.py
axis.models.light_control.DeactivateLightRequest
class DeactivateLightRequest(ActivateLightRequest): """Request object for activating light.""" @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "deactivateLight", "params": {"lightID": self.light_id}, } )
class DeactivateLightRequest(ActivateLightRequest): '''Request object for activating light.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.18
1
1
0
0
1
0
1
6
14
1
11
3
8
2
3
2
1
1
2
0
1
141,294
Kane610/axis
axis/models/light_control.py
axis.models.light_control.EnableLightRequest
class EnableLightRequest(ActivateLightRequest): """Request object for enabling light.""" @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "enableLight", "params": {"lightID": self.light_id}, } )
class EnableLightRequest(ActivateLightRequest): '''Request object for enabling light.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.18
1
1
0
0
1
0
1
6
14
1
11
3
8
2
3
2
1
1
2
0
1
141,295
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetAngleOfIlluminationResponseT
class GetAngleOfIlluminationResponseT(TypedDict): """Represent a get angle of illumination response.""" apiVersion: str context: str method: str data: AngleOfIlluminationT error: NotRequired[ErrorDataT]
class GetAngleOfIlluminationResponseT(TypedDict): '''Represent a get angle of illumination response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,296
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetCurrentAngleOfIlluminationRequest
class GetCurrentAngleOfIlluminationRequest(ApiRequest): """Request object for getting current angle of illumination.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getCurrentAngleOfIllumination", "params": {"lightID": self.light_id}, } )
class GetCurrentAngleOfIlluminationRequest(ApiRequest): '''Request object for getting current angle of illumination.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,297
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetCurrentAngleOfIlluminationResponse
class GetCurrentAngleOfIlluminationResponse(ApiResponse[int]): """Response object for getting current angle of illumination.""" api_version: str context: str method: str data: int # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetAngleOfIlluminationResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["angleOfIllumination"], )
class GetCurrentAngleOfIlluminationResponse(ApiResponse[int]): '''Response object for getting current angle of illumination.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,298
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetCurrentIntensityRequest
class GetCurrentIntensityRequest(ApiRequest): """Request object for getting current intensity.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getCurrentIntensity", "params": {"lightID": self.light_id}, } )
class GetCurrentIntensityRequest(ApiRequest): '''Request object for getting current intensity.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,299
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetCurrentIntensityResponse
class GetCurrentIntensityResponse(ApiResponse[int]): """Response object for getting current intensity.""" api_version: str context: str method: str data: int # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetIntensityResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["intensity"], )
class GetCurrentIntensityResponse(ApiResponse[int]): '''Response object for getting current intensity.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,300
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetIndividualIntensityRequest
class GetIndividualIntensityRequest(ApiRequest): """Request object for getting individual intensity.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str led_id: int api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getIndividualIntensity", "params": {"lightID": self.light_id, "LEDID": self.led_id}, } )
class GetIndividualIntensityRequest(ApiRequest): '''Request object for getting individual intensity.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
25
4
19
9
16
2
11
8
9
1
1
0
1
141,301
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetIndividualIntensityResponse
class GetIndividualIntensityResponse(ApiResponse[int]): """Response object for getting individual intensity.""" api_version: str context: str method: str data: int # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetIntensityResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["intensity"], )
class GetIndividualIntensityResponse(ApiResponse[int]): '''Response object for getting individual intensity.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,302
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetIntensityResponseT
class GetIntensityResponseT(TypedDict): """Represent a get intensity response.""" apiVersion: str context: str method: str data: IntensityT error: NotRequired[ErrorDataT]
class GetIntensityResponseT(TypedDict): '''Represent a get intensity response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,303
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightInformationRequest
class GetLightInformationRequest(ApiRequest): """Request object for getting light information.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getLightInformation", } )
class GetLightInformationRequest(ApiRequest): '''Request object for getting light information.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.13
1
1
0
0
1
0
1
5
21
3
16
9
13
2
9
8
7
1
1
0
1
141,304
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightInformationResponse
class GetLightInformationResponse(ApiResponse[dict[str, LightInformation]]): """Response object for getting light information.""" api_version: str context: str method: str data: dict[str, LightInformation] # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetLightInformationResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=LightInformation.decode_to_dict(data.get("data", {}).get("items", [])), )
class GetLightInformationResponse(ApiResponse[dict[str, LightInformation]]): '''Response object for getting light information.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
3
2
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,305
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightInformationResponseT
class GetLightInformationResponseT(TypedDict): """Represent get light information response.""" apiVersion: str context: str method: str data: LightInformationItemsT error: NotRequired[ErrorDataT]
class GetLightInformationResponseT(TypedDict): '''Represent get light information response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,306
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightStatusRequest
class GetLightStatusRequest(ApiRequest): """Request object for getting light status.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getLightStatus", "params": {"lightID": self.light_id}, } )
class GetLightStatusRequest(ApiRequest): '''Request object for getting light status.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,307
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightStatusResponse
class GetLightStatusResponse(ApiResponse[bool]): """Response object for getting light status.""" api_version: str context: str method: str data: bool # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare API description dictionary.""" data: GetLightStatusResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=data["data"]["status"], )
class GetLightStatusResponse(ApiResponse[bool]): '''Response object for getting light status.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare API description dictionary.''' pass
3
2
9
0
8
1
1
0.21
1
2
1
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,308
Kane610/axis
axis/models/light_control.py
axis.models.light_control.GetLightSynchronizationDayNightModeResponseT
class GetLightSynchronizationDayNightModeResponseT(TypedDict): """Represent a get light synchronization day night mode response.""" apiVersion: str context: str method: str data: SynchronizeT error: NotRequired[ErrorDataT]
class GetLightSynchronizationDayNightModeResponseT(TypedDict): '''Represent a get light synchronization day night mode response.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,309
Kane610/axis
axis/models/light_control.py
axis.models.light_control.LightInformationT
class LightInformationT(TypedDict): """Light information.""" enabled: bool lightID: str lightState: bool lightType: str nrOfLEDs: int automaticAngleOfIlluminationMode: bool automaticIntensityMode: bool synchronizeDayNightMode: bool error: bool errorInfo: str
class LightInformationT(TypedDict): '''Light information.''' pass
1
1
0
0
0
0
0
0.09
1
0
0
0
0
0
0
0
13
1
11
1
10
1
11
1
10
0
1
0
0
141,310
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetEventPublicationConfigResponseT
class GetEventPublicationConfigResponseT(TypedDict): """Represent event publication config.""" apiVersion: str context: str method: str data: EventPublicationConfigDataT error: NotRequired[ErrorDataT]
class GetEventPublicationConfigResponseT(TypedDict): '''Represent event publication config.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,311
Kane610/axis
axis/models/light_control.py
axis.models.light_control.Range
class Range: """High to low range.""" low: int high: int @classmethod def from_dict(cls, data: RangeT) -> Self: """Create range object from dict.""" return cls(low=data["low"], high=data["high"]) @classmethod def from_list(cls, data: list[RangeT]) -> list[Self]: """Create range object from dict.""" return [cls.from_dict(range) for range in data]
class Range: '''High to low range.''' @classmethod def from_dict(cls, data: RangeT) -> Self: '''Create range object from dict.''' pass @classmethod def from_list(cls, data: list[RangeT]) -> list[Self]: '''Create range object from dict.''' pass
5
3
3
0
2
1
1
0.33
0
3
1
0
0
0
2
2
15
3
9
6
4
3
7
3
4
1
0
0
2
141,312
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.DeactivateClientRequest
class DeactivateClientRequest(ActivateClientRequest): """Request object for deactivating MQTT client.""" @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "deactivateClient", } )
class DeactivateClientRequest(ActivateClientRequest): '''Request object for deactivating MQTT client.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.2
1
1
0
0
1
0
1
6
13
1
10
3
7
2
3
2
1
1
2
0
1
141,313
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.EventFilter
class EventFilter: """Event filter.""" topic_filter: str qos: int | None = None retain: str | None = None @classmethod def from_dict(cls, data: EventFilterT) -> Self: """Create event filter object from dict.""" return cls( topic_filter=data["topicFilter"], qos=data.get("qos"), retain=data.get("retain"), ) @classmethod def from_list(cls, data: list[EventFilterT]) -> list[Self]: """Create event filter object from dict.""" return [cls.from_dict(item) for item in data] def to_dict(self) -> EventFilterT: """Create json dict from object.""" data: EventFilterT = {"topicFilter": self.topic_filter} if self.qos is not None: data["qos"] = self.qos if self.retain is not None: data["retain"] = self.retain return data @classmethod def to_list(cls, data: list[EventFilter]) -> list[EventFilterT]: """Create json list from object.""" return [item.to_dict() for item in data]
class EventFilter: '''Event filter.''' @classmethod def from_dict(cls, data: EventFilterT) -> Self: '''Create event filter object from dict.''' pass @classmethod def from_list(cls, data: list[EventFilterT]) -> list[Self]: '''Create event filter object from dict.''' pass def to_dict(self) -> EventFilterT: '''Create json dict from object.''' pass @classmethod def to_list(cls, data: list[EventFilter]) -> list[EventFilterT]: '''Create json list from object.''' pass
8
5
5
0
4
1
2
0.21
0
2
1
0
1
0
4
4
34
5
24
11
16
5
17
8
12
3
0
1
6
141,314
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.EventFilterT
class EventFilterT(TypedDict): """Event filter.""" topicFilter: str qos: NotRequired[int] retain: NotRequired[str]
class EventFilterT(TypedDict): '''Event filter.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
141,315
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.EventPublicationConfig
class EventPublicationConfig: """Event publication config.""" topic_prefix: str | None = None custom_topic_prefix: str | None = None append_event_topic: bool | None = None include_topic_namespaces: bool | None = None include_serial_number_in_payload: bool | None = None event_filter_list: list[EventFilter] | None = None @classmethod def from_dict(cls, data: EventPublicationConfigT) -> Self: """Create client config status object from dict.""" return cls( topic_prefix=data["topicPrefix"], custom_topic_prefix=data["customTopicPrefix"], append_event_topic=data["appendEventTopic"], include_topic_namespaces=data["includeTopicNamespaces"], include_serial_number_in_payload=data["includeSerialNumberInPayload"], event_filter_list=EventFilter.from_list(data["eventFilterList"]), ) def to_dict(self) -> EventPublicationConfigT: """Create json dict from object.""" data: EventPublicationConfigT = {} if self.topic_prefix is not None: data["topicPrefix"] = self.topic_prefix if self.custom_topic_prefix is not None: data["customTopicPrefix"] = self.custom_topic_prefix if self.append_event_topic is not None: data["appendEventTopic"] = self.append_event_topic if self.include_topic_namespaces is not None: data["includeTopicNamespaces"] = self.include_topic_namespaces if self.include_serial_number_in_payload is not None: data["includeSerialNumberInPayload"] = self.include_serial_number_in_payload if self.event_filter_list is not None: data["eventFilterList"] = EventFilter.to_list(self.event_filter_list) return data
class EventPublicationConfig: '''Event publication config.''' @classmethod def from_dict(cls, data: EventPublicationConfigT) -> Self: '''Create client config status object from dict.''' pass def to_dict(self) -> EventPublicationConfigT: '''Create json dict from object.''' pass
4
3
13
0
12
1
4
0.09
0
2
2
0
1
0
2
2
38
3
32
11
28
3
24
10
21
7
0
1
8
141,316
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.EventPublicationConfigDataT
class EventPublicationConfigDataT(TypedDict): """Event publication config data.""" eventPublicationConfig: EventPublicationConfigT
class EventPublicationConfigDataT(TypedDict): '''Event publication config data.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,317
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.EventPublicationConfigT
class EventPublicationConfigT(TypedDict): """Event publication config.""" appendEventTopic: NotRequired[bool] customTopicPrefix: NotRequired[str] eventFilterList: NotRequired[list[EventFilterT]] includeTopicNamespaces: NotRequired[bool] includeSerialNumberInPayload: NotRequired[bool] topicPrefix: NotRequired[str]
class EventPublicationConfigT(TypedDict): '''Event publication config.''' pass
1
1
0
0
0
0
0
0.14
1
0
0
0
0
0
0
0
9
1
7
1
6
1
7
1
6
0
1
0
0
141,318
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetClientStatusRequest
class GetClientStatusRequest(ApiRequest): """Request object for getting MQTT client status.""" method = "post" path = "/axis-cgi/mqtt/client.cgi" content_type = "application/json" error_codes = general_error_codes api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getClientStatus", } )
class GetClientStatusRequest(ApiRequest): '''Request object for getting MQTT client status.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.13
1
1
0
0
1
0
1
5
21
3
16
9
13
2
9
8
7
1
1
0
1
141,319
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ConfigureEventPublicationRequest
class ConfigureEventPublicationRequest(ApiRequest): """Request object for configuring event publication over MQTT.""" method = "post" path = "/axis-cgi/mqtt/event.cgi" content_type = "application/json" error_codes = general_error_codes config: EventPublicationConfig api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "configureEventPublication", "params": self.config.to_dict(), } )
class ConfigureEventPublicationRequest(ApiRequest): '''Request object for configuring event publication over MQTT.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,320
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetClientStatusResponse
class GetClientStatusResponse(ApiResponse[ClientConfigStatus]): """Response object for get client status request.""" api_version: str context: str method: str data: ClientConfigStatus # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare response data.""" data: GetClientStatusResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=ClientConfigStatus.from_dict(data["data"]), )
class GetClientStatusResponse(ApiResponse[ClientConfigStatus]): '''Response object for get client status request.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare response data.''' pass
3
2
9
0
8
1
1
0.21
1
3
2
0
0
0
1
24
19
2
14
4
11
3
8
3
6
1
6
0
1
141,321
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetEventPublicationConfigRequest
class GetEventPublicationConfigRequest(ApiRequest): """Request object for getting MQTT event publication config.""" method = "post" path = "/axis-cgi/mqtt/event.cgi" content_type = "application/json" error_codes = general_error_codes api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "getEventPublicationConfig", } )
class GetEventPublicationConfigRequest(ApiRequest): '''Request object for getting MQTT event publication config.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.13
1
1
0
0
1
0
1
5
21
3
16
9
13
2
9
8
7
1
1
0
1
141,322
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetEventPublicationConfigResponse
class GetEventPublicationConfigResponse(ApiResponse[EventPublicationConfig]): """Response object for event publication config get request.""" api_version: str context: str method: str data: EventPublicationConfig # error: ErrorDataT | None = None @classmethod def decode(cls, bytes_data: bytes) -> Self: """Prepare response data.""" data: GetEventPublicationConfigResponseT = orjson.loads(bytes_data) return cls( api_version=data["apiVersion"], context=data["context"], method=data["method"], data=EventPublicationConfig.from_dict( data["data"]["eventPublicationConfig"] ), )
class GetEventPublicationConfigResponse(ApiResponse[EventPublicationConfig]): '''Response object for event publication config get request.''' @classmethod def decode(cls, bytes_data: bytes) -> Self: '''Prepare response data.''' pass
3
2
11
0
10
1
1
0.19
1
3
2
0
0
0
1
24
21
2
16
4
13
3
8
3
6
1
6
0
1
141,323
Kane610/axis
axis/models/light_control.py
axis.models.light_control.ActivateLightRequest
class ActivateLightRequest(ApiRequest): """Request object for activating light.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "activateLight", "params": {"lightID": self.light_id}, } )
class ActivateLightRequest(ApiRequest): '''Request object for activating light.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
3
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,324
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.Message
class Message: """Message description.""" use_default: bool = True """Specifies if the default configuration should be used. If set to true, other options in this parameter will be discarded. If set to false, topic, messages, retained and qos options are required and used. """ topic: str | None = None """The topic that should be used with the message.""" message: str | None = None """The message that should be used with the message.""" retain: bool | None = None """The retained option that should be used with the message.""" qos: Literal[0, 1, 2] | None = None """The QoS option that should be used with the message.""" @classmethod def from_dict(cls, data: MessageT) -> Self: """Create message object from dict.""" return cls( use_default=data["useDefault"], topic=data.get("topic"), message=data.get("message"), retain=data.get("retain"), qos=data.get("qos"), ) @classmethod def from_dict_or_none(cls, data: MessageT | None) -> Self | None: """Create class instance if data is not None.""" return cls.from_dict(data) if data is not None else None def to_dict(self) -> MessageT: """Create json dict from object.""" data: MessageT = {"useDefault": self.use_default} if self.topic is not None: data["topic"] = self.topic if self.message is not None: data["message"] = self.message if self.retain is not None: data["retain"] = self.retain if self.qos is not None: data["qos"] = self.qos return data
class Message: '''Message description.''' @classmethod def from_dict(cls, data: MessageT) -> Self: '''Create message object from dict.''' pass @classmethod def from_dict_or_none(cls, data: MessageT | None) -> Self | None: '''Create class instance if data is not None.''' pass def to_dict(self) -> MessageT: '''Create json dict from object.''' pass
6
4
8
0
7
1
3
0.41
0
1
1
0
1
0
3
3
46
5
29
12
23
12
21
10
17
5
0
1
8
141,325
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.MessageT
class MessageT(TypedDict): """Represent a message object.""" useDefault: bool message: NotRequired[str] qos: NotRequired[Literal[0, 1, 2]] retain: NotRequired[bool] topic: NotRequired[str]
class MessageT(TypedDict): '''Represent a message object.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,326
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.Server
class Server: """Represent server config.""" host: str """The Broker location, i.e. the Hostname or IP address.""" protocol: ServerProtocol = ServerProtocol.TCP """Contains the protocols used by params.server. Possible values are: - tcp: MQTT over TCP - ssl: MQTT over SSL - ws: MQTT over Websocket - wss: MQTT over Websocket Secure """ alpn_protocol: str | None = None """The ALPN protocol that should be used if the selected protocol was ssl or wss. If the string value is empty the ALPN will not be used. Default value is empty and the maximum length of the protocol is 255 bytes. """ basepath: str | None = None """The path that should be used as a suffix for the constructed URL. Will only be used for the ws and wss connections. The default value is empty string. """ port: int | None = None """The port that should be used. Default values for the protocols are: - tcp: 1883 - ssl: 8883 - ws: 80 - wss: 443 """ @classmethod def from_dict(cls, data: ServerT) -> Self: """Create server object from dict.""" return cls( host=data["host"], protocol=ServerProtocol(data["protocol"]), alpn_protocol=data.get("alpnProtocol"), basepath=data.get("basepath"), port=data.get("port"), ) def to_dict(self) -> ServerT: """Create json dict from object.""" data: ServerT = {"host": self.host, "protocol": self.protocol.value} if self.alpn_protocol is not None: data["alpnProtocol"] = self.alpn_protocol if self.basepath is not None: data["basepath"] = self.basepath if self.port is not None: data["port"] = self.port return data
class Server: '''Represent server config.''' @classmethod def from_dict(cls, data: ServerT) -> Self: '''Create server object from dict.''' pass def to_dict(self) -> ServerT: '''Create json dict from object.''' pass
4
3
10
0
9
1
3
1.08
0
2
2
0
1
0
2
2
57
7
24
9
20
26
17
8
14
4
0
1
5
141,327
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ServerProtocol
class ServerProtocol(enum.StrEnum): """Connection protocols used in the server configuration.""" SSL = "ssl" TCP = "tcp" WS = "ws" WSS = "wss"
class ServerProtocol(enum.StrEnum): '''Connection protocols used in the server configuration.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
68
7
1
5
5
4
1
5
5
4
0
3
0
0
141,328
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.GetClientStatusResponseT
class GetClientStatusResponseT(TypedDict): """Represent client config.""" apiVersion: str context: str method: str data: ClientStatusDataT error: NotRequired[ErrorDataT]
class GetClientStatusResponseT(TypedDict): '''Represent client config.''' pass
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,329
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ConfigureClientRequest
class ConfigureClientRequest(ApiRequest): """Request object for configuring MQTT client.""" method = "post" path = "/axis-cgi/mqtt/client.cgi" content_type = "application/json" error_codes = general_error_codes client_config: ClientConfig api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "configureClient", "params": self.client_config.to_dict(), } )
class ConfigureClientRequest(ApiRequest): '''Request object for configuring MQTT client.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
24
4
18
9
15
2
10
8
8
1
1
0
1
141,330
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ConfigT
class ConfigT(TypedDict): """Represent client config.""" server: ServerT activateOnReboot: NotRequired[bool] autoReconnect: NotRequired[bool] cleanSession: NotRequired[bool] clientId: NotRequired[str] connectMessage: NotRequired[MessageT] connectTimeout: NotRequired[int] deviceTopicPrefix: NotRequired[str] disconnectMessage: NotRequired[MessageT] lastWillTestament: NotRequired[MessageT] password: NotRequired[str] keepAliveInterval: NotRequired[int] keepExistingPassword: NotRequired[bool] ssl: NotRequired[SslT] username: NotRequired[str]
class ConfigT(TypedDict): '''Represent client config.''' pass
1
1
0
0
0
0
0
0.06
1
0
0
0
0
0
0
0
18
1
16
1
15
1
16
1
15
0
1
0
0
141,331
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ClientStatusDataT
class ClientStatusDataT(TypedDict): """Client status data.""" config: ConfigT status: StatusT
class ClientStatusDataT(TypedDict): '''Client status data.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,332
Kane610/axis
axis/models/light_control.py
axis.models.light_control.RangeT
class RangeT(TypedDict): """Range.""" low: int high: int
class RangeT(TypedDict): '''Range.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,333
Kane610/axis
axis/models/light_control.py
axis.models.light_control.ServiceCapabilities
class ServiceCapabilities: """Service capabilities item.""" automatic_intensity_support: bool manual_intensity_support: bool get_current_intensity_support: bool individual_intensity_support: bool automatic_angle_of_illumination_support: bool manual_angle_of_illumination_support: bool day_night_synchronize_support: bool @classmethod def from_dict(cls, data: ServiceCapabilitiesT) -> Self: """Create service capabilities object from dict.""" return cls( automatic_intensity_support=data["automaticIntensitySupport"], manual_intensity_support=data["manualIntensitySupport"], get_current_intensity_support=data["getCurrentIntensitySupport"], individual_intensity_support=data["individualIntensitySupport"], automatic_angle_of_illumination_support=data[ "automaticAngleOfIlluminationSupport" ], manual_angle_of_illumination_support=data[ "manualAngleOfIlluminationSupport" ], day_night_synchronize_support=data["dayNightSynchronizeSupport"], )
class ServiceCapabilities: '''Service capabilities item.''' @classmethod def from_dict(cls, data: ServiceCapabilitiesT) -> Self: '''Create service capabilities object from dict.''' pass
3
2
15
0
14
1
1
0.09
0
1
1
0
0
0
1
1
27
2
23
3
20
2
10
2
8
1
0
0
1
141,334
Kane610/axis
axis/models/light_control.py
axis.models.light_control.ServiceCapabilitiesT
class ServiceCapabilitiesT(TypedDict): """Service capability.""" automaticIntensitySupport: bool manualIntensitySupport: bool getCurrentIntensitySupport: bool individualIntensitySupport: bool automaticAngleOfIlluminationSupport: bool manualAngleOfIlluminationSupport: bool dayNightSynchronizeSupport: bool
class ServiceCapabilitiesT(TypedDict): '''Service capability.''' pass
1
1
0
0
0
0
0
0.13
1
0
0
0
0
0
0
0
10
1
8
1
7
1
8
1
7
0
1
0
0
141,335
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetAutomaticAngleOfIlluminationModeRequest
class SetAutomaticAngleOfIlluminationModeRequest(ApiRequest): """Enable the automatic angle of illumination control.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str enabled: bool api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setAutomaticAngleOfIlluminationMode", "params": {"lightID": self.light_id, "enabled": self.enabled}, } )
class SetAutomaticAngleOfIlluminationModeRequest(ApiRequest): '''Enable the automatic angle of illumination control.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
25
4
19
9
16
2
11
8
9
1
1
0
1
141,336
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetAutomaticIntensityModeRequest
class SetAutomaticIntensityModeRequest(ApiRequest): """Enable the automatic light intensity control.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str enabled: bool api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setAutomaticIntensityMode", "params": {"lightID": self.light_id, "enabled": self.enabled}, } )
class SetAutomaticIntensityModeRequest(ApiRequest): '''Enable the automatic light intensity control.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
25
4
19
9
16
2
11
8
9
1
1
0
1
141,337
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetIndividualIntensityRequest
class SetIndividualIntensityRequest(ApiRequest): """Set individual light intensity.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str led_id: int intensity: int api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setIndividualIntensity", "params": { "lightID": self.light_id, "LEDID": self.led_id, "intensity": self.intensity, }, } )
class SetIndividualIntensityRequest(ApiRequest): '''Set individual light intensity.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
14
0
13
1
1
0.08
1
1
0
0
1
0
1
5
30
4
24
9
21
2
12
8
10
1
1
0
1
141,338
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetLightSynchronizeDayNightModeRequest
class SetLightSynchronizeDayNightModeRequest(ApiRequest): """Enable automatic synchronization with the day/night mode.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str enabled: bool api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setLightSynchronizationDayNightMode", "params": {"lightID": self.light_id, "enabled": self.enabled}, } )
class SetLightSynchronizeDayNightModeRequest(ApiRequest): '''Enable automatic synchronization with the day/night mode.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
25
4
19
9
16
2
11
8
9
1
1
0
1
141,339
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetManualAngleOfIlluminationModeRequest
class SetManualAngleOfIlluminationModeRequest(ApiRequest): """Set the manual angle of illumination.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str angle_of_illumination: int api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setManualAngleOfIllumination", "params": { "lightID": self.light_id, "angleOfIllumination": self.angle_of_illumination, }, } )
class SetManualAngleOfIlluminationModeRequest(ApiRequest): '''Set the manual angle of illumination.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
13
0
12
1
1
0.09
1
1
0
0
1
0
1
5
28
4
22
9
19
2
11
8
9
1
1
0
1
141,340
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SetManualIntensityRequest
class SetManualIntensityRequest(ApiRequest): """Set manual light intensity.""" method = "post" path = "/axis-cgi/lightcontrol.cgi" content_type = "application/json" error_codes = general_error_codes light_id: str intensity: int api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "setManualIntensity", "params": {"lightID": self.light_id, "intensity": self.intensity}, } )
class SetManualIntensityRequest(ApiRequest): '''Set manual light intensity.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
10
0
9
1
1
0.11
1
1
0
0
1
0
1
5
25
4
19
9
16
2
11
8
9
1
1
0
1
141,341
Kane610/axis
axis/models/light_control.py
axis.models.light_control.SynchronizeT
class SynchronizeT(TypedDict): """Synchronize day night mode.""" synchronize: bool
class SynchronizeT(TypedDict): '''Synchronize day night mode.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,342
Kane610/axis
axis/models/light_control.py
axis.models.light_control.ValidRangesT
class ValidRangesT(TypedDict): """Light status.""" ranges: list[RangeT]
class ValidRangesT(TypedDict): '''Light status.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,343
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ActivateClientRequest
class ActivateClientRequest(ApiRequest): """Request object for activating MQTT client.""" method = "post" path = "/axis-cgi/mqtt/client.cgi" content_type = "application/json" error_codes = general_error_codes api_version: str = API_VERSION context: str = CONTEXT @property def content(self) -> bytes: """Initialize request data.""" return orjson.dumps( { "apiVersion": self.api_version, "context": self.context, "method": "activateClient", } )
class ActivateClientRequest(ApiRequest): '''Request object for activating MQTT client.''' @property def content(self) -> bytes: '''Initialize request data.''' pass
3
2
9
0
8
1
1
0.13
1
1
0
1
1
0
1
5
21
3
16
9
13
2
9
8
7
1
1
0
1
141,344
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ClientConfig
class ClientConfig: """Represent client config.""" server: Server """Contains the address and protocol related information.""" activate_on_reboot: bool | None = None auto_reconnect: bool | None = None """Specifies if the client should reconnect on an unintentional disconnect.""" clean_session: bool | None = None """This parameter controls the behavior during connection and disconnection time. Affects both the client and the server when this parameters is true, the state information is discarded when the client and server change state. Setting the parameter to false means that the state information is kept. """ client_id: str | None = None """The client identifier sent to the server when the client connects to it.""" connect_message: Message | None = None """Specifies if a message should be sent when a connection is established. Contains options related to connect announcements. If this object is not defined this message won't be sent. """ connect_timeout: int | None = None """The timed interval (in seconds) to allow a connect to finish. The default value is 60. """ device_topic_prefix: str | None = None """Specifies a prefix on MQTT topics in various scenarios. Such as when you want to configure the translation of events into MQTT messages or prefix all published MQTT messages with a common prefix. The default value is axis/{device serial number}. """ disconnect_message: Message | None = None """Specifies if a message should be sent when the client is manually disconnected. Contains options related to manual disconnect announcements. If this object is not defined this message won't be sent. This message should not be confused with LWT, as it is used when the connection is lost and managed by the broker. """ keep_alive_interval: int | None = None """Defines the maximum time (in seconds). Time intervalthat should pass without communication between the client and server. At least one message will be sent over the network by the client during each keep alive period and the interval makes it possible to detect when the server is no longer available without having to wait for the TCP/IP timeout. The default value is 60.""" last_will_testament: Message | None = None """Contains the options related to LWT. If LWT is not required, this parameter is not included. """ password: str | None = None """The password that should be used for authentication.""" ssl: Ssl | None = None """Contains the options related to the SSL connection. This object should only be present if the connection type is ssl or wss. """ username: str | None = None """The user name that should be used for authentication and authorization.""" @classmethod def from_dict(cls, data: ConfigT) -> Self: """Create client status object from dict.""" return cls( server=Server.from_dict(data["server"]), activate_on_reboot=data.get("activateOnReboot"), auto_reconnect=data.get("autoReconnect"), clean_session=data.get("cleanSession"), client_id=data.get("clientId"), connect_message=Message.from_dict_or_none(data.get("connectMessage")), connect_timeout=data.get("connectTimeout"), device_topic_prefix=data.get("deviceTopicPrefix"), disconnect_message=Message.from_dict_or_none(data.get("disconnectMessage")), keep_alive_interval=data.get("keepAliveInterval"), last_will_testament=Message.from_dict_or_none( data.get("lastWillTestament") ), password=data.get("password"), ssl=Ssl.from_dict_or_none(data.get("ssl")), username=data.get("username"), ) def to_dict(self) -> ConfigT: """Create json dict from object.""" data: ConfigT = {"server": self.server.to_dict()} if self.activate_on_reboot is not None: data["activateOnReboot"] = self.activate_on_reboot if self.auto_reconnect is not None: data["autoReconnect"] = self.auto_reconnect if self.clean_session is not None: data["cleanSession"] = self.clean_session if self.client_id is not None: data["clientId"] = self.client_id if self.connect_message is not None: data["connectMessage"] = self.connect_message.to_dict() if self.connect_timeout is not None: data["connectTimeout"] = self.connect_timeout if self.disconnect_message is not None: data["disconnectMessage"] = self.disconnect_message.to_dict() if self.keep_alive_interval is not None: data["keepAliveInterval"] = self.keep_alive_interval if self.last_will_testament is not None: data["lastWillTestament"] = self.last_will_testament.to_dict() if self.password is not None: data["password"] = self.password if self.ssl is not None: data["ssl"] = self.ssl.to_dict() if self.username is not None: data["username"] = self.username return data
class ClientConfig: '''Represent client config.''' @classmethod def from_dict(cls, data: ConfigT) -> Self: '''Create client status object from dict.''' pass def to_dict(self) -> ConfigT: '''Create json dict from object.''' pass
4
3
24
0
23
1
7
0.71
0
4
4
0
1
0
2
2
117
11
62
18
58
44
44
17
41
13
0
1
14
141,345
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ClientConfigStatus
class ClientConfigStatus: """GetClientStatus response.""" config: ClientConfig """The Config of the MQTT client.""" status: ClientStatus """The Status of the MQTT client.""" @classmethod def from_dict(cls, data: ClientStatusDataT) -> Self: """Create client config status object from dict.""" return cls( config=ClientConfig.from_dict(data["config"]), status=ClientStatus.from_dict(data["status"]), )
class ClientConfigStatus: '''GetClientStatus response.''' @classmethod def from_dict(cls, data: ClientStatusDataT) -> Self: '''Create client config status object from dict.''' pass
3
2
6
0
5
1
1
0.44
0
3
3
0
0
0
1
1
15
2
9
3
6
4
5
2
3
1
0
0
1
141,346
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ClientConnectionState
class ClientConnectionState(enum.StrEnum): """The current connection state of the client.""" CONNECTED = "connected" DISCONNECTED = "disconnected" @classmethod def _missing_(cls, value: object) -> ClientConnectionState: """Set default enum member if an unknown value is provided. Some firmwares report "not connected" instead of "disconnected". """ return cls.DISCONNECTED
class ClientConnectionState(enum.StrEnum): '''The current connection state of the client.''' @classmethod def _missing_(cls, value: object) -> ClientConnectionState: '''Set default enum member if an unknown value is provided. Some firmwares report "not connected" instead of "disconnected". ''' pass
3
2
6
1
2
3
1
0.67
1
0
0
0
0
0
1
69
13
3
6
5
3
4
5
4
3
1
3
0
1
141,347
Kane610/axis
axis/models/mqtt.py
axis.models.mqtt.ClientState
class ClientState(enum.StrEnum): """The current state of the client.""" ACTIVE = "active" INACTIVE = "inactive"
class ClientState(enum.StrEnum): '''The current state of the client.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
68
5
1
3
3
2
1
3
3
2
0
3
0
0