Package com.microsoft.kiota
Interface RequestAdapter
public interface RequestAdapter
Service responsible for translating abstract Request Info into concrete native HTTP requests.
-
Method Summary
Modifier and TypeMethodDescription<T> TconvertToNativeRequest(RequestInformation requestInfo) Converts the given RequestInformation into a native HTTP request.voidenableBackingStore(BackingStoreFactory backingStoreFactory) Enables the backing store proxies for the SerializationWriters and ParseNodes in use.Gets The base url for every request.Gets the serialization writer factory currently in use for the HTTP core service.<ModelType extends Parsable>
ModelTypesend(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, ParsableFactory<ModelType> factory) Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model.sendCollection(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, ParsableFactory<ModelType> factory) Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection.<ModelType extends Enum<ModelType>>
ModelTypesendEnum(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, ValuedEnumParser<ModelType> enumParser) Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum value.sendEnumCollection(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, ValuedEnumParser<ModelType> enumParser) Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum collection value.<ModelType>
ModelTypesendPrimitive(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, Class<ModelType> targetClass) Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model.<ModelType>
List<ModelType> sendPrimitiveCollection(RequestInformation requestInfo, HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, Class<ModelType> targetClass) Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive collection response model.voidsetBaseUrl(String baseUrl) Sets The base url for every request.
-
Method Details
-
enableBackingStore
Enables the backing store proxies for the SerializationWriters and ParseNodes in use.- Parameters:
backingStoreFactory- The backing store factory to use.
-
getSerializationWriterFactory
Gets the serialization writer factory currently in use for the HTTP core service.- Returns:
- the serialization writer factory currently in use for the HTTP core service.
-
send
@Nullable <ModelType extends Parsable> ModelType send(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull ParsableFactory<ModelType> factory) Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.factory- the factory to create the parsable object from the type discriminator.- Returns:
- the deserialized response model.
-
sendCollection
@Nullable <ModelType extends Parsable> List<ModelType> sendCollection(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull ParsableFactory<ModelType> factory) Executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.factory- the factory to create the parsable object from the type discriminator.- Returns:
- the deserialized response model collection.
-
sendPrimitive
@Nullable <ModelType> ModelType sendPrimitive(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull Class<ModelType> targetClass) Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.targetClass- the class of the response model to deserialize the response into.- Returns:
- the deserialized primitive response model.
-
sendPrimitiveCollection
@Nullable <ModelType> List<ModelType> sendPrimitiveCollection(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull Class<ModelType> targetClass) Executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive collection response model.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.targetClass- the class of the response model to deserialize the response into.- Returns:
- the deserialized primitive collection response model.
-
sendEnum
@Nullable <ModelType extends Enum<ModelType>> ModelType sendEnum(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull ValuedEnumParser<ModelType> enumParser) Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum value.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.enumParser- a parser from string to enum instances.- Returns:
- the deserialized primitive response model.
-
sendEnumCollection
@Nullable <ModelType extends Enum<ModelType>> List<ModelType> sendEnumCollection(@Nonnull RequestInformation requestInfo, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings, @Nonnull ValuedEnumParser<ModelType> enumParser) Executes the HTTP request specified by the given RequestInformation and returns the deserialized enum collection value.- Type Parameters:
ModelType- the type of the response model to deserialize the response into.- Parameters:
requestInfo- the request info to execute.errorMappings- the error factories mapping to use in case of a failed request.enumParser- a parser from string to enum instances.- Returns:
- the deserialized primitive response model.
-
setBaseUrl
Sets The base url for every request.- Parameters:
baseUrl- The base url for every request.
-
getBaseUrl
Gets The base url for every request.- Returns:
- The base url for every request.
-
convertToNativeRequest
Converts the given RequestInformation into a native HTTP request.- Type Parameters:
T- the type of the native HTTP request.- Parameters:
requestInfo- the request info to convert.- Returns:
- the native HTTP request.
-