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

software.amazon.awssdk.services.pcs.model.Cluster Maven / Gradle / Ivy

Go to download

The AWS Java SDK for PCS module holds the client classes that are used for communicating with PCS.

There is a newer version: 2.29.40
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.pcs.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The cluster resource and configuration. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Cluster implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(Cluster::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id") .getter(getter(Cluster::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(Cluster::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(Cluster::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("createdAt") .getter(getter(Cluster::createdAt)) .setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField MODIFIED_AT_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("modifiedAt") .getter(getter(Cluster::modifiedAt)) .setter(setter(Builder::modifiedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modifiedAt").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField SCHEDULER_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("scheduler").getter(getter(Cluster::scheduler)).setter(setter(Builder::scheduler)) .constructor(Scheduler::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scheduler").build()).build(); private static final SdkField SIZE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("size") .getter(getter(Cluster::sizeAsString)).setter(setter(Builder::size)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("size").build()).build(); private static final SdkField SLURM_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("slurmConfiguration") .getter(getter(Cluster::slurmConfiguration)).setter(setter(Builder::slurmConfiguration)) .constructor(ClusterSlurmConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("slurmConfiguration").build()) .build(); private static final SdkField NETWORKING_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("networking").getter(getter(Cluster::networking)).setter(setter(Builder::networking)) .constructor(Networking::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("networking").build()).build(); private static final SdkField> ENDPOINTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("endpoints") .getter(getter(Cluster::endpoints)) .setter(setter(Builder::endpoints)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endpoints").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Endpoint::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> ERROR_INFO_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("errorInfo") .getter(getter(Cluster::errorInfo)) .setter(setter(Builder::errorInfo)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorInfo").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ErrorInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, ID_FIELD, ARN_FIELD, STATUS_FIELD, CREATED_AT_FIELD, MODIFIED_AT_FIELD, SCHEDULER_FIELD, SIZE_FIELD, SLURM_CONFIGURATION_FIELD, NETWORKING_FIELD, ENDPOINTS_FIELD, ERROR_INFO_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("name", NAME_FIELD); put("id", ID_FIELD); put("arn", ARN_FIELD); put("status", STATUS_FIELD); put("createdAt", CREATED_AT_FIELD); put("modifiedAt", MODIFIED_AT_FIELD); put("scheduler", SCHEDULER_FIELD); put("size", SIZE_FIELD); put("slurmConfiguration", SLURM_CONFIGURATION_FIELD); put("networking", NETWORKING_FIELD); put("endpoints", ENDPOINTS_FIELD); put("errorInfo", ERROR_INFO_FIELD); } }); private static final long serialVersionUID = 1L; private final String name; private final String id; private final String arn; private final String status; private final Instant createdAt; private final Instant modifiedAt; private final Scheduler scheduler; private final String size; private final ClusterSlurmConfiguration slurmConfiguration; private final Networking networking; private final List endpoints; private final List errorInfo; private Cluster(BuilderImpl builder) { this.name = builder.name; this.id = builder.id; this.arn = builder.arn; this.status = builder.status; this.createdAt = builder.createdAt; this.modifiedAt = builder.modifiedAt; this.scheduler = builder.scheduler; this.size = builder.size; this.slurmConfiguration = builder.slurmConfiguration; this.networking = builder.networking; this.endpoints = builder.endpoints; this.errorInfo = builder.errorInfo; } /** *

* The name that identifies the cluster. *

* * @return The name that identifies the cluster. */ public final String name() { return name; } /** *

* The generated unique ID of the cluster. *

* * @return The generated unique ID of the cluster. */ public final String id() { return id; } /** *

* The unique Amazon Resource Name (ARN) of the cluster. *

* * @return The unique Amazon Resource Name (ARN) of the cluster. */ public final String arn() { return arn; } /** *

* The provisioning status of the cluster. *

* *

* The provisioning status doesn't indicate the overall health of the cluster. *

*
*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ClusterStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The provisioning status of the cluster.

*

* The provisioning status doesn't indicate the overall health of the cluster. *

* @see ClusterStatus */ public final ClusterStatus status() { return ClusterStatus.fromValue(status); } /** *

* The provisioning status of the cluster. *

* *

* The provisioning status doesn't indicate the overall health of the cluster. *

*
*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ClusterStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The provisioning status of the cluster.

*

* The provisioning status doesn't indicate the overall health of the cluster. *

* @see ClusterStatus */ public final String statusAsString() { return status; } /** *

* The date and time the resource was created. *

* * @return The date and time the resource was created. */ public final Instant createdAt() { return createdAt; } /** *

* The date and time the resource was modified. *

* * @return The date and time the resource was modified. */ public final Instant modifiedAt() { return modifiedAt; } /** * Returns the value of the Scheduler property for this object. * * @return The value of the Scheduler property for this object. */ public final Scheduler scheduler() { return scheduler; } /** *

* The size of the cluster. *

*
    *
  • *

    * SMALL: 32 compute nodes and 256 jobs *

    *
  • *
  • *

    * MEDIUM: 512 compute nodes and 8192 jobs *

    *
  • *
  • *

    * LARGE: 2048 compute nodes and 16,384 jobs *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #size} will return * {@link Size#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #sizeAsString}. *

* * @return The size of the cluster.

*
    *
  • *

    * SMALL: 32 compute nodes and 256 jobs *

    *
  • *
  • *

    * MEDIUM: 512 compute nodes and 8192 jobs *

    *
  • *
  • *

    * LARGE: 2048 compute nodes and 16,384 jobs *

    *
  • * @see Size */ public final Size size() { return Size.fromValue(size); } /** *

    * The size of the cluster. *

    *
      *
    • *

      * SMALL: 32 compute nodes and 256 jobs *

      *
    • *
    • *

      * MEDIUM: 512 compute nodes and 8192 jobs *

      *
    • *
    • *

      * LARGE: 2048 compute nodes and 16,384 jobs *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #size} will return * {@link Size#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #sizeAsString}. *

    * * @return The size of the cluster.

    *
      *
    • *

      * SMALL: 32 compute nodes and 256 jobs *

      *
    • *
    • *

      * MEDIUM: 512 compute nodes and 8192 jobs *

      *
    • *
    • *

      * LARGE: 2048 compute nodes and 16,384 jobs *

      *
    • * @see Size */ public final String sizeAsString() { return size; } /** *

      * Additional options related to the Slurm scheduler. *

      * * @return Additional options related to the Slurm scheduler. */ public final ClusterSlurmConfiguration slurmConfiguration() { return slurmConfiguration; } /** * Returns the value of the Networking property for this object. * * @return The value of the Networking property for this object. */ public final Networking networking() { return networking; } /** * For responses, this returns true if the service returned a value for the Endpoints property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasEndpoints() { return endpoints != null && !(endpoints instanceof SdkAutoConstructList); } /** *

      * The list of endpoints available for interaction with the scheduler. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasEndpoints} method. *

      * * @return The list of endpoints available for interaction with the scheduler. */ public final List endpoints() { return endpoints; } /** * For responses, this returns true if the service returned a value for the ErrorInfo property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasErrorInfo() { return errorInfo != null && !(errorInfo instanceof SdkAutoConstructList); } /** *

      * The list of errors that occurred during cluster provisioning. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasErrorInfo} method. *

      * * @return The list of errors that occurred during cluster provisioning. */ public final List errorInfo() { return errorInfo; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(modifiedAt()); hashCode = 31 * hashCode + Objects.hashCode(scheduler()); hashCode = 31 * hashCode + Objects.hashCode(sizeAsString()); hashCode = 31 * hashCode + Objects.hashCode(slurmConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(networking()); hashCode = 31 * hashCode + Objects.hashCode(hasEndpoints() ? endpoints() : null); hashCode = 31 * hashCode + Objects.hashCode(hasErrorInfo() ? errorInfo() : null); 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 Cluster)) { return false; } Cluster other = (Cluster) obj; return Objects.equals(name(), other.name()) && Objects.equals(id(), other.id()) && Objects.equals(arn(), other.arn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(modifiedAt(), other.modifiedAt()) && Objects.equals(scheduler(), other.scheduler()) && Objects.equals(sizeAsString(), other.sizeAsString()) && Objects.equals(slurmConfiguration(), other.slurmConfiguration()) && Objects.equals(networking(), other.networking()) && hasEndpoints() == other.hasEndpoints() && Objects.equals(endpoints(), other.endpoints()) && hasErrorInfo() == other.hasErrorInfo() && Objects.equals(errorInfo(), other.errorInfo()); } /** * 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("Cluster").add("Name", name()).add("Id", id()).add("Arn", arn()).add("Status", statusAsString()) .add("CreatedAt", createdAt()).add("ModifiedAt", modifiedAt()).add("Scheduler", scheduler()) .add("Size", sizeAsString()).add("SlurmConfiguration", slurmConfiguration()).add("Networking", networking()) .add("Endpoints", hasEndpoints() ? endpoints() : null).add("ErrorInfo", hasErrorInfo() ? errorInfo() : null) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "id": return Optional.ofNullable(clazz.cast(id())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "modifiedAt": return Optional.ofNullable(clazz.cast(modifiedAt())); case "scheduler": return Optional.ofNullable(clazz.cast(scheduler())); case "size": return Optional.ofNullable(clazz.cast(sizeAsString())); case "slurmConfiguration": return Optional.ofNullable(clazz.cast(slurmConfiguration())); case "networking": return Optional.ofNullable(clazz.cast(networking())); case "endpoints": return Optional.ofNullable(clazz.cast(endpoints())); case "errorInfo": return Optional.ofNullable(clazz.cast(errorInfo())); 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((Cluster) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The name that identifies the cluster. *

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

      * The generated unique ID of the cluster. *

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

      * The unique Amazon Resource Name (ARN) of the cluster. *

      * * @param arn * The unique Amazon Resource Name (ARN) of the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

      * The provisioning status of the cluster. *

      * *

      * The provisioning status doesn't indicate the overall health of the cluster. *

      *
      * * @param status * The provisioning status of the cluster.

      *

      * The provisioning status doesn't indicate the overall health of the cluster. *

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

      * The provisioning status of the cluster. *

      * *

      * The provisioning status doesn't indicate the overall health of the cluster. *

      *
      * * @param status * The provisioning status of the cluster.

      *

      * The provisioning status doesn't indicate the overall health of the cluster. *

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

      * The date and time the resource was created. *

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

      * The date and time the resource was modified. *

      * * @param modifiedAt * The date and time the resource was modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modifiedAt(Instant modifiedAt); /** * Sets the value of the Scheduler property for this object. * * @param scheduler * The new value for the Scheduler property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scheduler(Scheduler scheduler); /** * Sets the value of the Scheduler property for this object. * * This is a convenience method that creates an instance of the {@link Scheduler.Builder} avoiding the need to * create one manually via {@link Scheduler#builder()}. * *

      * When the {@link Consumer} completes, {@link Scheduler.Builder#build()} is called immediately and its result * is passed to {@link #scheduler(Scheduler)}. * * @param scheduler * a consumer that will call methods on {@link Scheduler.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #scheduler(Scheduler) */ default Builder scheduler(Consumer scheduler) { return scheduler(Scheduler.builder().applyMutation(scheduler).build()); } /** *

      * The size of the cluster. *

      *
        *
      • *

        * SMALL: 32 compute nodes and 256 jobs *

        *
      • *
      • *

        * MEDIUM: 512 compute nodes and 8192 jobs *

        *
      • *
      • *

        * LARGE: 2048 compute nodes and 16,384 jobs *

        *
      • *
      * * @param size * The size of the cluster.

      *
        *
      • *

        * SMALL: 32 compute nodes and 256 jobs *

        *
      • *
      • *

        * MEDIUM: 512 compute nodes and 8192 jobs *

        *
      • *
      • *

        * LARGE: 2048 compute nodes and 16,384 jobs *

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

        * The size of the cluster. *

        *
          *
        • *

          * SMALL: 32 compute nodes and 256 jobs *

          *
        • *
        • *

          * MEDIUM: 512 compute nodes and 8192 jobs *

          *
        • *
        • *

          * LARGE: 2048 compute nodes and 16,384 jobs *

          *
        • *
        * * @param size * The size of the cluster.

        *
          *
        • *

          * SMALL: 32 compute nodes and 256 jobs *

          *
        • *
        • *

          * MEDIUM: 512 compute nodes and 8192 jobs *

          *
        • *
        • *

          * LARGE: 2048 compute nodes and 16,384 jobs *

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

          * Additional options related to the Slurm scheduler. *

          * * @param slurmConfiguration * Additional options related to the Slurm scheduler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slurmConfiguration(ClusterSlurmConfiguration slurmConfiguration); /** *

          * Additional options related to the Slurm scheduler. *

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

          * When the {@link Consumer} completes, {@link ClusterSlurmConfiguration.Builder#build()} is called immediately * and its result is passed to {@link #slurmConfiguration(ClusterSlurmConfiguration)}. * * @param slurmConfiguration * a consumer that will call methods on {@link ClusterSlurmConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #slurmConfiguration(ClusterSlurmConfiguration) */ default Builder slurmConfiguration(Consumer slurmConfiguration) { return slurmConfiguration(ClusterSlurmConfiguration.builder().applyMutation(slurmConfiguration).build()); } /** * Sets the value of the Networking property for this object. * * @param networking * The new value for the Networking property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networking(Networking networking); /** * Sets the value of the Networking property for this object. * * This is a convenience method that creates an instance of the {@link Networking.Builder} avoiding the need to * create one manually via {@link Networking#builder()}. * *

          * When the {@link Consumer} completes, {@link Networking.Builder#build()} is called immediately and its result * is passed to {@link #networking(Networking)}. * * @param networking * a consumer that will call methods on {@link Networking.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #networking(Networking) */ default Builder networking(Consumer networking) { return networking(Networking.builder().applyMutation(networking).build()); } /** *

          * The list of endpoints available for interaction with the scheduler. *

          * * @param endpoints * The list of endpoints available for interaction with the scheduler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpoints(Collection endpoints); /** *

          * The list of endpoints available for interaction with the scheduler. *

          * * @param endpoints * The list of endpoints available for interaction with the scheduler. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endpoints(Endpoint... endpoints); /** *

          * The list of endpoints available for interaction with the scheduler. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.pcs.model.Endpoint.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.pcs.model.Endpoint#builder()}. * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.pcs.model.Endpoint.Builder#build()} is called immediately and its * result is passed to {@link #endpoints(List)}. * * @param endpoints * a consumer that will call methods on * {@link software.amazon.awssdk.services.pcs.model.Endpoint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endpoints(java.util.Collection) */ Builder endpoints(Consumer... endpoints); /** *

          * The list of errors that occurred during cluster provisioning. *

          * * @param errorInfo * The list of errors that occurred during cluster provisioning. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorInfo(Collection errorInfo); /** *

          * The list of errors that occurred during cluster provisioning. *

          * * @param errorInfo * The list of errors that occurred during cluster provisioning. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorInfo(ErrorInfo... errorInfo); /** *

          * The list of errors that occurred during cluster provisioning. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.pcs.model.ErrorInfo.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.pcs.model.ErrorInfo#builder()}. * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.pcs.model.ErrorInfo.Builder#build()} is called immediately and its * result is passed to {@link #errorInfo(List)}. * * @param errorInfo * a consumer that will call methods on * {@link software.amazon.awssdk.services.pcs.model.ErrorInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #errorInfo(java.util.Collection) */ Builder errorInfo(Consumer... errorInfo); } static final class BuilderImpl implements Builder { private String name; private String id; private String arn; private String status; private Instant createdAt; private Instant modifiedAt; private Scheduler scheduler; private String size; private ClusterSlurmConfiguration slurmConfiguration; private Networking networking; private List endpoints = DefaultSdkAutoConstructList.getInstance(); private List errorInfo = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(Cluster model) { name(model.name); id(model.id); arn(model.arn); status(model.status); createdAt(model.createdAt); modifiedAt(model.modifiedAt); scheduler(model.scheduler); size(model.size); slurmConfiguration(model.slurmConfiguration); networking(model.networking); endpoints(model.endpoints); errorInfo(model.errorInfo); } 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 getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; 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(ClusterStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getModifiedAt() { return modifiedAt; } public final void setModifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; } @Override public final Builder modifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; return this; } public final Scheduler.Builder getScheduler() { return scheduler != null ? scheduler.toBuilder() : null; } public final void setScheduler(Scheduler.BuilderImpl scheduler) { this.scheduler = scheduler != null ? scheduler.build() : null; } @Override public final Builder scheduler(Scheduler scheduler) { this.scheduler = scheduler; return this; } public final String getSize() { return size; } public final void setSize(String size) { this.size = size; } @Override public final Builder size(String size) { this.size = size; return this; } @Override public final Builder size(Size size) { this.size(size == null ? null : size.toString()); return this; } public final ClusterSlurmConfiguration.Builder getSlurmConfiguration() { return slurmConfiguration != null ? slurmConfiguration.toBuilder() : null; } public final void setSlurmConfiguration(ClusterSlurmConfiguration.BuilderImpl slurmConfiguration) { this.slurmConfiguration = slurmConfiguration != null ? slurmConfiguration.build() : null; } @Override public final Builder slurmConfiguration(ClusterSlurmConfiguration slurmConfiguration) { this.slurmConfiguration = slurmConfiguration; return this; } public final Networking.Builder getNetworking() { return networking != null ? networking.toBuilder() : null; } public final void setNetworking(Networking.BuilderImpl networking) { this.networking = networking != null ? networking.build() : null; } @Override public final Builder networking(Networking networking) { this.networking = networking; return this; } public final List getEndpoints() { List result = EndpointsCopier.copyToBuilder(this.endpoints); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setEndpoints(Collection endpoints) { this.endpoints = EndpointsCopier.copyFromBuilder(endpoints); } @Override public final Builder endpoints(Collection endpoints) { this.endpoints = EndpointsCopier.copy(endpoints); return this; } @Override @SafeVarargs public final Builder endpoints(Endpoint... endpoints) { endpoints(Arrays.asList(endpoints)); return this; } @Override @SafeVarargs public final Builder endpoints(Consumer... endpoints) { endpoints(Stream.of(endpoints).map(c -> Endpoint.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getErrorInfo() { List result = ErrorInfoListCopier.copyToBuilder(this.errorInfo); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setErrorInfo(Collection errorInfo) { this.errorInfo = ErrorInfoListCopier.copyFromBuilder(errorInfo); } @Override public final Builder errorInfo(Collection errorInfo) { this.errorInfo = ErrorInfoListCopier.copy(errorInfo); return this; } @Override @SafeVarargs public final Builder errorInfo(ErrorInfo... errorInfo) { errorInfo(Arrays.asList(errorInfo)); return this; } @Override @SafeVarargs public final Builder errorInfo(Consumer... errorInfo) { errorInfo(Stream.of(errorInfo).map(c -> ErrorInfo.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } @Override public Cluster build() { return new Cluster(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy