Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.apigateway.model.GetSdkRequest 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
/*
* 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.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Request a new generated client SDK for a RestApi and Stage .
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetSdkRequest extends ApiGatewayRequest implements ToCopyableBuilder {
private static final SdkField REST_API_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("restApiId").getter(getter(GetSdkRequest::restApiId)).setter(setter(Builder::restApiId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("restapi_id").build()).build();
private static final SdkField STAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("stageName").getter(getter(GetSdkRequest::stageName)).setter(setter(Builder::stageName))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("stage_name").build()).build();
private static final SdkField SDK_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sdkType").getter(getter(GetSdkRequest::sdkType)).setter(setter(Builder::sdkType))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("sdk_type").build()).build();
private static final SdkField> PARAMETERS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("parameters")
.getter(getter(GetSdkRequest::parameters))
.setter(setter(Builder::parameters))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("parameters").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REST_API_ID_FIELD,
STAGE_NAME_FIELD, SDK_TYPE_FIELD, PARAMETERS_FIELD));
private final String restApiId;
private final String stageName;
private final String sdkType;
private final Map parameters;
private GetSdkRequest(BuilderImpl builder) {
super(builder);
this.restApiId = builder.restApiId;
this.stageName = builder.stageName;
this.sdkType = builder.sdkType;
this.parameters = builder.parameters;
}
/**
*
* [Required] The string identifier of the associated RestApi .
*
*
* @return [Required] The string identifier of the associated RestApi .
*/
public final String restApiId() {
return restApiId;
}
/**
*
* [Required] The name of the Stage that the SDK will use.
*
*
* @return [Required] The name of the Stage that the SDK will use.
*/
public final String stageName() {
return stageName;
}
/**
*
* [Required] The language for the generated SDK. Currently java
, javascript
,
* android
, objectivec
(for iOS), swift
(for iOS), and ruby
are
* supported.
*
*
* @return [Required] The language for the generated SDK. Currently java
, javascript
,
* android
, objectivec
(for iOS), swift
(for iOS), and
* ruby
are supported.
*/
public final String sdkType() {
return sdkType;
}
/**
* Returns true if the Parameters property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasParameters() {
return parameters != null && !(parameters instanceof SdkAutoConstructMap);
}
/**
*
* A string-to-string key-value map of query parameters sdkType
-dependent properties of the SDK. For
* sdkType
of objectivec
or swift
, a parameter named classPrefix
* is required. For sdkType
of android
, parameters named groupId
,
* artifactId
, artifactVersion
, and invokerPackage
are required. For
* sdkType
of java
, parameters named serviceName
and
* javaPackageName
are required.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasParameters()} to see if a value was sent in this field.
*
*
* @return A string-to-string key-value map of query parameters sdkType
-dependent properties of the
* SDK. For sdkType
of objectivec
or swift
, a parameter named
* classPrefix
is required. For sdkType
of android
, parameters named
* groupId
, artifactId
, artifactVersion
, and
* invokerPackage
are required. For sdkType
of java
, parameters named
* serviceName
and javaPackageName
are required.
*/
public final Map parameters() {
return parameters;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(restApiId());
hashCode = 31 * hashCode + Objects.hashCode(stageName());
hashCode = 31 * hashCode + Objects.hashCode(sdkType());
hashCode = 31 * hashCode + Objects.hashCode(hasParameters() ? parameters() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetSdkRequest)) {
return false;
}
GetSdkRequest other = (GetSdkRequest) obj;
return Objects.equals(restApiId(), other.restApiId()) && Objects.equals(stageName(), other.stageName())
&& Objects.equals(sdkType(), other.sdkType()) && hasParameters() == other.hasParameters()
&& Objects.equals(parameters(), other.parameters());
}
/**
* 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("GetSdkRequest").add("RestApiId", restApiId()).add("StageName", stageName())
.add("SdkType", sdkType()).add("Parameters", hasParameters() ? parameters() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "restApiId":
return Optional.ofNullable(clazz.cast(restApiId()));
case "stageName":
return Optional.ofNullable(clazz.cast(stageName()));
case "sdkType":
return Optional.ofNullable(clazz.cast(sdkType()));
case "parameters":
return Optional.ofNullable(clazz.cast(parameters()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((GetSdkRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ApiGatewayRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* [Required] The string identifier of the associated RestApi .
*
*
* @param restApiId
* [Required] 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);
/**
*
* [Required] The name of the Stage that the SDK will use.
*
*
* @param stageName
* [Required] The name of the Stage that the SDK will use.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stageName(String stageName);
/**
*
* [Required] The language for the generated SDK. Currently java
, javascript
,
* android
, objectivec
(for iOS), swift
(for iOS), and ruby
* are supported.
*
*
* @param sdkType
* [Required] The language for the generated SDK. Currently java
, javascript
,
* android
, objectivec
(for iOS), swift
(for iOS), and
* ruby
are supported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sdkType(String sdkType);
/**
*
* A string-to-string key-value map of query parameters sdkType
-dependent properties of the SDK.
* For sdkType
of objectivec
or swift
, a parameter named
* classPrefix
is required. For sdkType
of android
, parameters named
* groupId
, artifactId
, artifactVersion
, and invokerPackage
* are required. For sdkType
of java
, parameters named serviceName
and
* javaPackageName
are required.
*
*
* @param parameters
* A string-to-string key-value map of query parameters sdkType
-dependent properties of the
* SDK. For sdkType
of objectivec
or swift
, a parameter named
* classPrefix
is required. For sdkType
of android
, parameters
* named groupId
, artifactId
, artifactVersion
, and
* invokerPackage
are required. For sdkType
of java
, parameters
* named serviceName
and javaPackageName
are required.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder parameters(Map parameters);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ApiGatewayRequest.BuilderImpl implements Builder {
private String restApiId;
private String stageName;
private String sdkType;
private Map parameters = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(GetSdkRequest model) {
super(model);
restApiId(model.restApiId);
stageName(model.stageName);
sdkType(model.sdkType);
parameters(model.parameters);
}
public final String getRestApiId() {
return restApiId;
}
@Override
public final Builder restApiId(String restApiId) {
this.restApiId = restApiId;
return this;
}
public final void setRestApiId(String restApiId) {
this.restApiId = restApiId;
}
public final String getStageName() {
return stageName;
}
@Override
public final Builder stageName(String stageName) {
this.stageName = stageName;
return this;
}
public final void setStageName(String stageName) {
this.stageName = stageName;
}
public final String getSdkType() {
return sdkType;
}
@Override
public final Builder sdkType(String sdkType) {
this.sdkType = sdkType;
return this;
}
public final void setSdkType(String sdkType) {
this.sdkType = sdkType;
}
public final Map getParameters() {
if (parameters instanceof SdkAutoConstructMap) {
return null;
}
return parameters;
}
@Override
public final Builder parameters(Map parameters) {
this.parameters = MapOfStringToStringCopier.copy(parameters);
return this;
}
public final void setParameters(Map parameters) {
this.parameters = MapOfStringToStringCopier.copy(parameters);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public GetSdkRequest build() {
return new GetSdkRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}