All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.apigateway.model.UpdateModelResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon API Gateway module holds the client classes that are used for communicating with Amazon API Gateway

There is a newer version: 2.0.0-preview-11
Show newest version
/*
 * 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 javax.annotation.Generated;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents the data structure of a method's request or response payload. *

*
*

* A request model defines the data structure of the client-supplied request payload. A response model defines the data * structure of the response payload returned by the back end. Although not required, models are useful for mapping * payloads between the front end and back end. *

*

* A model is used for generating an API's SDK, validating the input request body, and creating a skeletal mapping * template. *

*
*/ @Generated("software.amazon.awssdk:codegen") public class UpdateModelResponse extends APIGatewayResponse implements ToCopyableBuilder { private final String id; private final String name; private final String description; private final String schema; private final String contentType; private UpdateModelResponse(BuilderImpl builder) { super(builder); this.id = builder.id; this.name = builder.name; this.description = builder.description; this.schema = builder.schema; this.contentType = builder.contentType; } /** *

* The identifier for the model resource. *

* * @return The identifier for the model resource. */ public String id() { return id; } /** *

* The name of the model. Must be an alphanumeric string. *

* * @return The name of the model. Must be an alphanumeric string. */ public String name() { return name; } /** *

* The description of the model. *

* * @return The description of the model. */ public String description() { return description; } /** *

* The schema for the model. For application/json models, this should be JSON-schema draft v4 model. Do not include * "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as * the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your * API's SDK generated by API Gateway to fail. *

* * @return The schema for the model. For application/json models, this should be JSON-schema draft v4 model. Do not * include "\*/" characters in the description of any properties because such "\*/" characters may * be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing * the installation of your API's SDK generated by API Gateway to fail. */ public String schema() { return schema; } /** *

* The content-type for the model. *

* * @return The content-type for the model. */ public String contentType() { return contentType; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(schema()); hashCode = 31 * hashCode + Objects.hashCode(contentType()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateModelResponse)) { return false; } UpdateModelResponse other = (UpdateModelResponse) obj; return Objects.equals(id(), other.id()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(schema(), other.schema()) && Objects.equals(contentType(), other.contentType()); } @Override public String toString() { return ToString.builder("UpdateModelResponse").add("Id", id()).add("Name", name()).add("Description", description()) .add("Schema", schema()).add("ContentType", contentType()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "id": return Optional.of(clazz.cast(id())); case "name": return Optional.of(clazz.cast(name())); case "description": return Optional.of(clazz.cast(description())); case "schema": return Optional.of(clazz.cast(schema())); case "contentType": return Optional.of(clazz.cast(contentType())); default: return Optional.empty(); } } public interface Builder extends APIGatewayResponse.Builder, CopyableBuilder { /** *

* The identifier for the model resource. *

* * @param id * The identifier for the model resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* The name of the model. Must be an alphanumeric string. *

* * @param name * The name of the model. Must be an alphanumeric string. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The description of the model. *

* * @param description * The description of the model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The schema for the model. For application/json models, this should be JSON-schema draft v4 model. Do not * include "\*/" characters in the description of any properties because such "\*/" characters may be * interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the * installation of your API's SDK generated by API Gateway to fail. *

* * @param schema * The schema for the model. For application/json models, this should be JSON-schema draft v4 model. Do * not include "\*/" characters in the description of any properties because such "\*/" * characters may be interpreted as the closing marker for comments in some languages, such as Java or * JavaScript, causing the installation of your API's SDK generated by API Gateway to fail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schema(String schema); /** *

* The content-type for the model. *

* * @param contentType * The content-type for the model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentType(String contentType); } static final class BuilderImpl extends APIGatewayResponse.BuilderImpl implements Builder { private String id; private String name; private String description; private String schema; private String contentType; private BuilderImpl() { } private BuilderImpl(UpdateModelResponse model) { id(model.id); name(model.name); description(model.description); schema(model.schema); contentType(model.contentType); } 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 getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } 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 String getSchema() { return schema; } @Override public final Builder schema(String schema) { this.schema = schema; return this; } public final void setSchema(String schema) { this.schema = schema; } public final String getContentType() { return contentType; } @Override public final Builder contentType(String contentType) { this.contentType = contentType; return this; } public final void setContentType(String contentType) { this.contentType = contentType; } @Override public UpdateModelResponse build() { return new UpdateModelResponse(this); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy