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

software.amazon.awssdk.services.cloud9.model.Environment Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Cloud9 module holds the client classes that are used for communicating with AWS Cloud9 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.cloud9.model;

import java.io.Serializable;
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.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;

/**
 * 

* Information about an AWS Cloud9 development environment. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Environment implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id") .getter(getter(Environment::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(Environment::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(Environment::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build(); private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type") .getter(getter(Environment::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build(); private static final SdkField CONNECTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectionType").getter(getter(Environment::connectionTypeAsString)) .setter(setter(Builder::connectionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionType").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(Environment::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField OWNER_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ownerArn").getter(getter(Environment::ownerArn)).setter(setter(Builder::ownerArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerArn").build()).build(); private static final SdkField LIFECYCLE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("lifecycle") .getter(getter(Environment::lifecycle)).setter(setter(Builder::lifecycle)).constructor(EnvironmentLifecycle::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lifecycle").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, NAME_FIELD, DESCRIPTION_FIELD, TYPE_FIELD, CONNECTION_TYPE_FIELD, ARN_FIELD, OWNER_ARN_FIELD, LIFECYCLE_FIELD)); private static final long serialVersionUID = 1L; private final String id; private final String name; private final String description; private final String type; private final String connectionType; private final String arn; private final String ownerArn; private final EnvironmentLifecycle lifecycle; private Environment(BuilderImpl builder) { this.id = builder.id; this.name = builder.name; this.description = builder.description; this.type = builder.type; this.connectionType = builder.connectionType; this.arn = builder.arn; this.ownerArn = builder.ownerArn; this.lifecycle = builder.lifecycle; } /** *

* The ID of the environment. *

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

* The name of the environment. *

* * @return The name of the environment. */ public final String name() { return name; } /** *

* The description for the environment. *

* * @return The description for the environment. */ public final String description() { return description; } /** *

* The type of environment. Valid values include the following: *

*
    *
  • *

    * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

    *
  • *
  • *

    * ssh: Your own server connects to the environment. *

    *
  • *
*

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

* * @return The type of environment. Valid values include the following:

*
    *
  • *

    * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

    *
  • *
  • *

    * ssh: Your own server connects to the environment. *

    *
  • * @see EnvironmentType */ public final EnvironmentType type() { return EnvironmentType.fromValue(type); } /** *

    * The type of environment. Valid values include the following: *

    *
      *
    • *

      * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

      *
    • *
    • *

      * ssh: Your own server connects to the environment. *

      *
    • *
    *

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

    * * @return The type of environment. Valid values include the following:

    *
      *
    • *

      * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

      *
    • *
    • *

      * ssh: Your own server connects to the environment. *

      *
    • * @see EnvironmentType */ public final String typeAsString() { return type; } /** *

      * The connection type used for connecting to an Amazon EC2 environment. *

      *

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

      * * @return The connection type used for connecting to an Amazon EC2 environment. * @see ConnectionType */ public final ConnectionType connectionType() { return ConnectionType.fromValue(connectionType); } /** *

      * The connection type used for connecting to an Amazon EC2 environment. *

      *

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

      * * @return The connection type used for connecting to an Amazon EC2 environment. * @see ConnectionType */ public final String connectionTypeAsString() { return connectionType; } /** *

      * The Amazon Resource Name (ARN) of the environment. *

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

      * The Amazon Resource Name (ARN) of the environment owner. *

      * * @return The Amazon Resource Name (ARN) of the environment owner. */ public final String ownerArn() { return ownerArn; } /** *

      * The state of the environment in its creation or deletion lifecycle. *

      * * @return The state of the environment in its creation or deletion lifecycle. */ public final EnvironmentLifecycle lifecycle() { return lifecycle; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(connectionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(ownerArn()); hashCode = 31 * hashCode + Objects.hashCode(lifecycle()); 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 Environment)) { return false; } Environment other = (Environment) obj; return Objects.equals(id(), other.id()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(connectionTypeAsString(), other.connectionTypeAsString()) && Objects.equals(arn(), other.arn()) && Objects.equals(ownerArn(), other.ownerArn()) && Objects.equals(lifecycle(), other.lifecycle()); } /** * 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("Environment").add("Id", id()).add("Name", name()) .add("Description", description() == null ? null : "*** Sensitive Data Redacted ***").add("Type", typeAsString()) .add("ConnectionType", connectionTypeAsString()).add("Arn", arn()).add("OwnerArn", ownerArn()) .add("Lifecycle", lifecycle()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "id": return Optional.ofNullable(clazz.cast(id())); case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "connectionType": return Optional.ofNullable(clazz.cast(connectionTypeAsString())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "ownerArn": return Optional.ofNullable(clazz.cast(ownerArn())); case "lifecycle": return Optional.ofNullable(clazz.cast(lifecycle())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Environment) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The ID of the environment. *

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

      * The name of the environment. *

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

      * The description for the environment. *

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

      * The type of environment. Valid values include the following: *

      *
        *
      • *

        * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

        *
      • *
      • *

        * ssh: Your own server connects to the environment. *

        *
      • *
      * * @param type * The type of environment. Valid values include the following:

      *
        *
      • *

        * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

        *
      • *
      • *

        * ssh: Your own server connects to the environment. *

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

        * The type of environment. Valid values include the following: *

        *
          *
        • *

          * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

          *
        • *
        • *

          * ssh: Your own server connects to the environment. *

          *
        • *
        * * @param type * The type of environment. Valid values include the following:

        *
          *
        • *

          * ec2: An Amazon Elastic Compute Cloud (Amazon EC2) instance connects to the environment. *

          *
        • *
        • *

          * ssh: Your own server connects to the environment. *

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

          * The connection type used for connecting to an Amazon EC2 environment. *

          * * @param connectionType * The connection type used for connecting to an Amazon EC2 environment. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(String connectionType); /** *

          * The connection type used for connecting to an Amazon EC2 environment. *

          * * @param connectionType * The connection type used for connecting to an Amazon EC2 environment. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(ConnectionType connectionType); /** *

          * The Amazon Resource Name (ARN) of the environment. *

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

          * The Amazon Resource Name (ARN) of the environment owner. *

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

          * The state of the environment in its creation or deletion lifecycle. *

          * * @param lifecycle * The state of the environment in its creation or deletion lifecycle. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lifecycle(EnvironmentLifecycle lifecycle); /** *

          * The state of the environment in its creation or deletion lifecycle. *

          * This is a convenience that creates an instance of the {@link EnvironmentLifecycle.Builder} avoiding the need * to create one manually via {@link EnvironmentLifecycle#builder()}. * * When the {@link Consumer} completes, {@link EnvironmentLifecycle.Builder#build()} is called immediately and * its result is passed to {@link #lifecycle(EnvironmentLifecycle)}. * * @param lifecycle * a consumer that will call methods on {@link EnvironmentLifecycle.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #lifecycle(EnvironmentLifecycle) */ default Builder lifecycle(Consumer lifecycle) { return lifecycle(EnvironmentLifecycle.builder().applyMutation(lifecycle).build()); } } static final class BuilderImpl implements Builder { private String id; private String name; private String description; private String type; private String connectionType; private String arn; private String ownerArn; private EnvironmentLifecycle lifecycle; private BuilderImpl() { } private BuilderImpl(Environment model) { id(model.id); name(model.name); description(model.description); type(model.type); connectionType(model.connectionType); arn(model.arn); ownerArn(model.ownerArn); lifecycle(model.lifecycle); } public final String getId() { return id; } @Override public final Builder id(String id) { this.id = id; return this; } public final void setId(String id) { this.id = id; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final String getType() { return type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(EnvironmentType type) { this.type(type == null ? null : type.toString()); return this; } public final void setType(String type) { this.type = type; } public final String getConnectionType() { return connectionType; } @Override public final Builder connectionType(String connectionType) { this.connectionType = connectionType; return this; } @Override public final Builder connectionType(ConnectionType connectionType) { this.connectionType(connectionType == null ? null : connectionType.toString()); return this; } public final void setConnectionType(String connectionType) { this.connectionType = connectionType; } public final String getArn() { return arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final void setArn(String arn) { this.arn = arn; } public final String getOwnerArn() { return ownerArn; } @Override public final Builder ownerArn(String ownerArn) { this.ownerArn = ownerArn; return this; } public final void setOwnerArn(String ownerArn) { this.ownerArn = ownerArn; } public final EnvironmentLifecycle.Builder getLifecycle() { return lifecycle != null ? lifecycle.toBuilder() : null; } @Override public final Builder lifecycle(EnvironmentLifecycle lifecycle) { this.lifecycle = lifecycle; return this; } public final void setLifecycle(EnvironmentLifecycle.BuilderImpl lifecycle) { this.lifecycle = lifecycle != null ? lifecycle.build() : null; } @Override public Environment build() { return new Environment(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy