software.amazon.awssdk.services.apigateway.model.GetDocumentationPartsRequest Maven / Gradle / Ivy
Show all versions of api-gateway Show documentation
/*
* Copyright 2013-2018 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 software.amazon.awssdk.services.apigateway.model;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import javax.annotation.Generated;
import software.amazon.awssdk.core.AwsRequestOverrideConfig;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Gets the documentation parts of an API. The result may be filtered by the type, name, or path of API entities
* (targets).
*
*/
@Generated("software.amazon.awssdk:codegen")
public class GetDocumentationPartsRequest extends APIGatewayRequest implements
ToCopyableBuilder {
private final String restApiId;
private final String type;
private final String nameQuery;
private final String path;
private final String position;
private final Integer limit;
private final String locationStatus;
private GetDocumentationPartsRequest(BuilderImpl builder) {
super(builder);
this.restApiId = builder.restApiId;
this.type = builder.type;
this.nameQuery = builder.nameQuery;
this.path = builder.path;
this.position = builder.position;
this.limit = builder.limit;
this.locationStatus = builder.locationStatus;
}
/**
*
* [Required] The string identifier of the associated RestApi.
*
*
* @return [Required] The string identifier of the associated RestApi.
*/
public String restApiId() {
return restApiId;
}
/**
*
* The type of API entities of the to-be-retrieved documentation parts.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link DocumentationPartType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeString}.
*
*
* @return The type of API entities of the to-be-retrieved documentation parts.
* @see DocumentationPartType
*/
public DocumentationPartType type() {
return DocumentationPartType.fromValue(type);
}
/**
*
* The type of API entities of the to-be-retrieved documentation parts.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link DocumentationPartType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeString}.
*
*
* @return The type of API entities of the to-be-retrieved documentation parts.
* @see DocumentationPartType
*/
public String typeString() {
return type;
}
/**
*
* The name of API entities of the to-be-retrieved documentation parts.
*
*
* @return The name of API entities of the to-be-retrieved documentation parts.
*/
public String nameQuery() {
return nameQuery;
}
/**
*
* The path of API entities of the to-be-retrieved documentation parts.
*
*
* @return The path of API entities of the to-be-retrieved documentation parts.
*/
public String path() {
return path;
}
/**
*
* The current pagination position in the paged result set.
*
*
* @return The current pagination position in the paged result set.
*/
public String position() {
return position;
}
/**
*
* The maximum number of returned results per page.
*
*
* @return The maximum number of returned results per page.
*/
public Integer limit() {
return limit;
}
/**
*
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for retrieving
* DocumentationPart resources with content and UNDOCUMENTED
for DocumentationPart
* resources without content.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #locationStatus}
* will return {@link LocationStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #locationStatusString}.
*
*
* @return The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
* @see LocationStatusType
*/
public LocationStatusType locationStatus() {
return LocationStatusType.fromValue(locationStatus);
}
/**
*
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for retrieving
* DocumentationPart resources with content and UNDOCUMENTED
for DocumentationPart
* resources without content.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #locationStatus}
* will return {@link LocationStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #locationStatusString}.
*
*
* @return The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
* @see LocationStatusType
*/
public String locationStatusString() {
return locationStatus;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(restApiId());
hashCode = 31 * hashCode + Objects.hashCode(typeString());
hashCode = 31 * hashCode + Objects.hashCode(nameQuery());
hashCode = 31 * hashCode + Objects.hashCode(path());
hashCode = 31 * hashCode + Objects.hashCode(position());
hashCode = 31 * hashCode + Objects.hashCode(limit());
hashCode = 31 * hashCode + Objects.hashCode(locationStatusString());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetDocumentationPartsRequest)) {
return false;
}
GetDocumentationPartsRequest other = (GetDocumentationPartsRequest) obj;
return Objects.equals(restApiId(), other.restApiId()) && Objects.equals(typeString(), other.typeString())
&& Objects.equals(nameQuery(), other.nameQuery()) && Objects.equals(path(), other.path())
&& Objects.equals(position(), other.position()) && Objects.equals(limit(), other.limit())
&& Objects.equals(locationStatusString(), other.locationStatusString());
}
@Override
public String toString() {
return ToString.builder("GetDocumentationPartsRequest").add("RestApiId", restApiId()).add("Type", typeString())
.add("NameQuery", nameQuery()).add("Path", path()).add("Position", position()).add("Limit", limit())
.add("LocationStatus", locationStatusString()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "restApiId":
return Optional.of(clazz.cast(restApiId()));
case "type":
return Optional.of(clazz.cast(typeString()));
case "nameQuery":
return Optional.of(clazz.cast(nameQuery()));
case "path":
return Optional.of(clazz.cast(path()));
case "position":
return Optional.of(clazz.cast(position()));
case "limit":
return Optional.of(clazz.cast(limit()));
case "locationStatus":
return Optional.of(clazz.cast(locationStatusString()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayRequest.Builder, CopyableBuilder {
/**
*
* [Required] The string identifier of the associated RestApi.
*
*
* @param restApiId
* [Required] The string identifier of the associated RestApi.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder restApiId(String restApiId);
/**
*
* The type of API entities of the to-be-retrieved documentation parts.
*
*
* @param type
* The type of API entities of the to-be-retrieved documentation parts.
* @see DocumentationPartType
* @return Returns a reference to this object so that method calls can be chained together.
* @see DocumentationPartType
*/
Builder type(String type);
/**
*
* The type of API entities of the to-be-retrieved documentation parts.
*
*
* @param type
* The type of API entities of the to-be-retrieved documentation parts.
* @see DocumentationPartType
* @return Returns a reference to this object so that method calls can be chained together.
* @see DocumentationPartType
*/
Builder type(DocumentationPartType type);
/**
*
* The name of API entities of the to-be-retrieved documentation parts.
*
*
* @param nameQuery
* The name of API entities of the to-be-retrieved documentation parts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nameQuery(String nameQuery);
/**
*
* The path of API entities of the to-be-retrieved documentation parts.
*
*
* @param path
* The path of API entities of the to-be-retrieved documentation parts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder path(String path);
/**
*
* The current pagination position in the paged result set.
*
*
* @param position
* The current pagination position in the paged result set.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder position(String position);
/**
*
* The maximum number of returned results per page.
*
*
* @param limit
* The maximum number of returned results per page.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder limit(Integer limit);
/**
*
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
*
*
* @param locationStatus
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
* @see LocationStatusType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocationStatusType
*/
Builder locationStatus(String locationStatus);
/**
*
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
*
*
* @param locationStatus
* The status of the API documentation parts to retrieve. Valid values are DOCUMENTED
for
* retrieving DocumentationPart resources with content and UNDOCUMENTED
for
* DocumentationPart resources without content.
* @see LocationStatusType
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocationStatusType
*/
Builder locationStatus(LocationStatusType locationStatus);
@Override
Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig);
}
static final class BuilderImpl extends APIGatewayRequest.BuilderImpl implements Builder {
private String restApiId;
private String type;
private String nameQuery;
private String path;
private String position;
private Integer limit;
private String locationStatus;
private BuilderImpl() {
}
private BuilderImpl(GetDocumentationPartsRequest model) {
restApiId(model.restApiId);
type(model.type);
nameQuery(model.nameQuery);
path(model.path);
position(model.position);
limit(model.limit);
locationStatus(model.locationStatus);
}
public final String getRestApiId() {
return restApiId;
}
@Override
public final Builder restApiId(String restApiId) {
this.restApiId = restApiId;
return this;
}
public final void setRestApiId(String restApiId) {
this.restApiId = restApiId;
}
public final String getType() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(DocumentationPartType type) {
this.type(type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final String getNameQuery() {
return nameQuery;
}
@Override
public final Builder nameQuery(String nameQuery) {
this.nameQuery = nameQuery;
return this;
}
public final void setNameQuery(String nameQuery) {
this.nameQuery = nameQuery;
}
public final String getPath() {
return path;
}
@Override
public final Builder path(String path) {
this.path = path;
return this;
}
public final void setPath(String path) {
this.path = path;
}
public final String getPosition() {
return position;
}
@Override
public final Builder position(String position) {
this.position = position;
return this;
}
public final void setPosition(String position) {
this.position = position;
}
public final Integer getLimit() {
return limit;
}
@Override
public final Builder limit(Integer limit) {
this.limit = limit;
return this;
}
public final void setLimit(Integer limit) {
this.limit = limit;
}
public final String getLocationStatus() {
return locationStatus;
}
@Override
public final Builder locationStatus(String locationStatus) {
this.locationStatus = locationStatus;
return this;
}
@Override
public final Builder locationStatus(LocationStatusType locationStatus) {
this.locationStatus(locationStatus.toString());
return this;
}
public final void setLocationStatus(String locationStatus) {
this.locationStatus = locationStatus;
}
@Override
public Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig) {
super.requestOverrideConfig(awsRequestOverrideConfig);
return this;
}
@Override
public Builder requestOverrideConfig(Consumer builderConsumer) {
super.requestOverrideConfig(builderConsumer);
return this;
}
@Override
public GetDocumentationPartsRequest build() {
return new GetDocumentationPartsRequest(this);
}
}
}