public class SidecarRequestBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.api.metadata.TypedValue<InputStream> |
build(com.mulesoft.connectors.dynamics365bc.internal.connection.MicrosoftRestConnection connection)
Uses DataWeave to convert the request from a Java Map to a valid JSON InputStream
|
static SidecarRequestBuilder |
builder()
Use to retrieve the builder object in a readable way
|
SidecarRequestBuilder |
withParam(String paramName,
Object value)
Add a single Key-Value pair to the payload.
|
<T> SidecarRequestBuilder |
withUnpacked(String prefix,
Object object,
Class<T> clazz)
Unpacks the fields of another object and adds them to the request body in the form of: prefix{FieldName} = {fieldValue}
This way you can simplify adding entire parameter groups to the request with a single line.
|
public SidecarRequestBuilder withParam(String paramName, Object value)
paramName - - Name of the parameter to addvalue - - Value of the parameterpublic <T> SidecarRequestBuilder withUnpacked(String prefix, Object object, Class<T> clazz)
T - - the type of the group objectprefix - - the prefix to prepend to each field nameobject - - the parameter group object to unpackclazz - - the class of the parameter group object (required because Mule packs ParameterGroups as Proxy objects, which
disrupts the usage of getClass())public org.mule.runtime.api.metadata.TypedValue<InputStream> build(com.mulesoft.connectors.dynamics365bc.internal.connection.MicrosoftRestConnection connection)
connection - the connection to use when applying expressionsTypedValuepublic static SidecarRequestBuilder builder()
Copyright © 2023 MuleSoft, Inc.. All rights reserved.