software.amazon.awssdk.services.apigateway.model.ImportApiKeysResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-gateway Show documentation
Show all versions of api-gateway Show documentation
The AWS Java SDK for Amazon API Gateway module holds the client classes that are used for communicating
with Amazon API
Gateway
/*
* 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.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The identifier of an ApiKey used in a UsagePlan.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class ImportApiKeysResponse extends APIGatewayResponse implements
ToCopyableBuilder {
private final List ids;
private final List warnings;
private ImportApiKeysResponse(BuilderImpl builder) {
super(builder);
this.ids = builder.ids;
this.warnings = builder.warnings;
}
/**
*
* A list of all the ApiKey identifiers.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of all the ApiKey identifiers.
*/
public List ids() {
return ids;
}
/**
*
* A list of warning messages.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of warning messages.
*/
public List warnings() {
return warnings;
}
@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(ids());
hashCode = 31 * hashCode + Objects.hashCode(warnings());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ImportApiKeysResponse)) {
return false;
}
ImportApiKeysResponse other = (ImportApiKeysResponse) obj;
return Objects.equals(ids(), other.ids()) && Objects.equals(warnings(), other.warnings());
}
@Override
public String toString() {
return ToString.builder("ImportApiKeysResponse").add("Ids", ids()).add("Warnings", warnings()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ids":
return Optional.of(clazz.cast(ids()));
case "warnings":
return Optional.of(clazz.cast(warnings()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayResponse.Builder, CopyableBuilder {
/**
*
* A list of all the ApiKey identifiers.
*
*
* @param ids
* A list of all the ApiKey identifiers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ids(Collection ids);
/**
*
* A list of all the ApiKey identifiers.
*
*
* @param ids
* A list of all the ApiKey identifiers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ids(String... ids);
/**
*
* A list of warning messages.
*
*
* @param warnings
* A list of warning messages.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder warnings(Collection warnings);
/**
*
* A list of warning messages.
*
*
* @param warnings
* A list of warning messages.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder warnings(String... warnings);
}
static final class BuilderImpl extends APIGatewayResponse.BuilderImpl implements Builder {
private List ids;
private List warnings;
private BuilderImpl() {
}
private BuilderImpl(ImportApiKeysResponse model) {
ids(model.ids);
warnings(model.warnings);
}
public final Collection getIds() {
return ids;
}
@Override
public final Builder ids(Collection ids) {
this.ids = ListOfStringCopier.copy(ids);
return this;
}
@Override
@SafeVarargs
public final Builder ids(String... ids) {
ids(Arrays.asList(ids));
return this;
}
public final void setIds(Collection ids) {
this.ids = ListOfStringCopier.copy(ids);
}
public final Collection getWarnings() {
return warnings;
}
@Override
public final Builder warnings(Collection warnings) {
this.warnings = ListOfStringCopier.copy(warnings);
return this;
}
@Override
@SafeVarargs
public final Builder warnings(String... warnings) {
warnings(Arrays.asList(warnings));
return this;
}
public final void setWarnings(Collection warnings) {
this.warnings = ListOfStringCopier.copy(warnings);
}
@Override
public ImportApiKeysResponse build() {
return new ImportApiKeysResponse(this);
}
}
}