Class DynamicHttpResponseBody
- java.lang.Object
-
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
- com.oracle.bmc.waf.model.HttpResponseBody
-
- com.oracle.bmc.waf.model.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 theDynamicHttpResponseBody.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 theDynamicHttpResponseBody.Builder
, which maintain a set of all explicitly set fields calledDynamicHttpResponseBody.Builder.__explicitlySet__
. ThehashCode()
andequals(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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DynamicHttpResponseBody.Builder
-
Nested classes/interfaces inherited from class com.oracle.bmc.waf.model.HttpResponseBody
HttpResponseBody.Type
-
-
Constructor Summary
Constructors Constructor Description DynamicHttpResponseBody(String template)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DynamicHttpResponseBody.Builder
builder()
Create a new builder.boolean
equals(Object o)
String
getTemplate()
Dynamic response bodyint
hashCode()
DynamicHttpResponseBody.Builder
toBuilder()
String
toString()
String
toString(boolean includeByteArrayContents)
Return a string representation of the object.
-
-
-
Constructor Detail
-
DynamicHttpResponseBody
@Deprecated public DynamicHttpResponseBody(String template)
Deprecated.
-
-
Method Detail
-
builder
public static DynamicHttpResponseBody.Builder builder()
Create a new builder.
-
toBuilder
public DynamicHttpResponseBody.Builder toBuilder()
-
getTemplate
public String getTemplate()
Dynamic response body- Returns:
- the value
-
toString
public String toString()
- Overrides:
toString
in classHttpResponseBody
-
toString
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.- Overrides:
toString
in classHttpResponseBody
- Parameters:
includeByteArrayContents
- true to include the full contents of byte arrays- Returns:
- string representation
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classHttpResponseBody
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classHttpResponseBody
-
-