Class DynamicHttpResponseBody


  • @Generated(value="OracleSDKGenerator",
               comments="API Version: 20210930")
    public final class DynamicHttpResponseBody
    extends HttpResponseBody
    Allows returning dynamically generated HTTP response body based on the provided template.

    The template allows variable interpolation by specifying variable name between the ‘${’ and ‘}’ delimiters. Escape sequences using ‘\’ are supported to allow usage of ‘\\’ and ‘\${’ in the template to return ‘\’ and ‘\${’ in final response.

    The following variables are supported:

    http.request.id - the HTTP request ID. For example: "d5fa953f75ef417e4c8008ef9336d779".

    Example: { "type": "DYNAMIC", "template": "{\ \\"code\\": 403,\ \\"message\\":\\"Unauthorised\\",\ \\"incidentId\\": \\"${http.request.id}\\"\ }" }

    Example with escape sequence: { "type": "DYNAMIC", "template": "\\\\${Returned as plain text}" }
    Note: Objects should always be created or deserialized using the DynamicHttpResponseBody.Builder. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of the DynamicHttpResponseBody.Builder, which maintain a set of all explicitly set fields called DynamicHttpResponseBody.Builder.__explicitlySet__. The hashCode() and equals(Object) methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).