Package com.microsoft.kiota
Class MultipartBody
java.lang.Object
com.microsoft.kiota.MultipartBody
- All Implemented Interfaces:
Parsable
Represents a multipart body for a request or a response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe request adapter to use for the multipart body serialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidaddOrReplacePart(String name, String contentType, T value) Adds or replaces a part in the multipart body.<T> voidaddOrReplacePart(String name, String contentType, T value, String filename) Adds or replaces a part in the multipart body.Gets the boundary string for the multipart body.Gets the deserialization information for this object.getPartValue(String partName) Gets the content type of the part with the specified name.booleanremovePart(String partName) Gets the content type of the part with the specified name.voidserialize(SerializationWriter writer) Writes the objects properties to the current writer.
-
Field Details
-
requestAdapter
The request adapter to use for the multipart body serialization.
-
-
Constructor Details
-
MultipartBody
public MultipartBody()Creates a new instance of the MultipartBody class.
-
-
Method Details
-
getBoundary
Gets the boundary string for the multipart body.- Returns:
- the boundary string for the multipart body.
-
addOrReplacePart
public <T> void addOrReplacePart(@Nonnull String name, @Nonnull String contentType, @Nonnull T value) Adds or replaces a part in the multipart body.- Type Parameters:
T- the type of the part to add or replace.- Parameters:
name- the name of the part to add or replace.contentType- the content type of the part to add or replace.value- the value of the part to add or replace.
-
addOrReplacePart
public <T> void addOrReplacePart(@Nonnull String name, @Nonnull String contentType, @Nonnull T value, @Nullable String filename) Adds or replaces a part in the multipart body.- Type Parameters:
T- the type of the part to add or replace.- Parameters:
name- the name of the part to add or replace.contentType- the content type of the part to add or replace.value- the value of the part to add or replace.filename- the value of the filename directive.
-
getPartValue
Gets the content type of the part with the specified name.- Parameters:
partName- the name of the part to get.- Returns:
- the content type of the part with the specified name.
-
removePart
Gets the content type of the part with the specified name.- Parameters:
partName- the name of the part to get.- Returns:
- the content type of the part with the specified name.
-
getFieldDeserializers
Gets the deserialization information for this object.- Specified by:
getFieldDeserializersin interfaceParsable- Returns:
- The deserialization information for this object where each entry is a property key with its deserialization callback.
-
serialize
Writes the objects properties to the current writer.
-