Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.wisdom.model.ContentSummary Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Wisdom module holds the client classes that are used for
communicating with Wisdom.
/*
* 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.wisdom.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
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.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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Summary information about the content.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ContentSummary implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CONTENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("contentArn").getter(getter(ContentSummary::contentArn)).setter(setter(Builder::contentArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("contentArn").build()).build();
private static final SdkField CONTENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("contentId").getter(getter(ContentSummary::contentId)).setter(setter(Builder::contentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("contentId").build()).build();
private static final SdkField CONTENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("contentType").getter(getter(ContentSummary::contentType)).setter(setter(Builder::contentType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("contentType").build()).build();
private static final SdkField KNOWLEDGE_BASE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("knowledgeBaseArn").getter(getter(ContentSummary::knowledgeBaseArn))
.setter(setter(Builder::knowledgeBaseArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("knowledgeBaseArn").build()).build();
private static final SdkField KNOWLEDGE_BASE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("knowledgeBaseId").getter(getter(ContentSummary::knowledgeBaseId))
.setter(setter(Builder::knowledgeBaseId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("knowledgeBaseId").build()).build();
private static final SdkField> METADATA_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("metadata")
.getter(getter(ContentSummary::metadata))
.setter(setter(Builder::metadata))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("metadata").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(ContentSummary::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField REVISION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("revisionId").getter(getter(ContentSummary::revisionId)).setter(setter(Builder::revisionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("revisionId").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(ContentSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(ContentSummary::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField TITLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("title")
.getter(getter(ContentSummary::title)).setter(setter(Builder::title))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("title").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTENT_ARN_FIELD,
CONTENT_ID_FIELD, CONTENT_TYPE_FIELD, KNOWLEDGE_BASE_ARN_FIELD, KNOWLEDGE_BASE_ID_FIELD, METADATA_FIELD, NAME_FIELD,
REVISION_ID_FIELD, STATUS_FIELD, TAGS_FIELD, TITLE_FIELD));
private static final long serialVersionUID = 1L;
private final String contentArn;
private final String contentId;
private final String contentType;
private final String knowledgeBaseArn;
private final String knowledgeBaseId;
private final Map metadata;
private final String name;
private final String revisionId;
private final String status;
private final Map tags;
private final String title;
private ContentSummary(BuilderImpl builder) {
this.contentArn = builder.contentArn;
this.contentId = builder.contentId;
this.contentType = builder.contentType;
this.knowledgeBaseArn = builder.knowledgeBaseArn;
this.knowledgeBaseId = builder.knowledgeBaseId;
this.metadata = builder.metadata;
this.name = builder.name;
this.revisionId = builder.revisionId;
this.status = builder.status;
this.tags = builder.tags;
this.title = builder.title;
}
/**
*
* The Amazon Resource Name (ARN) of the content.
*
*
* @return The Amazon Resource Name (ARN) of the content.
*/
public final String contentArn() {
return contentArn;
}
/**
*
* The identifier of the content.
*
*
* @return The identifier of the content.
*/
public final String contentId() {
return contentId;
}
/**
*
* The media type of the content.
*
*
* @return The media type of the content.
*/
public final String contentType() {
return contentType;
}
/**
*
* The Amazon Resource Name (ARN) of the knowledge base.
*
*
* @return The Amazon Resource Name (ARN) of the knowledge base.
*/
public final String knowledgeBaseArn() {
return knowledgeBaseArn;
}
/**
*
* The identifier of the knowledge base.
*
*
* @return The identifier of the knowledge base.
*/
public final String knowledgeBaseId() {
return knowledgeBaseId;
}
/**
* For responses, this returns true if the service returned a value for the Metadata 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 hasMetadata() {
return metadata != null && !(metadata instanceof SdkAutoConstructMap);
}
/**
*
* A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing
* data between an external system and Wisdom, you can store an external version identifier as metadata to utilize
* for determining drift.
*
*
* 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 #hasMetadata} method.
*
*
* @return A key/value map to store attributes without affecting tagging or recommendations. For example, when
* synchronizing data between an external system and Wisdom, you can store an external version identifier as
* metadata to utilize for determining drift.
*/
public final Map metadata() {
return metadata;
}
/**
*
* The name of the content.
*
*
* @return The name of the content.
*/
public final String name() {
return name;
}
/**
*
* The identifier of the revision of the content.
*
*
* @return The identifier of the revision of the content.
*/
public final String revisionId() {
return revisionId;
}
/**
*
* The status of the content.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ContentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the content.
* @see ContentStatus
*/
public final ContentStatus status() {
return ContentStatus.fromValue(status);
}
/**
*
* The status of the content.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ContentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the content.
* @see ContentStatus
*/
public final String statusAsString() {
return status;
}
/**
* For responses, this returns true if the service returned a value for the Tags 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 hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The tags used to organize, track, or control access for this resource.
*
*
* 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 #hasTags} method.
*
*
* @return The tags used to organize, track, or control access for this resource.
*/
public final Map tags() {
return tags;
}
/**
*
* The title of the content.
*
*
* @return The title of the content.
*/
public final String title() {
return title;
}
@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(contentArn());
hashCode = 31 * hashCode + Objects.hashCode(contentId());
hashCode = 31 * hashCode + Objects.hashCode(contentType());
hashCode = 31 * hashCode + Objects.hashCode(knowledgeBaseArn());
hashCode = 31 * hashCode + Objects.hashCode(knowledgeBaseId());
hashCode = 31 * hashCode + Objects.hashCode(hasMetadata() ? metadata() : null);
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(revisionId());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(title());
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 ContentSummary)) {
return false;
}
ContentSummary other = (ContentSummary) obj;
return Objects.equals(contentArn(), other.contentArn()) && Objects.equals(contentId(), other.contentId())
&& Objects.equals(contentType(), other.contentType())
&& Objects.equals(knowledgeBaseArn(), other.knowledgeBaseArn())
&& Objects.equals(knowledgeBaseId(), other.knowledgeBaseId()) && hasMetadata() == other.hasMetadata()
&& Objects.equals(metadata(), other.metadata()) && Objects.equals(name(), other.name())
&& Objects.equals(revisionId(), other.revisionId()) && Objects.equals(statusAsString(), other.statusAsString())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(title(), other.title());
}
/**
* 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("ContentSummary").add("ContentArn", contentArn()).add("ContentId", contentId())
.add("ContentType", contentType()).add("KnowledgeBaseArn", knowledgeBaseArn())
.add("KnowledgeBaseId", knowledgeBaseId()).add("Metadata", hasMetadata() ? metadata() : null).add("Name", name())
.add("RevisionId", revisionId()).add("Status", statusAsString()).add("Tags", hasTags() ? tags() : null)
.add("Title", title()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "contentArn":
return Optional.ofNullable(clazz.cast(contentArn()));
case "contentId":
return Optional.ofNullable(clazz.cast(contentId()));
case "contentType":
return Optional.ofNullable(clazz.cast(contentType()));
case "knowledgeBaseArn":
return Optional.ofNullable(clazz.cast(knowledgeBaseArn()));
case "knowledgeBaseId":
return Optional.ofNullable(clazz.cast(knowledgeBaseId()));
case "metadata":
return Optional.ofNullable(clazz.cast(metadata()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "revisionId":
return Optional.ofNullable(clazz.cast(revisionId()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
case "title":
return Optional.ofNullable(clazz.cast(title()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((ContentSummary) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The Amazon Resource Name (ARN) of the content.
*
*
* @param contentArn
* The Amazon Resource Name (ARN) of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contentArn(String contentArn);
/**
*
* The identifier of the content.
*
*
* @param contentId
* The identifier of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contentId(String contentId);
/**
*
* The media type of the content.
*
*
* @param contentType
* The media type of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder contentType(String contentType);
/**
*
* The Amazon Resource Name (ARN) of the knowledge base.
*
*
* @param knowledgeBaseArn
* The Amazon Resource Name (ARN) of the knowledge base.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder knowledgeBaseArn(String knowledgeBaseArn);
/**
*
* The identifier of the knowledge base.
*
*
* @param knowledgeBaseId
* The identifier of the knowledge base.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder knowledgeBaseId(String knowledgeBaseId);
/**
*
* A key/value map to store attributes without affecting tagging or recommendations. For example, when
* synchronizing data between an external system and Wisdom, you can store an external version identifier as
* metadata to utilize for determining drift.
*
*
* @param metadata
* A key/value map to store attributes without affecting tagging or recommendations. For example, when
* synchronizing data between an external system and Wisdom, you can store an external version identifier
* as metadata to utilize for determining drift.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder metadata(Map metadata);
/**
*
* The name of the content.
*
*
* @param name
* The name of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* The identifier of the revision of the content.
*
*
* @param revisionId
* The identifier of the revision of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder revisionId(String revisionId);
/**
*
* The status of the content.
*
*
* @param status
* The status of the content.
* @see ContentStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ContentStatus
*/
Builder status(String status);
/**
*
* The status of the content.
*
*
* @param status
* The status of the content.
* @see ContentStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ContentStatus
*/
Builder status(ContentStatus status);
/**
*
* The tags used to organize, track, or control access for this resource.
*
*
* @param tags
* The tags used to organize, track, or control access for this resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* The title of the content.
*
*
* @param title
* The title of the content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder title(String title);
}
static final class BuilderImpl implements Builder {
private String contentArn;
private String contentId;
private String contentType;
private String knowledgeBaseArn;
private String knowledgeBaseId;
private Map metadata = DefaultSdkAutoConstructMap.getInstance();
private String name;
private String revisionId;
private String status;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private String title;
private BuilderImpl() {
}
private BuilderImpl(ContentSummary model) {
contentArn(model.contentArn);
contentId(model.contentId);
contentType(model.contentType);
knowledgeBaseArn(model.knowledgeBaseArn);
knowledgeBaseId(model.knowledgeBaseId);
metadata(model.metadata);
name(model.name);
revisionId(model.revisionId);
status(model.status);
tags(model.tags);
title(model.title);
}
public final String getContentArn() {
return contentArn;
}
public final void setContentArn(String contentArn) {
this.contentArn = contentArn;
}
@Override
public final Builder contentArn(String contentArn) {
this.contentArn = contentArn;
return this;
}
public final String getContentId() {
return contentId;
}
public final void setContentId(String contentId) {
this.contentId = contentId;
}
@Override
public final Builder contentId(String contentId) {
this.contentId = contentId;
return this;
}
public final String getContentType() {
return contentType;
}
public final void setContentType(String contentType) {
this.contentType = contentType;
}
@Override
public final Builder contentType(String contentType) {
this.contentType = contentType;
return this;
}
public final String getKnowledgeBaseArn() {
return knowledgeBaseArn;
}
public final void setKnowledgeBaseArn(String knowledgeBaseArn) {
this.knowledgeBaseArn = knowledgeBaseArn;
}
@Override
public final Builder knowledgeBaseArn(String knowledgeBaseArn) {
this.knowledgeBaseArn = knowledgeBaseArn;
return this;
}
public final String getKnowledgeBaseId() {
return knowledgeBaseId;
}
public final void setKnowledgeBaseId(String knowledgeBaseId) {
this.knowledgeBaseId = knowledgeBaseId;
}
@Override
public final Builder knowledgeBaseId(String knowledgeBaseId) {
this.knowledgeBaseId = knowledgeBaseId;
return this;
}
public final Map getMetadata() {
if (metadata instanceof SdkAutoConstructMap) {
return null;
}
return metadata;
}
public final void setMetadata(Map metadata) {
this.metadata = ContentMetadataCopier.copy(metadata);
}
@Override
public final Builder metadata(Map metadata) {
this.metadata = ContentMetadataCopier.copy(metadata);
return this;
}
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 getRevisionId() {
return revisionId;
}
public final void setRevisionId(String revisionId) {
this.revisionId = revisionId;
}
@Override
public final Builder revisionId(String revisionId) {
this.revisionId = revisionId;
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(ContentStatus status) {
this.status(status == null ? null : status.toString());
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
public final String getTitle() {
return title;
}
public final void setTitle(String title) {
this.title = title;
}
@Override
public final Builder title(String title) {
this.title = title;
return this;
}
@Override
public ContentSummary build() {
return new ContentSummary(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}