software.amazon.awssdk.services.glue.model.Blueprint Maven / Gradle / Ivy
Show all versions of glue Show documentation
/*
* 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.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.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;
/**
*
* The details of a blueprint.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Blueprint implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(Blueprint::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(Blueprint::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField CREATED_ON_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedOn").getter(getter(Blueprint::createdOn)).setter(setter(Builder::createdOn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedOn").build()).build();
private static final SdkField LAST_MODIFIED_ON_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedOn").getter(getter(Blueprint::lastModifiedOn)).setter(setter(Builder::lastModifiedOn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedOn").build()).build();
private static final SdkField PARAMETER_SPEC_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ParameterSpec").getter(getter(Blueprint::parameterSpec)).setter(setter(Builder::parameterSpec))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterSpec").build()).build();
private static final SdkField BLUEPRINT_LOCATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BlueprintLocation").getter(getter(Blueprint::blueprintLocation))
.setter(setter(Builder::blueprintLocation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlueprintLocation").build()).build();
private static final SdkField BLUEPRINT_SERVICE_LOCATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BlueprintServiceLocation").getter(getter(Blueprint::blueprintServiceLocation))
.setter(setter(Builder::blueprintServiceLocation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlueprintServiceLocation").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(Blueprint::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ErrorMessage").getter(getter(Blueprint::errorMessage)).setter(setter(Builder::errorMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorMessage").build()).build();
private static final SdkField LAST_ACTIVE_DEFINITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LastActiveDefinition")
.getter(getter(Blueprint::lastActiveDefinition)).setter(setter(Builder::lastActiveDefinition))
.constructor(LastActiveDefinition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastActiveDefinition").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
CREATED_ON_FIELD, LAST_MODIFIED_ON_FIELD, PARAMETER_SPEC_FIELD, BLUEPRINT_LOCATION_FIELD,
BLUEPRINT_SERVICE_LOCATION_FIELD, STATUS_FIELD, ERROR_MESSAGE_FIELD, LAST_ACTIVE_DEFINITION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("Name", NAME_FIELD);
put("Description", DESCRIPTION_FIELD);
put("CreatedOn", CREATED_ON_FIELD);
put("LastModifiedOn", LAST_MODIFIED_ON_FIELD);
put("ParameterSpec", PARAMETER_SPEC_FIELD);
put("BlueprintLocation", BLUEPRINT_LOCATION_FIELD);
put("BlueprintServiceLocation", BLUEPRINT_SERVICE_LOCATION_FIELD);
put("Status", STATUS_FIELD);
put("ErrorMessage", ERROR_MESSAGE_FIELD);
put("LastActiveDefinition", LAST_ACTIVE_DEFINITION_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String name;
private final String description;
private final Instant createdOn;
private final Instant lastModifiedOn;
private final String parameterSpec;
private final String blueprintLocation;
private final String blueprintServiceLocation;
private final String status;
private final String errorMessage;
private final LastActiveDefinition lastActiveDefinition;
private Blueprint(BuilderImpl builder) {
this.name = builder.name;
this.description = builder.description;
this.createdOn = builder.createdOn;
this.lastModifiedOn = builder.lastModifiedOn;
this.parameterSpec = builder.parameterSpec;
this.blueprintLocation = builder.blueprintLocation;
this.blueprintServiceLocation = builder.blueprintServiceLocation;
this.status = builder.status;
this.errorMessage = builder.errorMessage;
this.lastActiveDefinition = builder.lastActiveDefinition;
}
/**
*
* The name of the blueprint.
*
*
* @return The name of the blueprint.
*/
public final String name() {
return name;
}
/**
*
* The description of the blueprint.
*
*
* @return The description of the blueprint.
*/
public final String description() {
return description;
}
/**
*
* The date and time the blueprint was registered.
*
*
* @return The date and time the blueprint was registered.
*/
public final Instant createdOn() {
return createdOn;
}
/**
*
* The date and time the blueprint was last modified.
*
*
* @return The date and time the blueprint was last modified.
*/
public final Instant lastModifiedOn() {
return lastModifiedOn;
}
/**
*
* A JSON string that indicates the list of parameter specifications for the blueprint.
*
*
* @return A JSON string that indicates the list of parameter specifications for the blueprint.
*/
public final String parameterSpec() {
return parameterSpec;
}
/**
*
* Specifies the path in Amazon S3 where the blueprint is published.
*
*
* @return Specifies the path in Amazon S3 where the blueprint is published.
*/
public final String blueprintLocation() {
return blueprintLocation;
}
/**
*
* Specifies a path in Amazon S3 where the blueprint is copied when you call
* CreateBlueprint/UpdateBlueprint
to register the blueprint in Glue.
*
*
* @return Specifies a path in Amazon S3 where the blueprint is copied when you call
* CreateBlueprint/UpdateBlueprint
to register the blueprint in Glue.
*/
public final String blueprintServiceLocation() {
return blueprintServiceLocation;
}
/**
*
* The status of the blueprint registration.
*
*
* -
*
* Creating — The blueprint registration is in progress.
*
*
* -
*
* Active — The blueprint has been successfully registered.
*
*
* -
*
* Updating — An update to the blueprint registration is in progress.
*
*
* -
*
* Failed — The blueprint registration failed.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link BlueprintStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the blueprint registration.
*
* -
*
* Creating — The blueprint registration is in progress.
*
*
* -
*
* Active — The blueprint has been successfully registered.
*
*
* -
*
* Updating — An update to the blueprint registration is in progress.
*
*
* -
*
* Failed — The blueprint registration failed.
*
*
* @see BlueprintStatus
*/
public final BlueprintStatus status() {
return BlueprintStatus.fromValue(status);
}
/**
*
* The status of the blueprint registration.
*
*
* -
*
* Creating — The blueprint registration is in progress.
*
*
* -
*
* Active — The blueprint has been successfully registered.
*
*
* -
*
* Updating — An update to the blueprint registration is in progress.
*
*
* -
*
* Failed — The blueprint registration failed.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link BlueprintStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the blueprint registration.
*
* -
*
* Creating — The blueprint registration is in progress.
*
*
* -
*
* Active — The blueprint has been successfully registered.
*
*
* -
*
* Updating — An update to the blueprint registration is in progress.
*
*
* -
*
* Failed — The blueprint registration failed.
*
*
* @see BlueprintStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* An error message.
*
*
* @return An error message.
*/
public final String errorMessage() {
return errorMessage;
}
/**
*
* When there are multiple versions of a blueprint and the latest version has some errors, this attribute indicates
* the last successful blueprint definition that is available with the service.
*
*
* @return When there are multiple versions of a blueprint and the latest version has some errors, this attribute
* indicates the last successful blueprint definition that is available with the service.
*/
public final LastActiveDefinition lastActiveDefinition() {
return lastActiveDefinition;
}
@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 + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(createdOn());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedOn());
hashCode = 31 * hashCode + Objects.hashCode(parameterSpec());
hashCode = 31 * hashCode + Objects.hashCode(blueprintLocation());
hashCode = 31 * hashCode + Objects.hashCode(blueprintServiceLocation());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(errorMessage());
hashCode = 31 * hashCode + Objects.hashCode(lastActiveDefinition());
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 Blueprint)) {
return false;
}
Blueprint other = (Blueprint) obj;
return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description())
&& Objects.equals(createdOn(), other.createdOn()) && Objects.equals(lastModifiedOn(), other.lastModifiedOn())
&& Objects.equals(parameterSpec(), other.parameterSpec())
&& Objects.equals(blueprintLocation(), other.blueprintLocation())
&& Objects.equals(blueprintServiceLocation(), other.blueprintServiceLocation())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(errorMessage(), other.errorMessage())
&& Objects.equals(lastActiveDefinition(), other.lastActiveDefinition());
}
/**
* 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("Blueprint").add("Name", name()).add("Description", description()).add("CreatedOn", createdOn())
.add("LastModifiedOn", lastModifiedOn()).add("ParameterSpec", parameterSpec())
.add("BlueprintLocation", blueprintLocation()).add("BlueprintServiceLocation", blueprintServiceLocation())
.add("Status", statusAsString()).add("ErrorMessage", errorMessage())
.add("LastActiveDefinition", lastActiveDefinition()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "CreatedOn":
return Optional.ofNullable(clazz.cast(createdOn()));
case "LastModifiedOn":
return Optional.ofNullable(clazz.cast(lastModifiedOn()));
case "ParameterSpec":
return Optional.ofNullable(clazz.cast(parameterSpec()));
case "BlueprintLocation":
return Optional.ofNullable(clazz.cast(blueprintLocation()));
case "BlueprintServiceLocation":
return Optional.ofNullable(clazz.cast(blueprintServiceLocation()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "ErrorMessage":
return Optional.ofNullable(clazz.cast(errorMessage()));
case "LastActiveDefinition":
return Optional.ofNullable(clazz.cast(lastActiveDefinition()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function