
software.amazon.awssdk.services.finspace.model.Environment Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.finspace.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;
/**
*
* Represents an FinSpace environment.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Environment implements SdkPojo, Serializable, ToCopyableBuilder {
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 ENVIRONMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("environmentId").getter(getter(Environment::environmentId)).setter(setter(Builder::environmentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentId").build()).build();
private static final SdkField AWS_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("awsAccountId").getter(getter(Environment::awsAccountId)).setter(setter(Builder::awsAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awsAccountId").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(Environment::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField ENVIRONMENT_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("environmentUrl").getter(getter(Environment::environmentUrl)).setter(setter(Builder::environmentUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentUrl").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 ENVIRONMENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("environmentArn").getter(getter(Environment::environmentArn)).setter(setter(Builder::environmentArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentArn").build()).build();
private static final SdkField SAGE_MAKER_STUDIO_DOMAIN_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sageMakerStudioDomainUrl").getter(getter(Environment::sageMakerStudioDomainUrl))
.setter(setter(Builder::sageMakerStudioDomainUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sageMakerStudioDomainUrl").build())
.build();
private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("kmsKeyId").getter(getter(Environment::kmsKeyId)).setter(setter(Builder::kmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyId").build()).build();
private static final SdkField DEDICATED_SERVICE_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("dedicatedServiceAccountId").getter(getter(Environment::dedicatedServiceAccountId))
.setter(setter(Builder::dedicatedServiceAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dedicatedServiceAccountId").build())
.build();
private static final SdkField FEDERATION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("federationMode").getter(getter(Environment::federationModeAsString))
.setter(setter(Builder::federationMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("federationMode").build()).build();
private static final SdkField FEDERATION_PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("federationParameters")
.getter(getter(Environment::federationParameters)).setter(setter(Builder::federationParameters))
.constructor(FederationParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("federationParameters").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD,
ENVIRONMENT_ID_FIELD, AWS_ACCOUNT_ID_FIELD, STATUS_FIELD, ENVIRONMENT_URL_FIELD, DESCRIPTION_FIELD,
ENVIRONMENT_ARN_FIELD, SAGE_MAKER_STUDIO_DOMAIN_URL_FIELD, KMS_KEY_ID_FIELD, DEDICATED_SERVICE_ACCOUNT_ID_FIELD,
FEDERATION_MODE_FIELD, FEDERATION_PARAMETERS_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String environmentId;
private final String awsAccountId;
private final String status;
private final String environmentUrl;
private final String description;
private final String environmentArn;
private final String sageMakerStudioDomainUrl;
private final String kmsKeyId;
private final String dedicatedServiceAccountId;
private final String federationMode;
private final FederationParameters federationParameters;
private Environment(BuilderImpl builder) {
this.name = builder.name;
this.environmentId = builder.environmentId;
this.awsAccountId = builder.awsAccountId;
this.status = builder.status;
this.environmentUrl = builder.environmentUrl;
this.description = builder.description;
this.environmentArn = builder.environmentArn;
this.sageMakerStudioDomainUrl = builder.sageMakerStudioDomainUrl;
this.kmsKeyId = builder.kmsKeyId;
this.dedicatedServiceAccountId = builder.dedicatedServiceAccountId;
this.federationMode = builder.federationMode;
this.federationParameters = builder.federationParameters;
}
/**
*
* The name of the FinSpace environment.
*
*
* @return The name of the FinSpace environment.
*/
public final String name() {
return name;
}
/**
*
* The identifier of the FinSpace environment.
*
*
* @return The identifier of the FinSpace environment.
*/
public final String environmentId() {
return environmentId;
}
/**
*
* The ID of the AWS account in which the FinSpace environment is created.
*
*
* @return The ID of the AWS account in which the FinSpace environment is created.
*/
public final String awsAccountId() {
return awsAccountId;
}
/**
*
* The current status of creation of the FinSpace environment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link EnvironmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of creation of the FinSpace environment.
* @see EnvironmentStatus
*/
public final EnvironmentStatus status() {
return EnvironmentStatus.fromValue(status);
}
/**
*
* The current status of creation of the FinSpace environment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link EnvironmentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of creation of the FinSpace environment.
* @see EnvironmentStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The sign-in url for the web application of your FinSpace environment.
*
*
* @return The sign-in url for the web application of your FinSpace environment.
*/
public final String environmentUrl() {
return environmentUrl;
}
/**
*
* The description of the FinSpace environment.
*
*
* @return The description of the FinSpace environment.
*/
public final String description() {
return description;
}
/**
*
* The Amazon Resource Name (ARN) of your FinSpace environment.
*
*
* @return The Amazon Resource Name (ARN) of your FinSpace environment.
*/
public final String environmentArn() {
return environmentArn;
}
/**
*
* The url of the integrated FinSpace notebook environment in your web application.
*
*
* @return The url of the integrated FinSpace notebook environment in your web application.
*/
public final String sageMakerStudioDomainUrl() {
return sageMakerStudioDomainUrl;
}
/**
*
* The KMS key id used to encrypt in the FinSpace environment.
*
*
* @return The KMS key id used to encrypt in the FinSpace environment.
*/
public final String kmsKeyId() {
return kmsKeyId;
}
/**
*
* The AWS account ID of the dedicated service account associated with your FinSpace environment.
*
*
* @return The AWS account ID of the dedicated service account associated with your FinSpace environment.
*/
public final String dedicatedServiceAccountId() {
return dedicatedServiceAccountId;
}
/**
*
* The authentication mode for the environment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #federationMode}
* will return {@link FederationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #federationModeAsString}.
*
*
* @return The authentication mode for the environment.
* @see FederationMode
*/
public final FederationMode federationMode() {
return FederationMode.fromValue(federationMode);
}
/**
*
* The authentication mode for the environment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #federationMode}
* will return {@link FederationMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #federationModeAsString}.
*
*
* @return The authentication mode for the environment.
* @see FederationMode
*/
public final String federationModeAsString() {
return federationMode;
}
/**
*
* Configuration information when authentication mode is FEDERATED.
*
*
* @return Configuration information when authentication mode is FEDERATED.
*/
public final FederationParameters federationParameters() {
return federationParameters;
}
@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(environmentId());
hashCode = 31 * hashCode + Objects.hashCode(awsAccountId());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(environmentUrl());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(environmentArn());
hashCode = 31 * hashCode + Objects.hashCode(sageMakerStudioDomainUrl());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(dedicatedServiceAccountId());
hashCode = 31 * hashCode + Objects.hashCode(federationModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(federationParameters());
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(name(), other.name()) && Objects.equals(environmentId(), other.environmentId())
&& Objects.equals(awsAccountId(), other.awsAccountId())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(environmentUrl(), other.environmentUrl()) && Objects.equals(description(), other.description())
&& Objects.equals(environmentArn(), other.environmentArn())
&& Objects.equals(sageMakerStudioDomainUrl(), other.sageMakerStudioDomainUrl())
&& Objects.equals(kmsKeyId(), other.kmsKeyId())
&& Objects.equals(dedicatedServiceAccountId(), other.dedicatedServiceAccountId())
&& Objects.equals(federationModeAsString(), other.federationModeAsString())
&& Objects.equals(federationParameters(), other.federationParameters());
}
/**
* 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("Name", name()).add("EnvironmentId", environmentId())
.add("AwsAccountId", awsAccountId()).add("Status", statusAsString()).add("EnvironmentUrl", environmentUrl())
.add("Description", description()).add("EnvironmentArn", environmentArn())
.add("SageMakerStudioDomainUrl", sageMakerStudioDomainUrl()).add("KmsKeyId", kmsKeyId())
.add("DedicatedServiceAccountId", dedicatedServiceAccountId()).add("FederationMode", federationModeAsString())
.add("FederationParameters", federationParameters()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "environmentId":
return Optional.ofNullable(clazz.cast(environmentId()));
case "awsAccountId":
return Optional.ofNullable(clazz.cast(awsAccountId()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "environmentUrl":
return Optional.ofNullable(clazz.cast(environmentUrl()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "environmentArn":
return Optional.ofNullable(clazz.cast(environmentArn()));
case "sageMakerStudioDomainUrl":
return Optional.ofNullable(clazz.cast(sageMakerStudioDomainUrl()));
case "kmsKeyId":
return Optional.ofNullable(clazz.cast(kmsKeyId()));
case "dedicatedServiceAccountId":
return Optional.ofNullable(clazz.cast(dedicatedServiceAccountId()));
case "federationMode":
return Optional.ofNullable(clazz.cast(federationModeAsString()));
case "federationParameters":
return Optional.ofNullable(clazz.cast(federationParameters()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function