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

software.amazon.awssdk.services.apigateway.model.BasePathMapping 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.29.15
Show newest version
/*
 * Copyright 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.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents the base path that callers of the API must provide as part of the URL after the domain name. *

*/ @Generated("software.amazon.awssdk:codegen") public final class BasePathMapping implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField BASE_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("basePath").getter(getter(BasePathMapping::basePath)).setter(setter(Builder::basePath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("basePath").build()).build(); private static final SdkField REST_API_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("restApiId").getter(getter(BasePathMapping::restApiId)).setter(setter(Builder::restApiId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("restApiId").build()).build(); private static final SdkField STAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("stage") .getter(getter(BasePathMapping::stage)).setter(setter(Builder::stage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stage").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASE_PATH_FIELD, REST_API_ID_FIELD, STAGE_FIELD)); private static final long serialVersionUID = 1L; private final String basePath; private final String restApiId; private final String stage; private BasePathMapping(BuilderImpl builder) { this.basePath = builder.basePath; this.restApiId = builder.restApiId; this.stage = builder.stage; } /** *

* The base path name that callers of the API must provide as part of the URL after the domain name. *

* * @return The base path name that callers of the API must provide as part of the URL after the domain name. */ public final String basePath() { return basePath; } /** *

* The string identifier of the associated RestApi. *

* * @return The string identifier of the associated RestApi. */ public final String restApiId() { return restApiId; } /** *

* The name of the associated stage. *

* * @return The name of the associated stage. */ public final String stage() { return stage; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(basePath()); hashCode = 31 * hashCode + Objects.hashCode(restApiId()); hashCode = 31 * hashCode + Objects.hashCode(stage()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof BasePathMapping)) { return false; } BasePathMapping other = (BasePathMapping) obj; return Objects.equals(basePath(), other.basePath()) && Objects.equals(restApiId(), other.restApiId()) && Objects.equals(stage(), other.stage()); } /** * 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. */ @Override public final String toString() { return ToString.builder("BasePathMapping").add("BasePath", basePath()).add("RestApiId", restApiId()) .add("Stage", stage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "basePath": return Optional.ofNullable(clazz.cast(basePath())); case "restApiId": return Optional.ofNullable(clazz.cast(restApiId())); case "stage": return Optional.ofNullable(clazz.cast(stage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((BasePathMapping) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The base path name that callers of the API must provide as part of the URL after the domain name. *

* * @param basePath * The base path name that callers of the API must provide as part of the URL after the domain name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder basePath(String basePath); /** *

* The string identifier of the associated RestApi. *

* * @param restApiId * 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 name of the associated stage. *

* * @param stage * The name of the associated stage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stage(String stage); } static final class BuilderImpl implements Builder { private String basePath; private String restApiId; private String stage; private BuilderImpl() { } private BuilderImpl(BasePathMapping model) { basePath(model.basePath); restApiId(model.restApiId); stage(model.stage); } public final String getBasePath() { return basePath; } public final void setBasePath(String basePath) { this.basePath = basePath; } @Override public final Builder basePath(String basePath) { this.basePath = basePath; return this; } public final String getRestApiId() { return restApiId; } public final void setRestApiId(String restApiId) { this.restApiId = restApiId; } @Override public final Builder restApiId(String restApiId) { this.restApiId = restApiId; return this; } public final String getStage() { return stage; } public final void setStage(String stage) { this.stage = stage; } @Override public final Builder stage(String stage) { this.stage = stage; return this; } @Override public BasePathMapping build() { return new BasePathMapping(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy