software.amazon.awssdk.services.sagemaker.model.DescribeProjectResponse Maven / Gradle / Ivy
Show all versions of sagemaker Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.sagemaker.model;
import java.beans.Transient;
import java.time.Instant;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeProjectResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField PROJECT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectArn").getter(getter(DescribeProjectResponse::projectArn)).setter(setter(Builder::projectArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProjectArn").build()).build();
private static final SdkField PROJECT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectName").getter(getter(DescribeProjectResponse::projectName)).setter(setter(Builder::projectName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProjectName").build()).build();
private static final SdkField PROJECT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectId").getter(getter(DescribeProjectResponse::projectId)).setter(setter(Builder::projectId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProjectId").build()).build();
private static final SdkField PROJECT_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectDescription").getter(getter(DescribeProjectResponse::projectDescription))
.setter(setter(Builder::projectDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProjectDescription").build())
.build();
private static final SdkField SERVICE_CATALOG_PROVISIONING_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ServiceCatalogProvisioningDetails")
.getter(getter(DescribeProjectResponse::serviceCatalogProvisioningDetails))
.setter(setter(Builder::serviceCatalogProvisioningDetails))
.constructor(ServiceCatalogProvisioningDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceCatalogProvisioningDetails")
.build()).build();
private static final SdkField SERVICE_CATALOG_PROVISIONED_PRODUCT_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ServiceCatalogProvisionedProductDetails")
.getter(getter(DescribeProjectResponse::serviceCatalogProvisionedProductDetails))
.setter(setter(Builder::serviceCatalogProvisionedProductDetails))
.constructor(ServiceCatalogProvisionedProductDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ServiceCatalogProvisionedProductDetails").build()).build();
private static final SdkField PROJECT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProjectStatus").getter(getter(DescribeProjectResponse::projectStatusAsString))
.setter(setter(Builder::projectStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProjectStatus").build()).build();
private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("CreatedBy").getter(getter(DescribeProjectResponse::createdBy)).setter(setter(Builder::createdBy))
.constructor(UserContext::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeProjectResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(DescribeProjectResponse::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("LastModifiedBy").getter(getter(DescribeProjectResponse::lastModifiedBy))
.setter(setter(Builder::lastModifiedBy)).constructor(UserContext::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROJECT_ARN_FIELD,
PROJECT_NAME_FIELD, PROJECT_ID_FIELD, PROJECT_DESCRIPTION_FIELD, SERVICE_CATALOG_PROVISIONING_DETAILS_FIELD,
SERVICE_CATALOG_PROVISIONED_PRODUCT_DETAILS_FIELD, PROJECT_STATUS_FIELD, CREATED_BY_FIELD, CREATION_TIME_FIELD,
LAST_MODIFIED_TIME_FIELD, LAST_MODIFIED_BY_FIELD));
private final String projectArn;
private final String projectName;
private final String projectId;
private final String projectDescription;
private final ServiceCatalogProvisioningDetails serviceCatalogProvisioningDetails;
private final ServiceCatalogProvisionedProductDetails serviceCatalogProvisionedProductDetails;
private final String projectStatus;
private final UserContext createdBy;
private final Instant creationTime;
private final Instant lastModifiedTime;
private final UserContext lastModifiedBy;
private DescribeProjectResponse(BuilderImpl builder) {
super(builder);
this.projectArn = builder.projectArn;
this.projectName = builder.projectName;
this.projectId = builder.projectId;
this.projectDescription = builder.projectDescription;
this.serviceCatalogProvisioningDetails = builder.serviceCatalogProvisioningDetails;
this.serviceCatalogProvisionedProductDetails = builder.serviceCatalogProvisionedProductDetails;
this.projectStatus = builder.projectStatus;
this.createdBy = builder.createdBy;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
this.lastModifiedBy = builder.lastModifiedBy;
}
/**
*
* The Amazon Resource Name (ARN) of the project.
*
*
* @return The Amazon Resource Name (ARN) of the project.
*/
public final String projectArn() {
return projectArn;
}
/**
*
* The name of the project.
*
*
* @return The name of the project.
*/
public final String projectName() {
return projectName;
}
/**
*
* The ID of the project.
*
*
* @return The ID of the project.
*/
public final String projectId() {
return projectId;
}
/**
*
* The description of the project.
*
*
* @return The description of the project.
*/
public final String projectDescription() {
return projectDescription;
}
/**
*
* Information used to provision a service catalog product. For information, see What is Amazon Web Services
* Service Catalog.
*
*
* @return Information used to provision a service catalog product. For information, see What is Amazon Web
* Services Service Catalog.
*/
public final ServiceCatalogProvisioningDetails serviceCatalogProvisioningDetails() {
return serviceCatalogProvisioningDetails;
}
/**
*
* Information about a provisioned service catalog product.
*
*
* @return Information about a provisioned service catalog product.
*/
public final ServiceCatalogProvisionedProductDetails serviceCatalogProvisionedProductDetails() {
return serviceCatalogProvisionedProductDetails;
}
/**
*
* The status of the project.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #projectStatus}
* will return {@link ProjectStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #projectStatusAsString}.
*
*
* @return The status of the project.
* @see ProjectStatus
*/
public final ProjectStatus projectStatus() {
return ProjectStatus.fromValue(projectStatus);
}
/**
*
* The status of the project.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #projectStatus}
* will return {@link ProjectStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #projectStatusAsString}.
*
*
* @return The status of the project.
* @see ProjectStatus
*/
public final String projectStatusAsString() {
return projectStatus;
}
/**
* Returns the value of the CreatedBy property for this object.
*
* @return The value of the CreatedBy property for this object.
*/
public final UserContext createdBy() {
return createdBy;
}
/**
*
* The time when the project was created.
*
*
* @return The time when the project was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The timestamp when project was last modified.
*
*
* @return The timestamp when project was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
* Returns the value of the LastModifiedBy property for this object.
*
* @return The value of the LastModifiedBy property for this object.
*/
public final UserContext lastModifiedBy() {
return lastModifiedBy;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(projectArn());
hashCode = 31 * hashCode + Objects.hashCode(projectName());
hashCode = 31 * hashCode + Objects.hashCode(projectId());
hashCode = 31 * hashCode + Objects.hashCode(projectDescription());
hashCode = 31 * hashCode + Objects.hashCode(serviceCatalogProvisioningDetails());
hashCode = 31 * hashCode + Objects.hashCode(serviceCatalogProvisionedProductDetails());
hashCode = 31 * hashCode + Objects.hashCode(projectStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(createdBy());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DescribeProjectResponse)) {
return false;
}
DescribeProjectResponse other = (DescribeProjectResponse) obj;
return Objects.equals(projectArn(), other.projectArn()) && Objects.equals(projectName(), other.projectName())
&& Objects.equals(projectId(), other.projectId())
&& Objects.equals(projectDescription(), other.projectDescription())
&& Objects.equals(serviceCatalogProvisioningDetails(), other.serviceCatalogProvisioningDetails())
&& Objects.equals(serviceCatalogProvisionedProductDetails(), other.serviceCatalogProvisionedProductDetails())
&& Objects.equals(projectStatusAsString(), other.projectStatusAsString())
&& Objects.equals(createdBy(), other.createdBy()) && Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(lastModifiedBy(), other.lastModifiedBy());
}
/**
* 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("DescribeProjectResponse").add("ProjectArn", projectArn()).add("ProjectName", projectName())
.add("ProjectId", projectId()).add("ProjectDescription", projectDescription())
.add("ServiceCatalogProvisioningDetails", serviceCatalogProvisioningDetails())
.add("ServiceCatalogProvisionedProductDetails", serviceCatalogProvisionedProductDetails())
.add("ProjectStatus", projectStatusAsString()).add("CreatedBy", createdBy()).add("CreationTime", creationTime())
.add("LastModifiedTime", lastModifiedTime()).add("LastModifiedBy", lastModifiedBy()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ProjectArn":
return Optional.ofNullable(clazz.cast(projectArn()));
case "ProjectName":
return Optional.ofNullable(clazz.cast(projectName()));
case "ProjectId":
return Optional.ofNullable(clazz.cast(projectId()));
case "ProjectDescription":
return Optional.ofNullable(clazz.cast(projectDescription()));
case "ServiceCatalogProvisioningDetails":
return Optional.ofNullable(clazz.cast(serviceCatalogProvisioningDetails()));
case "ServiceCatalogProvisionedProductDetails":
return Optional.ofNullable(clazz.cast(serviceCatalogProvisionedProductDetails()));
case "ProjectStatus":
return Optional.ofNullable(clazz.cast(projectStatusAsString()));
case "CreatedBy":
return Optional.ofNullable(clazz.cast(createdBy()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "LastModifiedBy":
return Optional.ofNullable(clazz.cast(lastModifiedBy()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function