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

software.amazon.awssdk.services.glue.model.Blueprint Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Glue module holds the client classes that are used for communicating with AWS Glue Service

There is a newer version: 2.29.39
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.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 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 getter(Function g) { return obj -> g.apply((Blueprint) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The name of the blueprint. *

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

      * The description of the blueprint. *

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

      * The date and time the blueprint was registered. *

      * * @param createdOn * The date and time the blueprint was registered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdOn(Instant createdOn); /** *

      * The date and time the blueprint was last modified. *

      * * @param lastModifiedOn * The date and time the blueprint was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedOn(Instant lastModifiedOn); /** *

      * A JSON string that indicates the list of parameter specifications for the blueprint. *

      * * @param parameterSpec * A JSON string that indicates the list of parameter specifications for the blueprint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterSpec(String parameterSpec); /** *

      * Specifies the path in Amazon S3 where the blueprint is published. *

      * * @param blueprintLocation * Specifies the path in Amazon S3 where the blueprint is published. * @return Returns a reference to this object so that method calls can be chained together. */ Builder blueprintLocation(String blueprintLocation); /** *

      * Specifies a path in Amazon S3 where the blueprint is copied when you call * CreateBlueprint/UpdateBlueprint to register the blueprint in Glue. *

      * * @param blueprintServiceLocation * Specifies a path in Amazon S3 where the blueprint is copied when you call * CreateBlueprint/UpdateBlueprint to register the blueprint in Glue. * @return Returns a reference to this object so that method calls can be chained together. */ Builder blueprintServiceLocation(String 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. *

        *
      • *
      * * @param 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. *

        *
      • * @see BlueprintStatus * @return Returns a reference to this object so that method calls can be chained together. * @see BlueprintStatus */ Builder status(String 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. *

          *
        • *
        * * @param 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. *

          *
        • * @see BlueprintStatus * @return Returns a reference to this object so that method calls can be chained together. * @see BlueprintStatus */ Builder status(BlueprintStatus status); /** *

          * An error message. *

          * * @param errorMessage * An error message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorMessage(String 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. *

          * * @param lastActiveDefinition * 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 Returns a reference to this object so that method calls can be chained together. */ Builder lastActiveDefinition(LastActiveDefinition lastActiveDefinition); /** *

          * 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. *

          * This is a convenience method that creates an instance of the {@link LastActiveDefinition.Builder} avoiding * the need to create one manually via {@link LastActiveDefinition#builder()}. * *

          * When the {@link Consumer} completes, {@link LastActiveDefinition.Builder#build()} is called immediately and * its result is passed to {@link #lastActiveDefinition(LastActiveDefinition)}. * * @param lastActiveDefinition * a consumer that will call methods on {@link LastActiveDefinition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #lastActiveDefinition(LastActiveDefinition) */ default Builder lastActiveDefinition(Consumer lastActiveDefinition) { return lastActiveDefinition(LastActiveDefinition.builder().applyMutation(lastActiveDefinition).build()); } } static final class BuilderImpl implements Builder { private String name; private String description; private Instant createdOn; private Instant lastModifiedOn; private String parameterSpec; private String blueprintLocation; private String blueprintServiceLocation; private String status; private String errorMessage; private LastActiveDefinition lastActiveDefinition; private BuilderImpl() { } private BuilderImpl(Blueprint model) { name(model.name); description(model.description); createdOn(model.createdOn); lastModifiedOn(model.lastModifiedOn); parameterSpec(model.parameterSpec); blueprintLocation(model.blueprintLocation); blueprintServiceLocation(model.blueprintServiceLocation); status(model.status); errorMessage(model.errorMessage); lastActiveDefinition(model.lastActiveDefinition); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Instant getCreatedOn() { return createdOn; } public final void setCreatedOn(Instant createdOn) { this.createdOn = createdOn; } @Override public final Builder createdOn(Instant createdOn) { this.createdOn = createdOn; return this; } public final Instant getLastModifiedOn() { return lastModifiedOn; } public final void setLastModifiedOn(Instant lastModifiedOn) { this.lastModifiedOn = lastModifiedOn; } @Override public final Builder lastModifiedOn(Instant lastModifiedOn) { this.lastModifiedOn = lastModifiedOn; return this; } public final String getParameterSpec() { return parameterSpec; } public final void setParameterSpec(String parameterSpec) { this.parameterSpec = parameterSpec; } @Override public final Builder parameterSpec(String parameterSpec) { this.parameterSpec = parameterSpec; return this; } public final String getBlueprintLocation() { return blueprintLocation; } public final void setBlueprintLocation(String blueprintLocation) { this.blueprintLocation = blueprintLocation; } @Override public final Builder blueprintLocation(String blueprintLocation) { this.blueprintLocation = blueprintLocation; return this; } public final String getBlueprintServiceLocation() { return blueprintServiceLocation; } public final void setBlueprintServiceLocation(String blueprintServiceLocation) { this.blueprintServiceLocation = blueprintServiceLocation; } @Override public final Builder blueprintServiceLocation(String blueprintServiceLocation) { this.blueprintServiceLocation = blueprintServiceLocation; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(BlueprintStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getErrorMessage() { return errorMessage; } public final void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @Override public final Builder errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } public final LastActiveDefinition.Builder getLastActiveDefinition() { return lastActiveDefinition != null ? lastActiveDefinition.toBuilder() : null; } public final void setLastActiveDefinition(LastActiveDefinition.BuilderImpl lastActiveDefinition) { this.lastActiveDefinition = lastActiveDefinition != null ? lastActiveDefinition.build() : null; } @Override public final Builder lastActiveDefinition(LastActiveDefinition lastActiveDefinition) { this.lastActiveDefinition = lastActiveDefinition; return this; } @Override public Blueprint build() { return new Blueprint(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy