Type Definitions
Response Types
- class hfortix_core.APIResponse[source]
Bases:
TypedDictBase API response structure from FortiOS
Not all fields are present in every response. Use total=False to make all fields optional.
- class hfortix_core.types.RawAPIResponse[source]
Bases:
TypedDictRaw FortiOS API response envelope returned when raw_json=True.
This is the complete response from the FortiOS API before any unwrapping. Use this for type checking raw_json=True calls.
All fields are marked as required to provide autocomplete without warnings. The primary purpose is to catch typos - accessing undefined fields will show an error.
Note: Not all fields are present in every response. GET responses include results, serial, version, build. Mutation responses include mkey, revision. Use .get() for fields that may not be present.
- Example GET response:
- {
“http_method”: “GET”, “results”: […], “status”: “success”, “http_status”: 200, “vdom”: “root”, “path”: “firewall”, “serial”: “FGT…”, “version”: “v7.4.8”, “build”: 3636
}
- Example POST/PUT/DELETE response:
- {
“http_method”: “POST”, “revision”: “1234567890”, “mkey”: “object_name”, “status”: “success”, “http_status”: 200, “vdom”: “root”
}
- class hfortix_core.types.MutationResponse[source]
Bases:
TypedDictResponse structure from POST/PUT/DELETE operations.
This TypedDict validates that only known API response fields are accessed. These fields are always present in FortiOS API mutation responses.
- class hfortix_core.types.MutationResponseFull[source]
Bases:
TypedDictExtended response structure from POST/PUT/DELETE operations.
Includes optional fields that may be present in some responses.
- class hfortix_core.ListResponse[source]
Bases:
TypedDictResponse from list/get operations that return multiple items
Connection & Request Types
- class hfortix_core.ConnectionStats[source]
Bases:
TypedDictConnection pool statistics
Returned by HTTPClient.get_connection_stats()