Package com.microsoft.kiota
Class NativeResponseHandler
java.lang.Object
com.microsoft.kiota.NativeResponseHandler
- All Implemented Interfaces:
ResponseHandler
The
ResponseHandler implementation to handle native response objects-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap<String, ParsableFactory<? extends Parsable>> Get the error mappings for the response when deserializing failed response bodies.getValue()Get the value for the response.<NativeResponseType,ModelType>
ModelTypehandleResponse(NativeResponseType response, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings) Callback method that is invoked when a response is received.voidsetErrorMappings(Map<String, ParsableFactory<? extends Parsable>> errorMappings) Set the error mappings for the response to use when deserializing failed responses bodies.
-
Constructor Details
-
NativeResponseHandler
public NativeResponseHandler()Default constructor
-
-
Method Details
-
handleResponse
public <NativeResponseType,ModelType> ModelType handleResponse(@Nonnull NativeResponseType response, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings) Description copied from interface:ResponseHandlerCallback method that is invoked when a response is received.- Specified by:
handleResponsein interfaceResponseHandler- Type Parameters:
NativeResponseType- The type of the native response object.ModelType- The type of the response model object.- Parameters:
response- The native response object.errorMappings- the error mappings for the response to use when deserializing failed responses bodies. Where an error code like 401 applies specifically to that status code, a class code like 4XX applies to all status codes within the range if an the specific error code is not present.- Returns:
- The deserialized response model object.
-
setErrorMappings
public void setErrorMappings(@Nonnull Map<String, ParsableFactory<? extends Parsable>> errorMappings) Set the error mappings for the response to use when deserializing failed responses bodies.- Parameters:
errorMappings- The designated error mappings.
-
getErrorMappings
Get the error mappings for the response when deserializing failed response bodies.- Returns:
- The error mappings for failed response bodies.
-
getValue
Get the value for the response.- Returns:
- the value of the response.
-