software.amazon.awssdk.services.apigateway.model.UpdateDeploymentResponse 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.time.Instant;
import java.util.Map;
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;
/**
*
* An immutable representation of a RestApi resource that can be called by users using Stages. A
* deployment must be associated with a Stage for it to be callable over the Internet.
*
* To create a deployment, call POST
on the Deployments resource of a
* RestApi. To view, update, or delete a deployment, call GET
, PATCH
, or
* DELETE
on the specified deployment resource (
* /restapis/{restapi_id}/deployments/{deployment_id}
).
*/
@Generated("software.amazon.awssdk:codegen")
public class UpdateDeploymentResponse extends APIGatewayResponse implements
ToCopyableBuilder {
private final String id;
private final String description;
private final Instant createdDate;
private final Map> apiSummary;
private UpdateDeploymentResponse(BuilderImpl builder) {
super(builder);
this.id = builder.id;
this.description = builder.description;
this.createdDate = builder.createdDate;
this.apiSummary = builder.apiSummary;
}
/**
*
* The identifier for the deployment resource.
*
*
* @return The identifier for the deployment resource.
*/
public String id() {
return id;
}
/**
*
* The description for the deployment resource.
*
*
* @return The description for the deployment resource.
*/
public String description() {
return description;
}
/**
*
* The date and time that the deployment resource was created.
*
*
* @return The date and time that the deployment resource was created.
*/
public Instant createdDate() {
return createdDate;
}
/**
*
* A summary of the RestApi at the date and time that the deployment resource was created.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A summary of the RestApi at the date and time that the deployment resource was created.
*/
public Map> apiSummary() {
return apiSummary;
}
@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(id());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(createdDate());
hashCode = 31 * hashCode + Objects.hashCode(apiSummary());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateDeploymentResponse)) {
return false;
}
UpdateDeploymentResponse other = (UpdateDeploymentResponse) obj;
return Objects.equals(id(), other.id()) && Objects.equals(description(), other.description())
&& Objects.equals(createdDate(), other.createdDate()) && Objects.equals(apiSummary(), other.apiSummary());
}
@Override
public String toString() {
return ToString.builder("UpdateDeploymentResponse").add("Id", id()).add("Description", description())
.add("CreatedDate", createdDate()).add("ApiSummary", apiSummary()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "id":
return Optional.of(clazz.cast(id()));
case "description":
return Optional.of(clazz.cast(description()));
case "createdDate":
return Optional.of(clazz.cast(createdDate()));
case "apiSummary":
return Optional.of(clazz.cast(apiSummary()));
default:
return Optional.empty();
}
}
public interface Builder extends APIGatewayResponse.Builder, CopyableBuilder {
/**
*
* The identifier for the deployment resource.
*
*
* @param id
* The identifier for the deployment resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder id(String id);
/**
*
* The description for the deployment resource.
*
*
* @param description
* The description for the deployment resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* The date and time that the deployment resource was created.
*
*
* @param createdDate
* The date and time that the deployment resource was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdDate(Instant createdDate);
/**
*
* A summary of the RestApi at the date and time that the deployment resource was created.
*
*
* @param apiSummary
* A summary of the RestApi at the date and time that the deployment resource was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder apiSummary(Map> apiSummary);
}
static final class BuilderImpl extends APIGatewayResponse.BuilderImpl implements Builder {
private String id;
private String description;
private Instant createdDate;
private Map> apiSummary;
private BuilderImpl() {
}
private BuilderImpl(UpdateDeploymentResponse model) {
id(model.id);
description(model.description);
createdDate(model.createdDate);
apiSummary(model.apiSummary);
}
public final String getId() {
return id;
}
@Override
public final Builder id(String id) {
this.id = id;
return this;
}
public final void setId(String id) {
this.id = id;
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
public final Instant getCreatedDate() {
return createdDate;
}
@Override
public final Builder createdDate(Instant createdDate) {
this.createdDate = createdDate;
return this;
}
public final void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public final Map> getApiSummary() {
return apiSummary;
}
@Override
public final Builder apiSummary(Map> apiSummary) {
this.apiSummary = PathToMapOfMethodSnapshotCopier.copy(apiSummary);
return this;
}
public final void setApiSummary(Map> apiSummary) {
this.apiSummary = PathToMapOfMethodSnapshotCopier.copy(apiSummary);
}
@Override
public UpdateDeploymentResponse build() {
return new UpdateDeploymentResponse(this);
}
}
}