aito.client.responses.query_api_response.MatchResponse
- class aito.client.responses.query_api_response.MatchResponse(json)
Bases:
_GenericHitsResponse[ProbabilityHit]Response of the Match query
- Parameters:
json (Dict) – the original JSON response
Methods
create a class object from a JSON deserialized object
from_json_string(json_string, **kwargs)create an class object from a JSON string
the JSON schema of the class
json_schema_validate(obj)Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationErrorjson_schema_validate_with_schema(obj, schema)Validate an object with the given schema
convert the object to an object that can be serialized to a JSON formatted string
to_json_string(**kwargs)convert the object to a JSON string
Attributes
return the first hit
the class of the hit
the returned hits
the original JSON response of the request
return a list of matches in descending order of the estimated probability
the number of hits that is skipped
return the match with the highest probability
the total number of hits
- property first_hit: HitType
return the first hit
- Return type:
HitType
- classmethod from_deserialized_object(obj: Any)
create a class object from a JSON deserialized object
- classmethod from_json_string(json_string: str, **kwargs)
create an class object from a JSON string
- Parameters:
json_string (str) – the JSON string
kwargs – the keyword arguments for json.loads method
- property hit_cls: Type[HitType]
the class of the hit
- Return type:
Type[HitType]
- property hits: List[HitType]
the returned hits
- Return type:
List[HitType]
- property json
the original JSON response of the request
- Return type:
Dict
- classmethod json_schema()
the JSON schema of the class
- Return type:
Dict
- classmethod json_schema_validate(obj: Any)
Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationError- Parameters:
obj (Any) – the object to be validated
- Returns:
the object if validation succeed
- Return type:
Any
- json_schema_validate_with_schema(obj: Any, schema: Dict)
Validate an object with the given schema
- Parameters:
obj (Any) – the object to be validated
schema (Dict) – the schema to be validate against
- Returns:
the object if validation succeed
- Return type:
Any
- property matches: List[ProbabilityHit]
return a list of matches in descending order of the estimated probability
- Returns:
- Return type:
- property offset: int
the number of hits that is skipped
- Return type:
int
- to_json_serializable()
convert the object to an object that can be serialized to a JSON formatted string
- to_json_string(**kwargs)
convert the object to a JSON string
- Parameters:
kwargs – the keyword arguments for json.dumps method
- Return type:
str
- property top_match: ProbabilityHit
return the match with the highest probability
- Return type:
Dict
- property total: int
the total number of hits
- Return type:
int