/* * 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; /** *
* Represents a REST API. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetRestApiResult extends com.amazonaws.AmazonWebServiceResult* The API's identifier. This identifier is unique across all of your APIs in API Gateway. *
*/ private String id; /** ** The API's name. *
*/ private String name; /** ** The API's description. *
*/ private String description; /** ** The timestamp when the API was created. *
*/ private java.util.Date createdDate; /** ** A version identifier for the API. *
*/ private String version; /** *
* The warning messages reported when failonwarnings
is turned on during API import.
*
* The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text * payloads. *
*/ private java.util.List* A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, * inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or * decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero * allows compression for any payload size. *
*/ private Integer minimumCompressionSize; /** *
* The source of the API key for metering requests according to a usage plan. Valid values are: >
* HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
*
* The endpoint configuration of this RestApi showing the endpoint types of the API. *
*/ private EndpointConfiguration endpointConfiguration; /** ** A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. *
*/ private String policy; /** ** The collection of tags. Each tag element is associated with a given resource. *
*/ private java.util.Map
* Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default,
* clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
* endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
*
* The API's identifier. This identifier is unique across all of your APIs in API Gateway. *
* * @param id * The API's identifier. This identifier is unique across all of your APIs in API Gateway. */ public void setId(String id) { this.id = id; } /** ** The API's identifier. This identifier is unique across all of your APIs in API Gateway. *
* * @return The API's identifier. This identifier is unique across all of your APIs in API Gateway. */ public String getId() { return this.id; } /** ** The API's identifier. This identifier is unique across all of your APIs in API Gateway. *
* * @param id * The API's identifier. This identifier is unique across all of your APIs in API Gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withId(String id) { setId(id); return this; } /** ** The API's name. *
* * @param name * The API's name. */ public void setName(String name) { this.name = name; } /** ** The API's name. *
* * @return The API's name. */ public String getName() { return this.name; } /** ** The API's name. *
* * @param name * The API's name. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withName(String name) { setName(name); return this; } /** ** The API's description. *
* * @param description * The API's description. */ public void setDescription(String description) { this.description = description; } /** ** The API's description. *
* * @return The API's description. */ public String getDescription() { return this.description; } /** ** The API's description. *
* * @param description * The API's description. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withDescription(String description) { setDescription(description); return this; } /** ** The timestamp when the API was created. *
* * @param createdDate * The timestamp when the API was created. */ public void setCreatedDate(java.util.Date createdDate) { this.createdDate = createdDate; } /** ** The timestamp when the API was created. *
* * @return The timestamp when the API was created. */ public java.util.Date getCreatedDate() { return this.createdDate; } /** ** The timestamp when the API was created. *
* * @param createdDate * The timestamp when the API was created. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withCreatedDate(java.util.Date createdDate) { setCreatedDate(createdDate); return this; } /** ** A version identifier for the API. *
* * @param version * A version identifier for the API. */ public void setVersion(String version) { this.version = version; } /** ** A version identifier for the API. *
* * @return A version identifier for the API. */ public String getVersion() { return this.version; } /** ** A version identifier for the API. *
* * @param version * A version identifier for the API. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withVersion(String version) { setVersion(version); return this; } /** *
* The warning messages reported when failonwarnings
is turned on during API import.
*
failonwarnings
is turned on during API import.
*/
public java.util.List
* The warning messages reported when failonwarnings
is turned on during API import.
*
failonwarnings
is turned on during API import.
*/
public void setWarnings(java.util.Collection
* The warning messages reported when failonwarnings
is turned on during API import.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setWarnings(java.util.Collection)} or {@link #withWarnings(java.util.Collection)} if you want to override * the existing values. *
* * @param warnings * The warning messages reported whenfailonwarnings
is turned on during API import.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetRestApiResult withWarnings(String... warnings) {
if (this.warnings == null) {
setWarnings(new java.util.ArrayList
* The warning messages reported when failonwarnings
is turned on during API import.
*
failonwarnings
is turned on during API import.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetRestApiResult withWarnings(java.util.Collection* The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text * payloads. *
* * @return The list of binary media types supported by the RestApi. By default, the RestApi supports only * UTF-8-encoded text payloads. */ public java.util.List* The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text * payloads. *
* * @param binaryMediaTypes * The list of binary media types supported by the RestApi. By default, the RestApi supports only * UTF-8-encoded text payloads. */ public void setBinaryMediaTypes(java.util.Collection* The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text * payloads. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setBinaryMediaTypes(java.util.Collection)} or {@link #withBinaryMediaTypes(java.util.Collection)} if you * want to override the existing values. *
* * @param binaryMediaTypes * The list of binary media types supported by the RestApi. By default, the RestApi supports only * UTF-8-encoded text payloads. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withBinaryMediaTypes(String... binaryMediaTypes) { if (this.binaryMediaTypes == null) { setBinaryMediaTypes(new java.util.ArrayList* The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text * payloads. *
* * @param binaryMediaTypes * The list of binary media types supported by the RestApi. By default, the RestApi supports only * UTF-8-encoded text payloads. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withBinaryMediaTypes(java.util.Collection* A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, * inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or * decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero * allows compression for any payload size. *
* * @param minimumCompressionSize * A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) * bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, * compression or decompression is not applied on the payload if the payload size is smaller than this value. * Setting it to zero allows compression for any payload size. */ public void setMinimumCompressionSize(Integer minimumCompressionSize) { this.minimumCompressionSize = minimumCompressionSize; } /** ** A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, * inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or * decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero * allows compression for any payload size. *
* * @return A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) * bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, * compression or decompression is not applied on the payload if the payload size is smaller than this * value. Setting it to zero allows compression for any payload size. */ public Integer getMinimumCompressionSize() { return this.minimumCompressionSize; } /** ** A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, * inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or * decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero * allows compression for any payload size. *
* * @param minimumCompressionSize * A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) * bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, * compression or decompression is not applied on the payload if the payload size is smaller than this value. * Setting it to zero allows compression for any payload size. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withMinimumCompressionSize(Integer minimumCompressionSize) { setMinimumCompressionSize(minimumCompressionSize); return this; } /** *
* The source of the API key for metering requests according to a usage plan. Valid values are: >
* HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
*
HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom
* authorizer.
* @see ApiKeySourceType
*/
public void setApiKeySource(String apiKeySource) {
this.apiKeySource = apiKeySource;
}
/**
*
* The source of the API key for metering requests according to a usage plan. Valid values are: >
* HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
*
HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom
* authorizer.
* @see ApiKeySourceType
*/
public String getApiKeySource() {
return this.apiKeySource;
}
/**
*
* The source of the API key for metering requests according to a usage plan. Valid values are: >
* HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
*
HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom
* authorizer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiKeySourceType
*/
public GetRestApiResult withApiKeySource(String apiKeySource) {
setApiKeySource(apiKeySource);
return this;
}
/**
*
* The source of the API key for metering requests according to a usage plan. Valid values are: >
* HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom authorizer.
*
HEADER
to read the API key from the X-API-Key
header of a request.
* AUTHORIZER
to read the API key from the UsageIdentifierKey
from a custom
* authorizer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiKeySourceType
*/
public GetRestApiResult withApiKeySource(ApiKeySourceType apiKeySource) {
this.apiKeySource = apiKeySource.toString();
return this;
}
/**
* * The endpoint configuration of this RestApi showing the endpoint types of the API. *
* * @param endpointConfiguration * The endpoint configuration of this RestApi showing the endpoint types of the API. */ public void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) { this.endpointConfiguration = endpointConfiguration; } /** ** The endpoint configuration of this RestApi showing the endpoint types of the API. *
* * @return The endpoint configuration of this RestApi showing the endpoint types of the API. */ public EndpointConfiguration getEndpointConfiguration() { return this.endpointConfiguration; } /** ** The endpoint configuration of this RestApi showing the endpoint types of the API. *
* * @param endpointConfiguration * The endpoint configuration of this RestApi showing the endpoint types of the API. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withEndpointConfiguration(EndpointConfiguration endpointConfiguration) { setEndpointConfiguration(endpointConfiguration); return this; } /** ** A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. *
* * @param policy * A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. */ public void setPolicy(String policy) { this.policy = policy; } /** ** A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. *
* * @return A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. */ public String getPolicy() { return this.policy; } /** ** A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. *
* * @param policy * A stringified JSON policy document that applies to this RestApi regardless of the caller and Method * configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withPolicy(String policy) { setPolicy(policy); return this; } /** ** The collection of tags. Each tag element is associated with a given resource. *
* * @return The collection of tags. Each tag element is associated with a given resource. */ public java.util.Map* The collection of tags. Each tag element is associated with a given resource. *
* * @param tags * The collection of tags. Each tag element is associated with a given resource. */ public void setTags(java.util.Map* The collection of tags. Each tag element is associated with a given resource. *
* * @param tags * The collection of tags. Each tag element is associated with a given resource. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRestApiResult withTags(java.util.Map
* Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default,
* clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
* endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
*
execute-api
endpoint. By
* default, clients can invoke your API with the default
* https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a
* custom domain name to invoke your API, disable the default endpoint.
*/
public void setDisableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) {
this.disableExecuteApiEndpoint = disableExecuteApiEndpoint;
}
/**
*
* Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default,
* clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
* endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
*
execute-api
endpoint. By
* default, clients can invoke your API with the default
* https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a
* custom domain name to invoke your API, disable the default endpoint.
*/
public Boolean getDisableExecuteApiEndpoint() {
return this.disableExecuteApiEndpoint;
}
/**
*
* Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default,
* clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
* endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
*
execute-api
endpoint. By
* default, clients can invoke your API with the default
* https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a
* custom domain name to invoke your API, disable the default endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetRestApiResult withDisableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) {
setDisableExecuteApiEndpoint(disableExecuteApiEndpoint);
return this;
}
/**
*
* Specifies whether clients can invoke your API by using the default execute-api
endpoint. By default,
* clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com
* endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
*
execute-api
endpoint. By
* default, clients can invoke your API with the default
* https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a
* custom domain name to invoke your API, disable the default endpoint.
*/
public Boolean isDisableExecuteApiEndpoint() {
return this.disableExecuteApiEndpoint;
}
/**
* 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 (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getCreatedDate() != null)
sb.append("CreatedDate: ").append(getCreatedDate()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getWarnings() != null)
sb.append("Warnings: ").append(getWarnings()).append(",");
if (getBinaryMediaTypes() != null)
sb.append("BinaryMediaTypes: ").append(getBinaryMediaTypes()).append(",");
if (getMinimumCompressionSize() != null)
sb.append("MinimumCompressionSize: ").append(getMinimumCompressionSize()).append(",");
if (getApiKeySource() != null)
sb.append("ApiKeySource: ").append(getApiKeySource()).append(",");
if (getEndpointConfiguration() != null)
sb.append("EndpointConfiguration: ").append(getEndpointConfiguration()).append(",");
if (getPolicy() != null)
sb.append("Policy: ").append(getPolicy()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getDisableExecuteApiEndpoint() != null)
sb.append("DisableExecuteApiEndpoint: ").append(getDisableExecuteApiEndpoint());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetRestApiResult == false)
return false;
GetRestApiResult other = (GetRestApiResult) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getCreatedDate() == null ^ this.getCreatedDate() == null)
return false;
if (other.getCreatedDate() != null && other.getCreatedDate().equals(this.getCreatedDate()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getWarnings() == null ^ this.getWarnings() == null)
return false;
if (other.getWarnings() != null && other.getWarnings().equals(this.getWarnings()) == false)
return false;
if (other.getBinaryMediaTypes() == null ^ this.getBinaryMediaTypes() == null)
return false;
if (other.getBinaryMediaTypes() != null && other.getBinaryMediaTypes().equals(this.getBinaryMediaTypes()) == false)
return false;
if (other.getMinimumCompressionSize() == null ^ this.getMinimumCompressionSize() == null)
return false;
if (other.getMinimumCompressionSize() != null && other.getMinimumCompressionSize().equals(this.getMinimumCompressionSize()) == false)
return false;
if (other.getApiKeySource() == null ^ this.getApiKeySource() == null)
return false;
if (other.getApiKeySource() != null && other.getApiKeySource().equals(this.getApiKeySource()) == false)
return false;
if (other.getEndpointConfiguration() == null ^ this.getEndpointConfiguration() == null)
return false;
if (other.getEndpointConfiguration() != null && other.getEndpointConfiguration().equals(this.getEndpointConfiguration()) == false)
return false;
if (other.getPolicy() == null ^ this.getPolicy() == null)
return false;
if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getDisableExecuteApiEndpoint() == null ^ this.getDisableExecuteApiEndpoint() == null)
return false;
if (other.getDisableExecuteApiEndpoint() != null && other.getDisableExecuteApiEndpoint().equals(this.getDisableExecuteApiEndpoint()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getWarnings() == null) ? 0 : getWarnings().hashCode());
hashCode = prime * hashCode + ((getBinaryMediaTypes() == null) ? 0 : getBinaryMediaTypes().hashCode());
hashCode = prime * hashCode + ((getMinimumCompressionSize() == null) ? 0 : getMinimumCompressionSize().hashCode());
hashCode = prime * hashCode + ((getApiKeySource() == null) ? 0 : getApiKeySource().hashCode());
hashCode = prime * hashCode + ((getEndpointConfiguration() == null) ? 0 : getEndpointConfiguration().hashCode());
hashCode = prime * hashCode + ((getPolicy() == null) ? 0 : getPolicy().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getDisableExecuteApiEndpoint() == null) ? 0 : getDisableExecuteApiEndpoint().hashCode());
return hashCode;
}
@Override
public GetRestApiResult clone() {
try {
return (GetRestApiResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}