/* * 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.apigateway.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Specifies the target API entity to which the documentation applies. *

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

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

*/ private String type; /** *

* The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. * The default value is / for the root resource. When an applicable child entity inherits the content * of another entity of the same type with more general specifications of the other location * attributes, the child entity's path attribute must match that of the parent entity as a prefix. *

*/ private String path; /** *

* The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value is * * for any method. When an applicable child entity inherits the content of an entity of the same type * with more general specifications of the other location attributes, the child entity's * method attribute must match that of the parent entity exactly. *

*/ private String method; /** *

* The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any status * code. When an applicable child entity inherits the content of an entity of the same type with more general * specifications of the other location attributes, the child entity's statusCode * attribute must match that of the parent entity exactly. *

*/ private String statusCode; /** *

* The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid field * for any other entity type. *

*/ private String name; /** *

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

* * @param type * The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. Content inheritance does not apply to any entity of the API, * AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or * RESOURCE type. * @see DocumentationPartType */ public void setType(String type) { this.type = type; } /** *

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

* * @return The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. Content inheritance does not apply to any entity of the API, * AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or * RESOURCE type. * @see DocumentationPartType */ public String getType() { return this.type; } /** *

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

* * @param type * The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. Content inheritance does not apply to any entity of the API, * AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or * RESOURCE type. * @return Returns a reference to this object so that method calls can be chained together. * @see DocumentationPartType */ public DocumentationPartLocation withType(String type) { setType(type); return this; } /** *

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

* * @param type * The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. Content inheritance does not apply to any entity of the API, * AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or * RESOURCE type. * @see DocumentationPartType */ public void setType(DocumentationPartType type) { withType(type); } /** *

* The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. Content inheritance does * not apply to any entity of the API, AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or RESOURCE type. *

* * @param type * The type of API entity to which the documentation content applies. Valid values are API, * AUTHORIZER, MODEL, RESOURCE, METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. Content inheritance does not apply to any entity of the API, * AUTHORIZER, METHOD, MODEL, REQUEST_BODY, or * RESOURCE type. * @return Returns a reference to this object so that method calls can be chained together. * @see DocumentationPartType */ public DocumentationPartLocation withType(DocumentationPartType type) { this.type = type.toString(); return this; } /** *

* The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. * The default value is / for the root resource. When an applicable child entity inherits the content * of another entity of the same type with more general specifications of the other location * attributes, the child entity's path attribute must match that of the parent entity as a prefix. *

* * @param path * The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY, RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is / for the * root resource. When an applicable child entity inherits the content of another entity of the same type * with more general specifications of the other location attributes, the child entity's * path attribute must match that of the parent entity as a prefix. */ public void setPath(String path) { this.path = path; } /** *

* The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. * The default value is / for the root resource. When an applicable child entity inherits the content * of another entity of the same type with more general specifications of the other location * attributes, the child entity's path attribute must match that of the parent entity as a prefix. *

* * @return The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY, RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is / for the * root resource. When an applicable child entity inherits the content of another entity of the same type * with more general specifications of the other location attributes, the child entity's * path attribute must match that of the parent entity as a prefix. */ public String getPath() { return this.path; } /** *

* The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. * The default value is / for the root resource. When an applicable child entity inherits the content * of another entity of the same type with more general specifications of the other location * attributes, the child entity's path attribute must match that of the parent entity as a prefix. *

* * @param path * The URL path of the target. It is a valid field for the API entity types of RESOURCE, * METHOD, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY, RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is / for the * root resource. When an applicable child entity inherits the content of another entity of the same type * with more general specifications of the other location attributes, the child entity's * path attribute must match that of the parent entity as a prefix. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentationPartLocation withPath(String path) { setPath(path); return this; } /** *

* The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value is * * for any method. When an applicable child entity inherits the content of an entity of the same type * with more general specifications of the other location attributes, the child entity's * method attribute must match that of the parent entity exactly. *

* * @param method * The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. The default value is * for any method. When an applicable child * entity inherits the content of an entity of the same type with more general specifications of the other * location attributes, the child entity's method attribute must match that of the * parent entity exactly. */ public void setMethod(String method) { this.method = method; } /** *

* The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value is * * for any method. When an applicable child entity inherits the content of an entity of the same type * with more general specifications of the other location attributes, the child entity's * method attribute must match that of the parent entity exactly. *

* * @return The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. The default value is * for any method. When an applicable child * entity inherits the content of an entity of the same type with more general specifications of the other * location attributes, the child entity's method attribute must match that of the * parent entity exactly. */ public String getMethod() { return this.method; } /** *

* The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and RESPONSE_BODY. The default value is * * for any method. When an applicable child entity inherits the content of an entity of the same type * with more general specifications of the other location attributes, the child entity's * method attribute must match that of the parent entity exactly. *

* * @param method * The HTTP verb of a method. It is a valid field for the API entity types of METHOD, * PATH_PARAMETER, QUERY_PARAMETER, REQUEST_HEADER, * REQUEST_BODY, RESPONSE, RESPONSE_HEADER, and * RESPONSE_BODY. The default value is * for any method. When an applicable child * entity inherits the content of an entity of the same type with more general specifications of the other * location attributes, the child entity's method attribute must match that of the * parent entity exactly. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentationPartLocation withMethod(String method) { setMethod(method); return this; } /** *

* The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any status * code. When an applicable child entity inherits the content of an entity of the same type with more general * specifications of the other location attributes, the child entity's statusCode * attribute must match that of the parent entity exactly. *

* * @param statusCode * The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any * status code. When an applicable child entity inherits the content of an entity of the same type with more * general specifications of the other location attributes, the child entity's * statusCode attribute must match that of the parent entity exactly. */ public void setStatusCode(String statusCode) { this.statusCode = statusCode; } /** *

* The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any status * code. When an applicable child entity inherits the content of an entity of the same type with more general * specifications of the other location attributes, the child entity's statusCode * attribute must match that of the parent entity exactly. *

* * @return The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE * , RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for * any status code. When an applicable child entity inherits the content of an entity of the same type with * more general specifications of the other location attributes, the child entity's * statusCode attribute must match that of the parent entity exactly. */ public String getStatusCode() { return this.statusCode; } /** *

* The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any status * code. When an applicable child entity inherits the content of an entity of the same type with more general * specifications of the other location attributes, the child entity's statusCode * attribute must match that of the parent entity exactly. *

* * @param statusCode * The HTTP status code of a response. It is a valid field for the API entity types of RESPONSE, * RESPONSE_HEADER, and RESPONSE_BODY. The default value is * for any * status code. When an applicable child entity inherits the content of an entity of the same type with more * general specifications of the other location attributes, the child entity's * statusCode attribute must match that of the parent entity exactly. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentationPartLocation withStatusCode(String statusCode) { setStatusCode(statusCode); return this; } /** *

* The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid field * for any other entity type. *

* * @param name * The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid * field for any other entity type. */ public void setName(String name) { this.name = name; } /** *

* The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid field * for any other entity type. *

* * @return The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid * field for any other entity type. */ public String getName() { return this.name; } /** *

* The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid field * for any other entity type. *

* * @param name * The name of the targeted API entity. It is a valid and required field for the API entity types of * AUTHORIZER, MODEL, PATH_PARAMETER, QUERY_PARAMETER, * REQUEST_HEADER, REQUEST_BODY and RESPONSE_HEADER. It is an invalid * field for any other entity type. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentationPartLocation withName(String name) { setName(name); 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 (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getPath() != null) sb.append("Path: ").append(getPath()).append(","); if (getMethod() != null) sb.append("Method: ").append(getMethod()).append(","); if (getStatusCode() != null) sb.append("StatusCode: ").append(getStatusCode()).append(","); if (getName() != null) sb.append("Name: ").append(getName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DocumentationPartLocation == false) return false; DocumentationPartLocation other = (DocumentationPartLocation) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getPath() == null ^ this.getPath() == null) return false; if (other.getPath() != null && other.getPath().equals(this.getPath()) == false) return false; if (other.getMethod() == null ^ this.getMethod() == null) return false; if (other.getMethod() != null && other.getMethod().equals(this.getMethod()) == false) return false; if (other.getStatusCode() == null ^ this.getStatusCode() == null) return false; if (other.getStatusCode() != null && other.getStatusCode().equals(this.getStatusCode()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getMethod() == null) ? 0 : getMethod().hashCode()); hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); return hashCode; } @Override public DocumentationPartLocation clone() { try { return (DocumentationPartLocation) 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.apigateway.model.transform.DocumentationPartLocationMarshaller.getInstance().marshall(this, protocolMarshaller); } }