Response manager
nexthink_api.Clients.NxtResponse
Bases: BaseModel
Build different types of Nexthink API responses based on the provided Response object.
Parameters
response : Response
The response object to build the response from.
Returns
ResponseType
Raises
NxtApiException
If the status code is not one of the expected values.
response: ResponseApiType = Field(alias='value', default=None)
class-attribute
instance-attribute
model_config = ConfigDict(populate_by_name=True, arbitrary_types_allowed=True)
class-attribute
instance-attribute
value: ResponseApiType
property
Returns the value of the 'response' attribute.
from_response(response: Response) -> ResponseApiType
Build a Nexthink API response based on the provided Response object.
Parameters
response : Response
The response object to build the response from.
Returns
ResponseAPIType
The built response.
Raises
NxtApiException
If the status code is not one of the expected values.
build_nxt_enrichment_response(response: Response) -> EnrichmentResponseType
Build an Enrichment response through the domain builder.
build_nxt_act_response(response: Response) -> RemoteActionsResponseType
Build a Remote Actions response through the domain builder.
get_remote_actions_json(response: Response) -> dict | list
staticmethod
Return Remote Actions JSON through the domain builder.
build_nxt_workflow_response(response: Response) -> WorkflowResponseType
Build a Workflows response through the domain builder.
build_nxt_workflow_success_response(api: str | None, data: dict | list, path: str) -> WorkflowResponseType
staticmethod
Build a Workflows success response through the domain builder.
get_workflows_json(response: Response) -> dict | list
staticmethod
Return Workflows JSON through the domain builder.
build_nxt_data_management_response(response: Response) -> DataManagementResponseType
Build a Data Management response through the domain builder.
build_nxt_spark_response(response: Response) -> SparkResponseType
Build a Spark response through the domain builder.
get_spark_error_json(response: Response) -> dict
staticmethod
Return Spark error JSON through the domain builder.
get_data_management_json(response: Response, request_id: str | None) -> dict
staticmethod
Return Data Management JSON through the domain builder.
build_nxt_engage_response(response: Response) -> CampaignResponseType
Build a Campaigns response through the domain builder.
get_campaigns_json(response: Response) -> dict
staticmethod
Return Campaigns JSON through the domain builder.
build_nxt_nql_response(response: Response) -> NqlResponseType
Build an NQL response through the domain builder.
build_nxt_token_response(response: Response) -> NxtTokenResponse
Build a token response through the domain builder.