All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.wafv2.model.CustomResponseBody Maven / Gradle / Ivy

/*
 * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.wafv2.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* The response body to use in a custom response to a web request. This is referenced by key from CustomResponse * CustomResponseBodyKey. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CustomResponseBody implements Serializable, Cloneable, StructuredPojo { /** *

* The type of content in the payload that you are defining in the Content string. *

*/ private String contentType; /** *

* The payload of the custom response. *

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer * Guide. *

*/ private String content; /** *

* The type of content in the payload that you are defining in the Content string. *

* * @param contentType * The type of content in the payload that you are defining in the Content string. * @see ResponseContentType */ public void setContentType(String contentType) { this.contentType = contentType; } /** *

* The type of content in the payload that you are defining in the Content string. *

* * @return The type of content in the payload that you are defining in the Content string. * @see ResponseContentType */ public String getContentType() { return this.contentType; } /** *

* The type of content in the payload that you are defining in the Content string. *

* * @param contentType * The type of content in the payload that you are defining in the Content string. * @return Returns a reference to this object so that method calls can be chained together. * @see ResponseContentType */ public CustomResponseBody withContentType(String contentType) { setContentType(contentType); return this; } /** *

* The type of content in the payload that you are defining in the Content string. *

* * @param contentType * The type of content in the payload that you are defining in the Content string. * @return Returns a reference to this object so that method calls can be chained together. * @see ResponseContentType */ public CustomResponseBody withContentType(ResponseContentType contentType) { this.contentType = contentType.toString(); return this; } /** *

* The payload of the custom response. *

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer * Guide. *

* * @param content * The payload of the custom response.

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF * Developer Guide. */ public void setContent(String content) { this.content = content; } /** *

* The payload of the custom response. *

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer * Guide. *

* * @return The payload of the custom response.

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF * Developer Guide. */ public String getContent() { return this.content; } /** *

* The payload of the custom response. *

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer * Guide. *

* * @param content * The payload of the custom response.

*

* You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the * ContentType setting. *

*

* For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CustomResponseBody withContent(String content) { setContent(content); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getContentType() != null) sb.append("ContentType: ").append(getContentType()).append(","); if (getContent() != null) sb.append("Content: ").append(getContent()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CustomResponseBody == false) return false; CustomResponseBody other = (CustomResponseBody) obj; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; if (other.getContent() == null ^ this.getContent() == null) return false; if (other.getContent() != null && other.getContent().equals(this.getContent()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); hashCode = prime * hashCode + ((getContent() == null) ? 0 : getContent().hashCode()); return hashCode; } @Override public CustomResponseBody clone() { try { return (CustomResponseBody) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.wafv2.model.transform.CustomResponseBodyMarshaller.getInstance().marshall(this, protocolMarshaller); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy