
software.amazon.awssdk.services.glue.model.GetSchemaVersionRequest Maven / Gradle / Ivy
/*
* 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.glue.model;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetSchemaVersionRequest extends GlueRequest implements
ToCopyableBuilder {
private static final SdkField SCHEMA_ID_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("SchemaId").getter(getter(GetSchemaVersionRequest::schemaId)).setter(setter(Builder::schemaId))
.constructor(SchemaId::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SchemaId").build()).build();
private static final SdkField SCHEMA_VERSION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SchemaVersionId").getter(getter(GetSchemaVersionRequest::schemaVersionId))
.setter(setter(Builder::schemaVersionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SchemaVersionId").build()).build();
private static final SdkField SCHEMA_VERSION_NUMBER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SchemaVersionNumber")
.getter(getter(GetSchemaVersionRequest::schemaVersionNumber)).setter(setter(Builder::schemaVersionNumber))
.constructor(SchemaVersionNumber::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SchemaVersionNumber").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SCHEMA_ID_FIELD,
SCHEMA_VERSION_ID_FIELD, SCHEMA_VERSION_NUMBER_FIELD));
private final SchemaId schemaId;
private final String schemaVersionId;
private final SchemaVersionNumber schemaVersionNumber;
private GetSchemaVersionRequest(BuilderImpl builder) {
super(builder);
this.schemaId = builder.schemaId;
this.schemaVersionId = builder.schemaVersionId;
this.schemaVersionNumber = builder.schemaVersionNumber;
}
/**
*
* This is a wrapper structure to contain schema identity fields. The structure contains:
*
*
* -
*
* SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either SchemaArn
or
* SchemaName
and RegistryName
has to be provided.
*
*
* -
*
* SchemaId$SchemaName: The name of the schema. Either SchemaArn
or SchemaName
and
* RegistryName
has to be provided.
*
*
*
*
* @return This is a wrapper structure to contain schema identity fields. The structure contains:
*
* -
*
* SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either SchemaArn
or
* SchemaName
and RegistryName
has to be provided.
*
*
* -
*
* SchemaId$SchemaName: The name of the schema. Either SchemaArn
or SchemaName
and
* RegistryName
has to be provided.
*
*
*/
public final SchemaId schemaId() {
return schemaId;
}
/**
*
* The SchemaVersionId
of the schema version. This field is required for fetching by schema ID. Either
* this or the SchemaId
wrapper has to be provided.
*
*
* @return The SchemaVersionId
of the schema version. This field is required for fetching by schema ID.
* Either this or the SchemaId
wrapper has to be provided.
*/
public final String schemaVersionId() {
return schemaVersionId;
}
/**
*
* The version number of the schema.
*
*
* @return The version number of the schema.
*/
public final SchemaVersionNumber schemaVersionNumber() {
return schemaVersionNumber;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(schemaId());
hashCode = 31 * hashCode + Objects.hashCode(schemaVersionId());
hashCode = 31 * hashCode + Objects.hashCode(schemaVersionNumber());
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 GetSchemaVersionRequest)) {
return false;
}
GetSchemaVersionRequest other = (GetSchemaVersionRequest) obj;
return Objects.equals(schemaId(), other.schemaId()) && Objects.equals(schemaVersionId(), other.schemaVersionId())
&& Objects.equals(schemaVersionNumber(), other.schemaVersionNumber());
}
/**
* 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("GetSchemaVersionRequest").add("SchemaId", schemaId()).add("SchemaVersionId", schemaVersionId())
.add("SchemaVersionNumber", schemaVersionNumber()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SchemaId":
return Optional.ofNullable(clazz.cast(schemaId()));
case "SchemaVersionId":
return Optional.ofNullable(clazz.cast(schemaVersionId()));
case "SchemaVersionNumber":
return Optional.ofNullable(clazz.cast(schemaVersionNumber()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function